Repository navigation
perf(dashboard): Build client scripts with rolldown to merge tiny chunks - #2765
Merged
Merged
Conversation
esbuild has no minimum chunk size, so the dashboard head preloaded 58 modules, many under 1 KB. Rolldown merges shared code into the chunks that load it. The stylesheet and fonts stay on esbuild.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
BYK
approved these changes
Nov 5, 2026
BYK
enabled auto-merge (squash)
November 5, 2026 19:13
tsx fails on Node 24 when the config imports node builtins (ENOENT 'node:fs?tsx-namespace=...'). unrun bundles the config with rolldown instead. It shims import.meta.resolve as a relative URL, so the plugin API alias resolves with createRequire.
Contributor
|
4 screenshot changes — 4 changed · 0 added · 0 removed Review screenshots in Frameshift
|
BYK
added a commit
that referenced
this pull request
Nov 5, 2026
…#2767) When a PR was approved, Junior's replies made claims about whether it could merge without checking. Two examples: - "your approval is on the previous commit … it'll need a quick re-approve". On #2765, the approval still counted: the ruleset has `dismiss_stale_reviews_on_push: false` and `require_last_push_approval: false`. The PR was blocked only by the pending `ci / required` check. - "it can be merged cleanly. I haven't merged it." This was after the requester had already turned on auto-merge. Junior's read-only installation token can read everything needed to get this right: `autoMergeRequest`, `mergeStateStatus`, `reviewDecision`, `gh pr checks --required`, and `GET /repos/{o}/{r}/rules/branches/{branch}`. Classic branch protection (`/branches/{b}/protection`) needs `administration: read`, which the app doesn't have, so this change doesn't use it. ## Changes - **Approval guidance** (`pull_request.review.approved`): before Junior says anything about merging, it reads auto-merge, the merge state, the review decision and the required checks. If auto-merge is on and only checks remain, it says only that the PR merges when they pass. If something else blocks it, it reads the branch rules and names the blocking rule. It no longer says "I haven't merged it". - **Ready-to-merge notice**: a PR with auto-merge on gets no notice. Turning auto-merge on closes an open notice ("Auto-merge is on."), and turning it off brings the notice back. `auto_merge_enabled` and `auto_merge_disabled` now trigger the check. Reviews are not read when auto-merge is on. - **`github-code` api-surface**: adds commands for PR merge blockers and branch merge rules. ## Checks - `@sentry/junior-github` tests: 286/286 passed. The ready-notice scenario now covers turning auto-merge on and off. - `@sentry/junior-github` typecheck and `pnpm skills:check`: pass. ## Open There is no eval for the approval reply wording yet. The guidance change is checked only by the tests above, not with an LLM. <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:local%3Aweb%3A696275a96da32dcbea1f856e --> -- [View Session in Sentry](https://sentry.sentry.io/explore/conversations/local%3Aweb%3A696275a96da32dcbea1f856e/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: BYK <[email protected]>
22 tasks done
BYK
added a commit
that referenced
this pull request
Nov 7, 2026
#2765 merged most first-load code into the entry, which grew it to 1,202 KB raw (281 KB br). The entry hash changes on every deploy, so each deploy makes the next visit download all of it again. This adds rolldown `codeSplitting.groups` to `tsdown.client.config.ts`. Third-party code that the first load imports goes into three vendor chunks: - `vendor-react`: react, react-dom, scheduler, react-router - `vendor-sentry`: the Sentry SDK (`@sentry/*` except the `@sentry/junior*` workspace packages) - `vendor`: all other first-load `node_modules` The `$initial` tag limits each group to modules that the entry imports statically. Lazy pages, the chart, grammars, and wasm stay lazy. App code and workspace packages stay in the entry and route chunks. ## Hash stability I built main and this branch, then changed one string (the `CommandPalette` placeholder) and rebuilt each. | | main | this PR | |---|---|---| | Files with a new hash | 33 | 27 | | First-load files with a new hash | 1 (entry) | 1 (entry) | | First-load bytes to download again | 280,599 B br | 97,541 B br | | All changed bytes, incl. lazy route chunks | 491,186 B br | 214,012 B br | The three vendor chunks keep their hashes. The lazy route chunks still change because they import shared app code from the entry. That is the same on main. | Chunk | raw | br | |---|---|---| | entry (main) | 1,201,783 | 280,643 | | entry (this PR) | 486,650 | 97,520 | | `vendor` | 886,741 | 225,084 | | `vendor-react` | 285,775 | 77,310 | | `vendor-sentry` | 127,891 | 37,621 | A dependency update changes only the vendor chunk that holds it. ## Cold first load JS fetched by Chromium with the mock dashboard (br-11): | Route | main | this PR | |---|---|---| | `/conversations` | 23 files, 1,833,935 B raw, 460,671 B br | 18 files, 1,832,478 B raw, 452,514 B br | | `/conversations/:id` | 30 files, 2,597,624 B raw, 647,970 B br | 25 files, 2,596,201 B raw, 639,884 B br | modulepreloads: 22 → 17. The groups also take in 5 small `node_modules` chunks. ## Screenshots The pages look the same. The only pixel differences are the loading spinner and the thinking shimmer. | | main | this PR | |---|---|---| | Conversations |  |  | | Transcript |  |  | ## Checks - Full dashboard build on Node 24.22.1 - Dashboard unit tests after the build: 378 passed - `pnpm typecheck` (dashboard) and root `pnpm lint` pass - `pnpm test:e2e:dashboard`: 103 passed, 1 failed. The failure is `conversations-read-position.spec.ts` "catches the reader up on several unread Turns" (`toBeInViewport`). It is flaky on main too: it failed 3 of 8 runs against a main build. I took the measurements on main `e889f3909`, then rebased onto `d987bf7dd`. The rebase did not touch the build config. <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A596398f356e0f4652790df29aec95726 --> -- [View Session in Sentry](https://sentry.sentry.io/explore/conversations/agent%3A596398f356e0f4652790df29aec95726/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: BYK <[email protected]>
This branch was successfully deployed
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.
The dashboard head preloads 58 modules, and many of them are under 1 KB. esbuild (tsup) splits every set of shared modules into its own chunk and has no minimum chunk size. Rolldown merges shared code into the chunks that load it, so the client scripts now build with tsdown (rolldown), which the repo already uses.
Route splitting from #2734/#2738 and the head preloads from #2738 are unchanged. Every route still loads its page lazily, and the manifest still lists the entry's static imports for
modulepreload.Changes
tsdown.client.config.tsbuilds the client JS. It keeps the defines, the@sentry/junior-plugin-apialias and the content-hashed names (client-[hash].js,chunks/[name]-[hash].js).failOnWarnmakes an unresolved import, such as server code reachingnode:fs, fail the build, as before..webpwith an absolute/_junior/dashboard/assets/...URL. Rolldown's own asset loader gives a page-relative URL.dist/public.tsup.client.config.ts→tsup.styles.config.ts. esbuild still buildsstyles.cssand the woff2 fonts, because rolldown CSS bundling is still experimental (@tsdown/css). This build runs first and cleansdist/public.hashCharacters: "base36"), so a hash never contains-or_. The asset-name regexes inpublic-assets.tsnow accept lowercase. The stylesheet regex is now one exported constant.build:clientruns tsdown with--config-loader unrun, because Node's loader can't resolve the extensionless imports insrc/public-assets.unrun(tsdown's recommended loader, which depends only on rolldown) is a new dev dependency. Thetsxloader fails on Node 24 when the config imports Node builtins. unrun shimsimport.meta.resolveas a relative URL, so the plugin API alias usescreateRequire."./chunks/..."), so the chunk regex in two dashboard tests changed.Numbers
build:clientoutput, br quality 11, first load of/conversations(entry + preloads):modulepreloadlinksJS loaded in the browser per route, with mock conversations (files, br):
/conversations/conversations/:id/system/codeLargest files:
The entry is larger because rolldown keeps code that the entry always loads in the entry, instead of in separate preloaded chunks. The first-load total goes down. The shiki grammars and the oniguruma wasm stay lazy.
Screenshots
Mock conversations. The pages look the same; the only pixel differences are spinners and the "thinking" shimmer.
The memory API 404 on the transcript page also happens on main.
Conflicts
This replaces the client build config. Any open PR that changes
tsup.client.config.tsorbuild:clientwill conflict. The static assets change (#2757) is already merged, and this branch is based on it.Checks
pnpm test:e2e:dashboard: 100/100 passed.pnpm build: 371/371 passed.pnpm typecheck, rootpnpm lint, prettier on changed files: pass.pnpm install --frozen-lockfile: pass.build:clienton Node 24.22.1 (CI's version) and Node 22: same output, entryclient-dnc5pi1v.js, 21 preloads.conversation-send"thinking" indicator timing) passed 3/3 on rerun.via @BYK.
--
View Session in Sentry