Skip to content

feat: remove legacy Context.Provider support - #1138

Merged
domgan-oai merged 5 commits into
octanejs:mainfrom
openai-oss-forks:codex/remove-context-provider
Sep 19, 2026
Merged

domgan-oai merged 5 commits into
octanejs:mainfrom
openai-oss-forks:codex/remove-context-provider

Conversation

@domgan-oai

@domgan-oai domgan-oai commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Remove the legacy Context.Provider alias. Code such as <Theme.Provider value={theme}> now receives OCTANE_CONTEXT_PROVIDER when the compiler can identify the Octane context; the supported form is <Theme value={theme}>.

Client, server, native, and Lynx factories no longer expose .Provider, and the public context types no longer declare it. Migrate the bindings, examples, documentation, benchmarks, registry content, and adapted upstream fixtures to the direct context component.

Imported direct contexts retain request prefetching and universal rendering support. Registered context identity keeps ordinary components named Provider opaque, and keyed contexts retain state until their key changes.

Validation

  • Repository formatting and full typecheck
  • Core development and production test suites: 21,630 tests across 1,120 files
  • Package build and dist/export verification
  • Focused context, universal, binding, and Lynx regressions, including observed failures before their fixes
  • Optional factory-call feedback: 3 real Babel-parser failures before the fix; all 58 diagnostic tests pass after it
  • Packed Lynx development/production builds, 43 Apollo tests, and all 5 Cinebase browser journeys, plus all 7 DOOM production tests
  • Lynx first-screen adoption: all 13 tests pass in isolated page scenarios, plus 99 related native tests
  • Workspace peer policy, changeset checks, and generated-source synchronization

Matched-baseline provider-output benchmark against 330bb0878: identical semantic hash and reached-work counters over 128 repeated updates; minified bundle +266 bytes, gzip +75 bytes. Full runtime entry bundles change gzip by +39 bytes (client), +27 bytes (server), and +134 bytes (native). These measurements do not establish latency or heap improvements.

Current-head CI passed all 26 jobs at 8123e18c6, including the full Node 24 test shards, React parity lanes, browser integration, typechecking, and publishable package validation. The local root test command selects the core development and production projects.

The local full package-pack command reaches its strict TSRX consumer, but a dependency download receives a 403 from the configured registry gateway. Current-head CI passed the complete package-pack validation.

Risk / follow-ups

This is an intentional beta API break with a minor core changeset. Most binding peers add the upcoming 0.3 release to their existing supported ranges. Ink and Drei require the coordinated core release because their shipped native templates use imported direct contexts; integrations using the new internal identity helper also require that release. The source compiler diagnoses statically recognized contexts; context types also reject legacy properties imported from other modules.

Provenance

  • An agent produced this diff (agent-authored)

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Note

High Risk
Intentional breaking API change to context provisioning across the core runtime, compiler, and the full binding surface; any remaining .Provider usage outside the migrated tree will fail at compile or runtime.

Overview
This PR drops the React 18-style Context.Provider alias so Octane contexts are only used as direct provider components: <Theme value={theme}> or createElement(Theme, { value }, children). The compiler now fails statically recognized .Provider access with OCTANE_CONTEXT_PROVIDER, and docs describe the React 19–aligned shape (no Consumer either).

The core release is a minor bump with a changeset that patches the @octanejs/* bindings; their octane peer ranges add ^0.3.0. Bindings and in-repo apps (Apollo, Aria, Base UI, cmdk, Blocknote, benchmarks, examples, registry content, upstream test patches) are mechanically migrated from .Provider to the context component itself, including createElement(Ctx, …) call sites.

Collateral updates include Apollo SSR coverage for ordinary server render with a cached client, parity ledger/doc tweaks, and small upstream conformance patches (e.g. Base UI tests, checkbox indicator commit timing).

Reviewed by Cursor Bugbot for commit 8123e18. 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 feat PR: new feature or capability labels Sep 18, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.

Reviewed by Cursor Bugbot for commit 9b6da82. Configure here.

@domgan-oai
domgan-oai marked this pull request as ready for review September 18, 2026 23:20
@domgan-oai
domgan-oai merged commit a6d7f49 into octanejs:main Sep 19, 2026
30 checks passed
trueadm added a commit that referenced this pull request Sep 23, 2026
…h lanes (#1266)

Context.Provider (#1138 follow-up): the compiler only rejects <Ctx.Provider>
when createContext is in the same module. For an imported context the client
failed with "Element type is invalid" and the server with "comp is not a
function". Development contexts from octane and octane/server now carry a
non-enumerable .Provider getter that throws OCTANE_CONTEXT_PROVIDER with the
migration hint. Production bundles are byte-identical.

Bench lanes:
- lynx-table stage tests resolve bare imports from packages/lynx (the tmpdir
  copy could not resolve octane/internal/context) and no longer depend on cwd.
- ssr-workerd declares octane and @tsrx/core.
- conversation-streaming resolves toolchain provenance through packages/octane.
- The bundle-reachability harness and the Bun register hook keep the source
  TypeScript loader for compiled .ts/.tsx output (retained enum), matching Vite.

Co-authored-by: Claude Opus 5.5 <[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 feat PR: new feature or capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant