Do not inject hot-reload code into web-pixels-manager sandbox#1568
Merged
Do not inject hot-reload code into web-pixels-manager sandbox#1568
Conversation
This comment has been minimized.
This comment has been minimized.
Contributor
Coverage report
Test suite run success1078 tests passing in 535 suites. Report generated by 🧪jest coverage report action from e271953 |
Contributor
mgmanzella
approved these changes
Mar 8, 2023
Contributor
mgmanzella
left a comment
There was a problem hiding this comment.
nvm! tried again today and it worked 🤷
Poitrin
pushed a commit
to Shopify/shopify-cli
that referenced
this pull request
Mar 13, 2023
### WHY are these changes introduced? Backports changes from CLI 3 to CLI 2, until CLI 2 is sunset. ### WHAT is this pull request doing? Back-port from * Shopify/cli#1568
This was referenced Mar 16, 2023
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.


WHY are these changes introduced?
Fixes #1119 (again)
When HMR code (
SSRClientetc.) is injected into the HTML returned by/, no CORS error happens, and HMR is running. However, URL/web-pixels-manager@0.0.219/sandbox/was being requested too. This URL returns HTML, in which HMR code is injected and tried to be loaded a second time, “thankfully” leading to the CORS error, because theOriginisnull.The URL to be ignored in #1370 has changed unfortunately and is
http://127.0.0.1:9292/wpm@…@…/sandbox/now, so that the regex needs to be updated.WHAT is this pull request doing?
Updates regex so that HMR code is only injected for all requests returning HTML and whose URL is not matching
…/sandbox.How to test your changes?
shopify theme dev/hot-reloadis only called once.Measuring impact
How do we know this change was effective? Please choose one:
Checklist
devordeployhave been reflected in the internal flowchart.