-
-
Notifications
You must be signed in to change notification settings - Fork 236
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
feat(parse5): change parser/tokenizer methods to be protected #996
Conversation
Some projects in the wild depend on extending `Parser` and `Tokenizer` by overriding certain methods and using internals we don't publish on our public API. This just moves all the private members to be protected so those projects can upgrade to 7.x. Not everything should be protected but it seems our current class members all fit the criteria.
@fb55 any chance you can help with getting this over the line and releasing it? it'll unblock some work in salesforce and google im trying to sort out |
I’d personally prefer to drop the |
@wooorm do you mean you're calling those private (now protected in this branch) methods from outside? i.e. as opposed to calling it within a subclass ( if thats the case, it suggests these are public methods really, yeah. maybe you could help with an example of why you need to call those methods publicly |
See https://github.com/syntax-tree/hast-util-raw. |
interesting! i wonder if it'd make more sense that you implement that logic as a custom parser? you could inherit something like that. but ofc thats a big job so its unlikely even if you agree, it'd get done any time soon i think. so im not sure... we can make them public so you don't need to refactor, or we can keep them protected and aim to one day rework your code |
My only holdback against |
@wooorm are you ok if we go ahead with i feel like there's probably a cleaner solution than just making everything public for you too, e.g. exposing more helpful public APIs you can use |
I think it doesn’t break my code, indeed. So indeed, this does not affect me, and that’s okay! |
@fb55 not sure how you've been publishing releases, so would you mind getting one published some day? no rush. or can let me know what process you've been following and i'll do the same |
I went to open an issue/PR asking for exactly this and discovered the exact change I was hoping for had just recently been merged. Kudos and thanks! |
@divmain thats because i also had a branch lying around for updating LWC's parse5! 😂 i still have some other changes this will unblock in lwc though, so ill open a pr just for those |
Some projects in the wild depend on extending
Parser
andTokenizer
by overriding certain methods and using internals we don't publish on our public API.This just moves all the private members to be protected so those projects can upgrade to 7.x.
Not everything should be protected but it seems our current class members all fit the criteria.
Fixes #992
i think this should be fine but let me know your thoughts @fb55