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

Allow React apps to define their own script/style dependencies #6

Open
josephfusco opened this issue Jan 19, 2021 · 2 comments
Open

Comments

@josephfusco
Copy link
Contributor

React application's loaded into WordPress with this loader should be able to define their own script/style dependencies.

Examples

  • React app X might require jquery (I know this is a poor example). Rather than importing it's own copy of jquery, it has the ability to use WordPress core's jquery script.
  • React app X might require that the WordPress theme's base styles should be loaded before its own styles.
@tarikhamilton
Copy link

tarikhamilton commented Jan 19, 2021

Awesome. I think I did some research too on the solution for the second one: stylesheet enqueue order priority. If I recall, react-app-loader adds the stylesheets calling wp_enqueue_style directly, but if you add it as an action, the priority can be set, so maybe that could be an argument for the setup function. I wonder if the default should be to set high by default?

@josephfusco
Copy link
Contributor Author

@tarikhamilton thanks for the feedback. I like your priority suggestion. I'll look into that when working this issue.

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

2 participants