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

refactor: loader only approach #2

Closed
wants to merge 2 commits into from

Conversation

kellymears
Copy link

@kellymears kellymears commented Jul 24, 2023

This is a broad refactor.

I wanted to suggest this approach as I think it simplifies things a great deal and makes the functionality fully cacheable in a straight forward way.

Two major notes:

  1. I did not implement adoption because I did not fully understand the distinction between include and adopt.
    But, whatever it is, I think it could be added back with some conditional checks in the WpEditorRemoveRules plugin.

  2. I don't think my handling of AtRules edge cases is as thorough as yours. To be honest, I didn't want to have to deal with all the intricacies, I only wanted to prove the concept. The robustness of the existing approach could/should be added back in.

Feel free to re-implement it, add to it, ignore it. Thanks!

@talss89
Copy link
Owner

talss89 commented Sep 12, 2023

Thanks a lot for this. Your take on it made me rethink things.

I've rewritten the plugin as a bud extension in ESM / TS, using your loader only approach.

Still had to put in a bit of jank to make it work properly with all the combinations of @media syntax.

Closing this PR in favour of the new extension: https://github.com/talss89/bud-wp-editor-query

@talss89 talss89 closed this Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants