Repository navigation
fix(app-tools): scope async HTML scripts to streaming entries - #9033
Merged
GiveMe-A-Name merged 3 commits intoOct 21, 2026
Merged
Conversation
🦋 Changeset detectedLatest commit: c44346e The changes in this PR will be included in the next version bump. This PR includes changesets to release 120 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for modernjs-byted ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
GiveMe-A-Name
approved these changes
Oct 21, 2026
Merged
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.

Summary
在同一应用中混用 streaming SSR、string SSR 和 CSR 时,只要一个入口开启 streaming SSR,
HtmlAsyncChunkPlugin就会把其他入口的defer脚本也改为async,并改变脚本插入位置。这会导致非 streaming 页面错过DOMContentLoaded回调,或在 head 中的 deferred SDK 执行前运行业务代码。本次按 HTML 所属的
entryName判断是否应用 streaming 脚本处理,使用已有的getEntryOptions解析全局配置、入口覆盖和主入口的 package-name 别名。CSR/string SSR 保留原有执行顺序及html.inject配置,streaming SSR 和全局 RSC 保留现有行为。新增独立的三入口应用集成测试,覆盖 native/JS HTML 插件、独立/合并 runtime、产物布局、延迟入口脚本、延迟 SDK,以及页面交互。同时补充入口配置与 HTML hook 单测和 patch changeset。
Validation
main(6a891f027)运行新增的 28 项集成测试:24 项失败、4 项通过。失败为 CSR/string SSR 的布局和脚本时序断言,4 项 streaming 布局用例通过。@modern-js/app-tools单测:132 项通过。streaming-runtime、rsc-closing-tags集成测试:8 项通过。rs check。Related Links
Checklist