Open
Conversation
6b7f829 to
dc434e2
Compare
dceae60 to
367a167
Compare
367a167 to
3192902
Compare
3192902 to
2269a8d
Compare
2269a8d to
1b64edb
Compare
1b64edb to
9d575a9
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the project’s Scratch/React-Redux dependency stack and adjusts HTML runner internal-link handling to avoid a race condition exposed by the Scratch v13 timing changes.
Changes:
- Bump
@scratch/scratch-guito v13 and upgrade toreact-reduxv8, addingreduxas an explicit dependency. - Fix HTML runner internal-link flow by deferring reruns until after
previewFilestate changes. - Make Cypress HTML iframe assertions resilient to iframe navigation by re-querying the live body.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Lockfile updates reflecting Scratch v13, React-Redux v8, and new transitive dependency graph. |
| package.json | Updates @scratch/scratch-gui and react-redux, adds redux peer dependency. |
| src/utils/externalLinkHelper.js | Removes immediate rerun dispatch for internal-link handling (now rerun is coordinated by HtmlRunner). |
| src/components/Editor/Runners/HtmlRunner/HtmlRunner.jsx | Adds reloadAfterPreviewChange deferral to avoid internal-link race when switching preview files. |
| cypress/e2e/spec-html.cy.js | Updates iframe body helper and assertion to avoid stale DOM references across iframe reload/navigation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
54d7563 to
9b82f56
Compare
9b82f56 to
7f9e18d
Compare
dc9633e to
d125633
Compare
d125633 to
84a4a91
Compare
internal HTML links now defer triggerCodeRun() until after previewFile changes, instead of dispatching immediately while React state is still pointing at the old page. That is why externalLinkHelper stopped dispatching triggerCodeRun, and HtmlRunner picked up the “wait for preview change, then rerun” flow. This matters because without it the iframe can rerun the wrong file after clicking an internal link.
84a4a91 to
799ff7a
Compare
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.
Updated Scratch to version 13 and update to react-redux 8 is needed since it's a required peer dependency.
Also for react-redux 8 we need redux as a peer dependency too, so we need to provide it ourselves.
Updating the version didn't change the HTML preview behavior directly, but it changed the timing enough to expose an existing race in the HTML runner internal-link flow.
Test change explanation:
When an internal link was clicked, the app updated previewFile and triggered a rerun in the same tick.
In CI runs, because it can be slower, the rerun could happen before React had actually applied the new previewFile, so the iframe sometimes re-rendered new.html again instead of index.html.
What changed:
previewFile. In HtmlRunner, the rerun is deferred until after previewFile has actually changed, viareloadAfterPreviewChange.getIframeBody()doesn't use.then(cy.wrap), so Cypress keeps re-querying the live iframe body instead of holding a stale body element across iframe navigation.Now the assertion is less coupled to the exact DOM shape and retries against the current iframe document, which is what we want for navigation/reload behavior.
There was also an issue exposed in WebComponentLoader after the dependency update.
loadRemixwas being kept as derived state through an effect, and after the upgrade that became unstable.Now
loadRemixis derived directly from user andremixLoadFailed, which removes the extra state sync and avoids the loader getting stuck.In WebComponentLoader.test, the mocked
changeLanguagenow resolves instead of returning a never-ending promise, which matches the real behavior better and avoids the test hanging.