Skip to content

perf: finish production bundle reachability follow-ups - #653

Merged
domgan-oai merged 1 commit into
octanejs:mainfrom
openai-oss-forks:fix/632-remaining-bundle-reachability
Aug 8, 2026
Merged

domgan-oai merged 1 commit into
octanejs:mainfrom
openai-oss-forks:fix/632-remaining-bundle-reachability

Conversation

@domgan-oai

@domgan-oai domgan-oai commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Preserve the effect-only Lynx worklet registrations and Rspeedy main-thread startup/readiness modules with narrow package sideEffects allowlists and executable production-bundle regressions; unused package roots still tree-shake.
  • Generate Octane's public version literal from the authoritative package manifest during pnpm sync, reject stale generation before publication, and verify the built package reports the exact manifest version. An isolated production import drops from 1,104 to 57 gzip bytes.
  • Document the reserved profiling define for custom esbuild integrations and verify normal/profile builds preserve their public DOM and devtools contracts while removing the inactive recorder graph.
  • Route transition-attempt bookkeeping through the existing lazily installed transition driver without changing suspended-screen, effect, or hydration semantics. On CI's Node 24 toolchain, framework gzip falls by 524 B for rows, 527 B for TodoMVC, and 541 B for chat.
  • Transparently reconcile 14 July-era comparative ceilings with the already-committed August 8 application snapshots, preserve all 20 framework comparisons, and add 36 strict, independently enforced raw/gzip/Brotli application, framework, and total budgets. The previous framework graph fails the new ceilings.

References #632.

Validation

  • pnpm format:check
  • pnpm typecheck
  • pnpm test — the full monorepo suite was not run; owner-local and cross-mode coverage is listed below.
  • pnpm sync
  • node packages/octane/scripts/build.mjs
  • pnpm typecheck:files packages/octane/src/runtime.ts packages/octane/src/version.ts packages/octane/tests/version.test.ts packages/octane/tests/production-profile-bundle.test.ts packages/lynx/tests/package-boundary.test.ts packages/rspeedy-plugin-octane/tests/package-boundary.test.ts
  • ./node_modules/.bin/vitest run --project octane --project octane-prod --reporter=dot --silent=passed-only — the complete development and production core suites passed: 776 files / 10,988 tests.
  • Lynx/Rspeedy owner suites excluding the existing nested-install packed-consumer case: 31 files / 337 tests passed.
  • Node 24: node benchmarks/bench.mjs --quick --ratios codegen-size bundle-size bundle-reachability — 144/144 deterministic guards passed, including 28 executable production scenarios.
  • Node 26: node benchmarks/bench.mjs --quick --ratios bundle-size — 56/56 guards passed.
  • Real Chromium: node benchmarks/bench.mjs --quick --ratios weather-app — 3/3 guards passed across six framework builds; 36 forecast updates measured 3.90 ms Octane / 6.20 ms React.

Risk / follow-ups

  • Applications that actually use Suspense/transitions retain their required driver; the weather framework increases 26 gzip bytes and remains within its new explicit ceiling.
  • Callable context providers deliberately retain descriptor children and dialect-switch cleanup. Specializing that public contract would break supported .tsx/compiled interoperability, so the speculative context optimization was investigated and explicitly excluded.
  • The existing packed-consumer integration requires a nested external pnpm dependency installation and was excluded from owner-local execution in this environment.

Provenance

  • An agent produced this diff (agent-authored)

Note

Medium Risk
Changes the core render path’s transition bookkeeping and the published version pipeline, but behavior is covered by expanded transition, bundle, and package-boundary tests; benchmark rebaselines are documentation of already-shipped sizes rather than new runtime semantics.

Overview
This PR reduces production bundle size while keeping profiling, transitions, Suspense, and hydration behavior intact, and tightens CI size enforcement so runtime wins cannot mask app or framework growth.

Runtime and packaging: Public version is now a generated literal from package.json (wired into pnpm sync and checked before publish), dropping package.json from version-only consumer graphs. Transition-attempt begin/end run through the lazily installed transition swap driver with a single captured driver per render (avoids re-reading after an urgent render installs Suspense machinery). Getting started documents setting __OCTANE_PROFILE_ENABLED__: 'false' in custom esbuild production builds so inactive profiling/devtools code is eliminated; tests lock normal vs profile esbuild behavior.

Lynx / Rspeedy: Narrow sideEffects entries preserve worklet registration and main-thread bootstrap modules in minified production bundles, with package-boundary tests that unused root imports still tree-shake.

Benchmarks: New bundle-size/app-budgets.json and harness wiring publish an octane-tsrx-budget reference target; 36 maxRatio: 1 guards cap app, framework, and total raw/gzip/brotli for rows, TodoMVC, chat, and weather. Stale July cross-framework ratio ceilings are rebaselined to August Node 24 measurements while keeping comparative guards. A transitions test asserts held screens stay whole across successive suspended transitions.

Reviewed by Cursor Bugbot for commit f42ca90. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent perf PR: performance work labels Aug 8, 2026
@domgan-oai
domgan-oai marked this pull request as ready for review August 8, 2026 21:33
@domgan-oai
domgan-oai merged commit 1c44117 into octanejs:main Aug 8, 2026
52 checks passed
jonkwheeler added a commit to jonkwheeler/octane that referenced this pull request Sep 15, 2026
On current main, version.ts is a generated literal (PR octanejs#653), so the
public  works in the SSR pass — the
manifest workaround was only needed against the older runtime JSON
import. Adds an ssr-smoke assertion pinning the pill to the package's
version export, which is what would have caught the 'vundefined'
failure shape.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
domgan-oai pushed a commit that referenced this pull request Sep 16, 2026
* feat(website): show current octane version in the homepage hero

Adds a v-pill above the hero title linking to the npm package page,
sourced from packages/octane/package.json at build time so it tracks
each changesets release with no runtime fetch.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* refactor(website): use octane's version export for the hero pill

On current main, version.ts is a generated literal (PR #653), so the
public  works in the SSR pass — the
manifest workaround was only needed against the older runtime JSON
import. Adds an ssr-smoke assertion pinning the pill to the package's
version export, which is what would have caught the 'vundefined'
failure shape.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-authored Diff or issue body substantially produced by an AI agent perf PR: performance work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant