Skip to content

perf: add minimal-import bundle reachability budgets - #631

Merged
domgan-oai merged 2 commits into
octanejs:mainfrom
openai-oss-forks:feat/minimal-import-bundle-budgets
Aug 7, 2026
Merged

domgan-oai merged 2 commits into
octanejs:mainfrom
openai-oss-forks:feat/minimal-import-bundle-budgets

Conversation

@domgan-oai

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

Copy link
Copy Markdown
Contributor

Summary

  • Complete the final independently landable bundle-reachability workstream in Performance roadmap: targeted updates, JSX lowering, DOM mounting, SSR, reconciliation, and bundle budgets #611 without changing Octane's runtime, compiler, or existing whole-application/codegen benchmarks.
  • Add ten independently compiled, public-entry production scenarios covering lightweight hydration-event capture, compiler-specialized disposable roots, reusable roots, state/effects, context, ordinary hydration, interaction-deferred hydration, Suspense/transitions, and vanilla/hooked Zustand bindings.
  • Execute the exact measured production IIFEs in isolated jsdom realms and verify visible rendering, native events, effect cleanup, context updates, adopted DOM identity, deferred interaction replay, transition behavior, real store updates, and root teardown.
  • Reject accidental React/server/profiling/devtools/RPC graphs, runtime leakage into capture-only or vanilla-store entries, externalized Zustand dependencies, and loss of disposable-root specialization.
  • Wire 30 deterministic raw/gzip/Brotli ceilings, with approximately 3% headroom, into the existing benchmarks/bench.mjs --quick --ratios CI path. Declare the benchmark's real octane, @octanejs/zustand, and jsdom workspace dependencies and update its frozen-lockfile importer.
  • Refresh the two lockfile-integrity audit manifests and the evaluation corpus's 19 lockfile digests through the mandatory pnpm sync; generated task content remains unchanged.
  • Expose the new benchmark through the published MCP server, keep its suite list synchronized with the runner, and include the required @octanejs/mcp-server patch changeset.
Public production scenario Raw bytes gzip bytes Brotli bytes
Hydration capture only 3,665 1,666 1,482
Specialized disposable root 48,301 16,240 14,643
Reusable root and unmount 108,691 35,409 31,159
State, native event, effect 111,885 36,613 32,143
Context provider/update 113,870 37,275 32,708
Hydrating root 124,273 40,323 35,275
Deferred interaction hydration 147,352 47,490 41,334
Suspense and transition 116,928 37,944 33,287
Vanilla Zustand store 648 428 362
Zustand hook binding 112,670 37,014 32,519

Validation

  • pnpm format:check
  • pnpm typecheck
  • pnpm test
  • targeted tests:
    • node benchmarks/bench.mjs --quick --ratios bundle-reachability: all ten production semantic/graph scenarios and all 30 raw/gzip/Brotli ratio guards pass.
    • Two independently rebuilt production runs have identical bytes, module graphs, and public semantic snapshots.
    • Existing normalized TSRX/JSX whole-application bundles and all fixed-corpus compiler output remain byte-for-byte identical to the immutable same-commit baselines.
    • A deliberately breached committed budget, an injected leaked-runtime dependency, and incorrect measured-bundle behavior each fail before the original candidate is restored and passes; specialized versus reusable roots also have explicit emitted-export graph checks.
    • ./node_modules/.bin/tsrx-tsc --noEmit --project /private/tmp/octane-minimal-fixtures-tsconfig.json: all eleven new .ts/.tsrx files pass strict JSX-aware typechecking.
    • ./node_modules/.bin/tsgo --noEmit -p packages/octane/tsconfig.json and ./node_modules/.bin/tsgo --noEmit -p packages/zustand/tsconfig.json.
    • Focused development/production hydration and production-bundle regressions plus real Zustand conformance/React differential parity: 105 tests passing.
    • All 15 MCP-server helper tests pass, including the exact benchmark-suite manifest parity regression that failed CI.
    • Full-repository pnpm format:check, scoped Prettier, syntax checks, frozen offline lockfile validation, pnpm changeset:check, and pnpm sync.

