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

Create an accompanying composer package which provides utility functions for the JS counterparts #187

Open
fabiankaegy opened this issue Jan 9, 2023 · 2 comments
Labels

Comments

@fabiankaegy
Copy link
Member

Currently, there are many components that make everything much easier on the JS side of things. But it's still a pain in PHP. So I think we should create a composer package that gets releases alongside the npm package with the same functionality in PHP.

Here are some examples of what this should include:

  • register icons similar to how it works in JS
  • render an icon that was registered
  • render the markup of a link that was created with the link component
  • render the markup that was created with an image component
@fabiankaegy
Copy link
Member Author

Once we have such a system we can also tackle some larger issues like for example automatic query exclusion of items that get hand-picked using the content picker in any blocks.

@fabiankaegy
Copy link
Member Author

I'm still trying to decide whether a composer package is the right choice or whether building this as a plugin would be a better idea. If we would be building it as a plugin it would allow us to more easily manage updates of both dependencies. We could even do something similar to WordPress core and woocommerce where we have our own version of the dependency extraction webpack plugin which handles enqueueing all of the appropriate scripts at the correct time and place.

This would also fix #97

But it has the huge downside of making it a little harder to adopt the package for anyone not using the 10up scaffold, toolkit etc.

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

No branches or pull requests

1 participant