Build: Enable React Fast Refresh for block development#2519
Closed
gziolo wants to merge 5 commits into
Closed
Conversation
This was referenced Apr 5, 2022
Closed
anton-vlasenko
suggested changes
Apr 6, 2022
anton-vlasenko
left a comment
There was a problem hiding this comment.
@gziolo It would be nice to add a PHPUnit test for wp_register_development_scripts.
I'd be happy to assist with that.
Also, please see my notes below.
Thank you.
9cc28c4 to
b1f7065
Compare
Member
|
Tested and works as expected (tested in firefox and chrome with wp-scripts). 🎉 |
anton-vlasenko
approved these changes
Apr 11, 2022
anton-vlasenko
left a comment
There was a problem hiding this comment.
I haven't reviewed JavaScript changes, but the PHP part of the PR looks good to me.
Member
Author
|
Committed with https://core.trac.wordpress.org/changeset/53140. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Trac ticket: https://core.trac.wordpress.org/ticket/51750
Depends on #2263.
Brings the same functionality introduced in the Gutenberg plugin with WordPress/gutenberg#28273. In effect, it brings React Fast Refresh support to WordPress core for block development with
@wordpress/scripts.The way I test it:
Ensure your WordPress develop instance has
SCRIPT_DEBUGset totrue. It should be the default when usingnpm run env:start. You also need to activate the plugin with the Gurenpride block.Screenshots
React.Refresh.Safari.mov
React.Refresh.Chrome.and.Safari.mov
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.