Full all-workspace pnpm test and pnpm typecheck were not run: this clean worktree intentionally uses a frozen, offline seven-project installation because unrelated Preact/Ripple packages are unavailable from the configured registry. No dependency source or registry setting was changed.

Risk / follow-ups

Low: benchmark tooling and fixtures plus a patch-level published MCP benchmark registry update; no production framework runtime or compiler source changes. Production build/compression settings match the existing normalized bundle suite. Byte ceilings retain approximately 3% headroom for supported runtime/toolchain variation while preserving deterministic anti-regression coverage. Existing complete-application and fixed-codegen suites remain the end-to-end size controls.

Provenance

  • An agent produced this diff (agent-authored)

Note

Low Risk
Benchmark-only fixtures and CI gates; no production framework, compiler, or runtime code changes.

Overview
Introduces a new bundle-reachability benchmark suite that builds ten independent public-entry production IIFEs (hydration capture, specialized vs reusable roots, hooks/effects, context, hydrate/deferred hydration, Suspense/transitions, vanilla and hook Zustand), runs each bundle in isolated jsdom against fixed behavioral oracles, and asserts the module graph excludes forbidden React/server/profiling/devtools leakage plus scenario-specific runtime and Zustand rules.

run-minimal.mjs wires production Vite builds, forbidden-module checks, raw/gzip/brotli sizing, and same-run *-budget peer targets; minimal-budgets.json and 30 maxRatio: 1 entries in baselines/ratios.json enforce committed ceilings via node benchmarks/bench.mjs --quick --ratios bundle-reachability. The unified runner manifest, benchmark README, bundle-size workspace deps (octane, @octanejs/zustand, jsdom), and @octanejs/mcp-server suite list/changeset document the new suite.

Lockfile SHA updates in hook-form/react-map-gl parity audits and eval train manifests reflect pnpm sync after dependency changes; framework source is untouched.

Reviewed by Cursor Bugbot for commit 59b4b02. 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 7, 2026
@domgan-oai
domgan-oai marked this pull request as ready for review August 7, 2026 22:38
@domgan-oai
domgan-oai merged commit 25c82b0 into octanejs:main Aug 7, 2026
35 checks passed
jonkwheeler pushed a commit to jonkwheeler/octane that referenced this pull request Aug 7, 2026
* perf: add minimal-import bundle reachability budgets

* fix: register reachability benchmark with MCP server
jonkwheeler pushed a commit to jonkwheeler/octane that referenced this pull request Aug 8, 2026
* perf: add minimal-import bundle reachability budgets

* fix: register reachability benchmark with MCP server
jonkwheeler pushed a commit to jonkwheeler/octane that referenced this pull request Aug 8, 2026
* perf: add minimal-import bundle reachability budgets

* fix: register reachability benchmark with MCP server
jonkwheeler pushed a commit to jonkwheeler/octane that referenced this pull request Aug 8, 2026
* perf: add minimal-import bundle reachability budgets

* fix: register reachability benchmark with MCP server
jonkwheeler pushed a commit to jonkwheeler/octane that referenced this pull request Aug 8, 2026
* perf: add minimal-import bundle reachability budgets

* fix: register reachability benchmark with MCP server
jonkwheeler pushed a commit to jonkwheeler/octane that referenced this pull request Aug 8, 2026
* perf: add minimal-import bundle reachability budgets

* fix: register reachability benchmark with MCP server
jonkwheeler pushed a commit to jonkwheeler/octane that referenced this pull request Aug 8, 2026
* perf: add minimal-import bundle reachability budgets

* fix: register reachability benchmark with MCP server
jonkwheeler pushed a commit to jonkwheeler/octane that referenced this pull request Aug 8, 2026
* perf: add minimal-import bundle reachability budgets

