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

Automatic dependency setup for scripts/styles #1052

Closed
nerrad opened this issue Apr 5, 2019 · 0 comments
Closed

Automatic dependency setup for scripts/styles #1052

nerrad opened this issue Apr 5, 2019 · 0 comments

Comments

@nerrad
Copy link
Contributor

nerrad commented Apr 5, 2019

I'm filing this issue so I don't forget it. GB is going to be experimenting with having a webpack plugin generate a json file that can be read by php to automatically configure dependencies using the right script handles for various dependencies. I really like that idea as it reduces the chance for human error with manual dependency configuration.

The current issue to track is here WordPress/gutenberg#14837
Related pull: WordPress/gutenberg#14869

For our needs it will be complicated a bit because we have (I think) a fairly robust php asset management system but I think it's reasonable that we could have a getDependenciesFor( 'script-handle' ) utility method that parses from this json file.

@joshfeck joshfeck assigned nerrad and unassigned joshfeck Apr 29, 2019
@nerrad nerrad closed this as completed in b2701ae Jun 4, 2019
eeteamcodebase pushed a commit that referenced this issue Jun 4, 2019
…atic dependency management/externals generation to build process 🎉(fixes #1052) (#1286)

* various changes/updates to webpack configs

* Add dependency extraction webpack plugin

* remove unused  dependencies for react-redux and redux

Neither of these packages are used so we can stop including them everywhere.  They can be added back in if we ever have need for them.

* dependency map extractor configuration for externals and external to script handle map.

* update all depedency registrations

* update build files (dev)

* add back in changes removed in a bad rebase

* make webpack config more dry.

* update build files (dev)

* remove unneccesary delete

* fix typo (copy pasta) in webpack.prod.js

* some more DRY work for asset manager

* relocate wp css handles for dependency generation

* add default return for condition where there isn’t a registered manifest file

* remove unnecessary Domain injection

* more implementations of asset helpers
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants