Repository navigation
Make the two ineffective import() calls static, fail the build on the next one, and re-measure the startup budget - #11676
Merged
Conversation
… next one, and re-measure the startup budget prompt-storage-dialog and refresh-context-usage were loaded with import() at five sites while the startup set already imports both statically, so nothing was deferred. Rolldown reported both as INEFFECTIVE_DYNAMIC_IMPORT and a build warning is all it ever was. Importing them statically drops 2.2 KB raw from the eager set, and the build now throws on that log instead of printing it. That is not enough on its own: main measures 5,601.9 KB raw against the 5,595.7 KB ceiling. The eager set gained one 303-byte chunk since the last raise and otherwise grew inside chunks already eager, mostly #11607 and #11648, so the budget is re-measured with the margin #11013 chose.
Member
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
shaojun
pushed a commit
to shaojun/unsloth
that referenced
this pull request
Sep 29, 2026
… next one, and re-measure the startup budget (unslothai#11676) prompt-storage-dialog and refresh-context-usage were loaded with import() at five sites while the startup set already imports both statically, so nothing was deferred. Rolldown reported both as INEFFECTIVE_DYNAMIC_IMPORT and a build warning is all it ever was. Importing them statically drops 2.2 KB raw from the eager set, and the build now throws on that log instead of printing it. That is not enough on its own: main measures 5,601.9 KB raw against the 5,595.7 KB ceiling. The eager set gained one 303-byte chunk since the last raise and otherwise grew inside chunks already eager, mostly unslothai#11607 and unslothai#11648, so the budget is re-measured with the margin unslothai#11013 chose.
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.
mainfails Frontend build + bundle sanity by itself: 5,601.9 KB raw against the 5,595.7 KB ceiling (the #11648 run reported 5,597.3 KB).Where it went
Measured locally, one build per commit:
Bisecting the chunk count lands on #11607. The extra chunk is
thread-message-slot, 303 bytes, which Rolldown split out oncefork-boundary-storebegan importing it. The rest grew inside chunks that were already eager: #11607's fork boundary (about 4 KB), then #11648's UI scale (about 5 KB). No new startup member was added, so there is nothing to lazy-load.Changes
import()calls are now static imports.prompt-storage-dialogwas loaded withimport()inapp-sidebar.tsx(2 sites),chat-page.tsx(2 sites) andchat-row-menu.ts, andrefresh-context-usageinskills-api.ts(2 sites). The startup set already imports both statically, so theimport()deferred nothing. It only split their graphs, which is the pattern Import the row fork's modules statically, which puts main back under the startup budget #11588 fixed for the row fork. Switching them to static imports saves 2.2 KB raw. Each function staysasync, so a thrown export still rejects the way it did before.vite.config.tsthrows when Rolldown logsINEFFECTIVE_DYNAMIC_IMPORT. Until now that log only printed a yellow line in the build output, where nobody reads it. This is the second time the pattern has cost startup bytes.rawBytesgoes to 5,950,000 andtransferBytesto 1,770,000. That leaves 210.8 KB raw and 65.1 KB transfer spare, the same margin Studio: re-measure the startup bundle budget, which main is red on by itself #11013 chose (211.7 KB and 64.6 KB).Verification
tsc -b,vite buildandnpm run bundle:checkpass:within budget (65.1 KB transfer, 210.8 KB raw to spare).npm test: 8,571 passed, 0 failed.import()inskills-api.ts.vite buildthen exits 1 with[INEFFECTIVE_DYNAMIC_IMPORT] src/features/chat/utils/refresh-context-usage.ts is dynamically imported by .... With the fix it exits 0.rawBytesset just under the measurement,bundle:checkexits 1.