Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate the tbela99/css parser #1159

Open
oliverklee opened this issue Jul 16, 2022 · 4 comments
Open

Investigate the tbela99/css parser #1159

oliverklee opened this issue Jul 16, 2022 · 4 comments

Comments

@oliverklee
Copy link
Contributor

This parser looks quite promising: https://github.com/tbela99/css It requires PHP >= 8.0, though.

@JakeQZ
Copy link
Contributor

JakeQZ commented Jul 16, 2022

Is it any or much better than PHP-CSS-Parser, and is it worth the effort making switching possible?

I suppose in some ways checking it out could help us streamline our interfaces, so that in theory the user/implementor could select which CSS parser they want, if it really matters, and there could be an interfacing class which is a wrapping on the box containing the unknown CSS parser.

@oliverklee
Copy link
Contributor Author

oliverklee commented Jul 17, 2022

Mostly, its code seems to be more modern, and it seems to have a better test coverage. (On the down side, it seems to be as much of a one-person project as our current CSS parser).

@tbela99
Copy link

tbela99 commented Jul 17, 2022

Thanks for your interest in that project. I would like to answer some of your questions

@JakeQZ JakeQZ changed the title Ivestigate the tbela99/css parser Investigate the tbela99/css parser Oct 12, 2022
@JakeQZ
Copy link
Contributor

JakeQZ commented Oct 13, 2022

* There is a php 5.6 and up version at https://github.com/tbela99/css/tree/php56-backport . It is on par with the php 8 branch.

Not sure how that would or could work with Composer. But next year PHP 7.4 will be EOL, so that will become a non-issue.

And a project to incorporate this or allow switching of parsers is not likely to be completed by then (we also have day jobs).

could help us streamline our interfaces, so that in theory the user/implementor could select which CSS parser they want

We do need to tidy up and refactor some of our code in this area. Using the Sabberworm parser was a start, but there is more to be done. We still have some ugly code using string-indexed arrays rather than classes.

I think we should do this ahead of #994. And doing so would probably also resolve quite a few other open issues. When we have a really clean and tidy codebase, we can think about #994 - otherwise we would be trying to run before we can walk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants