Repository navigation
build: generate app-runtime browser bundle instead of checking it in - #83
Merged
Merged
Conversation
The committed bundle had to be manually regenerated whenever anything in its module graph changed (sdk, server-contract, domain, templates, ...), enforced only by an after-the-fact CI sync check. f183840 showed the failure mode: a contract change without regeneration broke CI on main and every open PR. Make generation a turbo task instead: - @bb/sdk#generate:app-runtime-browser-bundle is a cached task whose output is the generated module; the file is untracked and gitignored. - Every task that compiles the file depends on it: sdk build/typecheck/ test, server build/typecheck/test/dev (the only importer), and integration-tests (they compile server src). pnpm dev runs through turbo, so dev gets it for free. - The --check mode, check: script, and staleness test are deleted — staleness is now structurally impossible. Co-Authored-By: Claude Opus 4.8 <[email protected]>
brsbl
added a commit
that referenced
this pull request
Jun 10, 2026
Brings the branch up to date with main (24 commits), which switched the app-runtime browser bundle to build-time generation (#83) — removing the checked-in generated file that was failing CI. Resolved conflicts in PromptBoxInternal (deps: applyTrigger + canSubmitWithEnterKey), RootComposeView (usePrimaryHost replaces useHostDaemon; keep useCommandSuggestions), project-queries (keep requireProviderId + SidebarProject), and the NewThreadPromptBox story (typeahead fixtures + makeHost). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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.
Problem
packages/sdk/src/app-runtime-browser-bundle.generated.ts(the servedwindow.bbruntime) was checked in and had to be manually regenerated whenever anything in its module graph changed — sdk, server-contract, domain, templates. The only enforcement was an after-the-fact CI sync check, so the failure mode was inevitable: f183840 changedprojectWithThreadsResponseSchemawithout regenerating, breaking CI on main and every open PR (see #82 for the symptom-level fix).Fix: make generation a build step
@bb/sdk#generate:app-runtime-browser-bundleis now a cached turbo task whose output is the generated module. The file is untracked and gitignored.@bb/sdkbuild/typecheck/test,@bb/serverbuild/typecheck/test/dev (the only importer of@bb/sdk/app-runtime), and@bb/integration-teststasks (they compile server src).pnpm devruns through turbo, so dev generates it automatically.--checkmode,check:script, and the staleness test are deleted — staleness is structurally impossible now. The remaining tests (sha integrity, guide-templates-only) run against a freshly generated bundle.This mirrors what
@bb/templatesalready does (regenerate before its own tasks), taken one step further by untracking the artifact.Verified
rmthe generated file →turbo run build typecheck test --filter=@bb/sdk --filter=@bb/server: generate runs first, 7/7 tasks passturbo run lintand@bb/integration-tests#typecheckpassturbo run dev --filter=@bb/server --dry=json→['@bb/sdk#generate:app-runtime-browser-bundle', '@bb/server#dev']Notes
src/app-runtime.tsis unresolved until the first turbo run generates the file — standard codegen behavior, same as a missingdist/.🤖 Generated with Claude Code