Modernize frontend build, remove asset-loader dependency#178
Modernize frontend build, remove asset-loader dependency#178kadamwhite merged 30 commits intodevelopfrom
Conversation
…compatibility issues with react-select v3
…types/react-select
…compatibility with react-select v5, and modern build tooling
…d remove BellOnBundlerErrorPlugin
…lement TODO: Investigate and adjust markup if needed
roborourke
left a comment
There was a problem hiding this comment.
This looks great. Some optional improvements where I’ve commented, though the css version I would definitely be wary of as what you’ve got now for production is a very sticky
inc/namespace.php
Outdated
| 'handle' => STYLE_HANDLE, | ||
| ] | ||
| $css_path = plugin_dir_path( __DIR__ ) . 'build/style-index.css'; | ||
| $css_version = is_readable( $css_path ) |
There was a problem hiding this comment.
I think you can use the same version as the JS from its asset.php file. My observation has been that it updates even if you only change the css, as it’s included via the JS.
There was a problem hiding this comment.
I haven't found that to be the case; just tested a bunch of SCSS-only updates and the JS file retained the same hash.
There was a problem hiding this comment.
@roborourke did additional research, and what we've found:
if you name the CSS file anything other than
style.cssorstyle.scssit will update the asset bundle hash
| withSelect( mapSelectToProps ), | ||
| ] )( AuthorsSelect ); | ||
| withSelect( mapSelectToProps ) | ||
| )( AuthorsSelect ) as any; |
There was a problem hiding this comment.
Definitely no specific type of or types available?
92b278b to
a234ed4
Compare
goldenapples
left a comment
There was a problem hiding this comment.
Looked at the changes since last review, all look good to me.
|
Thank you @kadamwhite! ❤️ |
This PR builds on top of #158, which had previously addressed a deprecated HOC in the drag and drop interface.
.asset.phpand use native WP enqueue methods for scripts and styles, removing the dependency on Asset_Loadernpm startdev serverView the build changes I made independent from #158: d0d5da1...build-updates
Notes
Note
My current understanding is that
wp-scriptsis not going anywhere and will eventually be updated to use the new build tool internally. By conforming to the existingwp-scriptsAPI, we should minimize future update needs.Note
I am considering the PHPCS CI failure out-of-scope for this PR, see #179 and #180 -- I'd like to get review on each, then we can land them in sequence to ensure this passes before merge