* fix: register reachability benchmark with MCP server
leonidaz pushed a commit that referenced this pull request Aug 9, 2026
* feat: add Solana React binding

* refactor(solana-react): stabilize wallet snapshots

* fix(solana-react): address preflight review findings

* chore(evals): refresh corpus lockfile hashes

* Address PR review feedback (#387)

- version reactive client snapshots
- normalize omitted query options compiler slots

* style(solana): format hook-slot fixes

* fix(solana): defer reactive subscriptions to consumers

* feat(playground): showcase solana client context

* fix(solana-react): stabilize derived hook slots

* chore(evals): refresh solana playground digest

* fix(solana-react): replace clients during render

* chore: refresh package inventory

* chore: refresh binding parity gaps

* chore: refresh binding status inventory

* fix(solana-react): keep null request queries idle

* style(solana-react): format null query guard

* fix(ci): retain trusted Octane peer resolution

* fix(solana-react): validate capabilities before cancellation

* fix(ci): stabilize merged RainbowKit hydration checks

* chore(solana-react): refresh package inventory

* fix(solana-react): make package tests cwd-independent (#387)

* fix(solana-react): stabilize idle refetch

* chore(solana-react): refresh parity gap index

* chore(solana-react): refresh bindings status

* chore(solana-react): refresh merged inventories

* fix(solana-react): treat superseded sign failures as cancellation

Check active generation and context before wrapping sign errors as signing-failed.

Co-authored-by: Cursor <[email protected]>

* fix(website): list solana-react once in Web3 bindings catalog

Remove duplicate @octanejs/solana-react entry from AI/data section;
Web3 is the correct category per Bugbot review.

Co-authored-by: Cursor <[email protected]>

* chore(ci): refresh react-parity evidence after main merge

Regenerate lockfile hashes and inventory for solana.

* perf: add minimal-import bundle reachability budgets (#631)

* perf: add minimal-import bundle reachability budgets

* fix: register reachability benchmark with MCP server

* fix: preserve side-effect-only bootstrap entrypoints (#633)

* perf: cache stable renderable regions and prune sync warming (#634)

* perf: cache stable renderable regions and prune sync warming

* fix: preserve uppercase-prefixed custom hook state

* fix(benchmarks): remove js-framework DOM node metrics (#636)

* fix(bindings): classify production bundle side effects (#637)

* feat: enable React Compiler across framework benchmarks (#639)

* perf: reduce core runtime and compiled application bundles (#638)

* chore(ci): refresh react-parity evidence after main merge

Regenerate lockfile hashes and inventory for solana.

* fix(solana-react): stabilize null-source query result identity

Cache the idle useRequestQuery result object and update it in place when
the underlying TanStack result changes, preserving referential stability
across parent re-renders.

Co-authored-by: Cursor <[email protected]>

* chore(ci): refresh inventories after main merge

Keep generated package/binding inventory and eval corpus digests current after merging origin/main into the solana-react binding branch.

Co-authored-by: Cursor <[email protected]>

* feat(solana-react): add React parity evidence lanes

Wire packages/solana-react into the generic react-parity:check path with a
vendored @solana/[email protected] pin, pristine/adapted runtime lanes, and
repo-authored type probes, while keeping Octane-only conformance outside
parity ownership.

Co-authored-by: Cursor <[email protected]>

* fix(solana-react): expand pristine/adapted parity for query and types

Address leonidaz feedback: run useRequestQuery in the pristine suite with
per-file dispositions and omission/rename controls, adapt the overlapping
cases, and replace repo-authored type probes with upstream __typetests__
lanes plus assertion-group inventories.

Co-authored-by: Cursor <[email protected]>

* fix(solana-react): prefer reactiveStore over send for Kit sources

PendingRpcRequest duck-types expose both APIs; dispatch through
reactiveStore().withSignal so getAbortSignal composition matches upstream.

Co-authored-by: Cursor <[email protected]>

* fix(solana-react): one-for-one adapted parity and expanded type lane

Preserve every selected pristine runtime identity in the adapted suite,
expand the pristine type lane across wallet/transaction/query typetests
with machine-checkable dispositions, and reject thenable ClientProvider
clients at mount.

Co-authored-by: Cursor <[email protected]>

* fix(solana-react): pin pristine-only typetests in type inventory

Include every adapted and pristine-only upstream typetest in
pristine-types.json so assertion-group drift is caught for wallet,
signing, request, and deferred query artifacts.

Co-authored-by: Cursor <[email protected]>

* fix(ci): refresh vitest parity hashes and format solana-react audit

Keep neighbor react-parity manifests aligned after vitest.config.js changed for solana-react lanes, and satisfy Prettier on the new audit file.

Co-authored-by: Cursor <[email protected]>

---------

Co-authored-by: Dominic Gannaway <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: domgan-oai <[email protected]>
leonidaz pushed a commit that referenced this pull request Aug 10, 2026
* docs(packaging): plan CommonJS package conditions

* feat(packaging): add CommonJS graph builder

* fix(packaging): parse CommonJS graphs with esbuild

* feat(octane): publish CommonJS runtime entries

* feat(bindings): publish CommonJS runtime graphs

* test(packaging): exercise packed CommonJS consumers

* chore(release): record CommonJS package conditions

* test(packaging): run CommonJS tarball canary

* test(packaging): compare ESM and CommonJS parity

* fix(review): guard CommonJS output deletion

* fix(review): reject lossy CommonJS transforms

* feat(packaging): compile TSRX CommonJS graphs

* perf(packaging): reuse TSRX compilation work

* feat(packages): support callable CommonJS defaults

* fix(packages): recognize TSRX CommonJS roots

* perf: speed up server-rendered HTML escaping (#629)

* perf: skip unchanged conditional keyed rows (#628)

* perf: skip unchanged conditional keyed rows

* fix: exclude Activity boundaries from keyed row memoization

* fix(ci): prevent usehooks hydration timeout

* fix(ci): refresh React parity evidence hashes

* perf: reuse bounded keyed-reorder scratch storage (#630)

* perf: add minimal-import bundle reachability budgets (#631)

* perf: add minimal-import bundle reachability budgets

* fix: register reachability benchmark with MCP server

* fix: preserve side-effect-only bootstrap entrypoints (#633)

* perf: cache stable renderable regions and prune sync warming (#634)

* perf: cache stable renderable regions and prune sync warming

* fix: preserve uppercase-prefixed custom hook state

* fix(benchmarks): remove js-framework DOM node metrics (#636)

* fix(bindings): classify production bundle side effects (#637)

* feat: enable React Compiler across framework benchmarks (#639)

* perf: reduce core runtime and compiled application bundles (#638)

* Version Packages (#601)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix(commonjs): fail closed on authored .tsrx modules

Refuse compiling .tsrx into CommonJS packaging output so published packages keep source for consumers to compile.

Co-authored-by: Cursor <[email protected]>

* fix(commonjs): restore published require export conditions

Re-apply the CommonJS require maps for octane and the binding packages after the main merge dropped them.

Co-authored-by: Cursor <[email protected]>

* fix(commonjs): order require before default and wire binding prepack

Put import/require ahead of default in octane publishConfig.exports so Node does not always pick the ESM graph, and run build:cjs from prepack for the binding packages that advertise dist/cjs.

Co-authored-by: Cursor <[email protected]>

* fix(compiler): discover source packages without a CommonJS build

require.resolve failed on prepack-only dist/cjs entries in CI, so Vite
source discovery skipped Base UI and nested bindings. Fall back to the
installed package manifest when the require target is missing.

Co-authored-by: Cursor <[email protected]>

---------

Co-authored-by: domgan-oai <[email protected]>
Co-authored-by: Dominic Gannaway <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Cursor <[email protected]>
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