Repository navigation
fix(universal): re-export __methodDep through the universal entries - #1339
Merged
Merged
Conversation
The compiler lowers inferred method-call hook dependencies to
`import { __methodDep } from 'octane'`. Under the `universal`/
`universal/native` export conditions that specifier resolves to
universal-core, which lacked the re-export — universal-target builds
failed at module resolution while the default entry compiled fine.
The helper is pure (no DOM), so it belongs in the host-neutral core.
verify-dist's required-exports contract now covers it on both universal
subpaths.
aleclarson
added a commit
to octane-xplat/octane-xplat
that referenced
this pull request
Sep 29, 2026
Published dist/native kept `from "octane"` — the DOM entry — for plain-.ts sources and the compiler-injected __methodDep helper (#3). The resolve.alias in these configs never fired: rollup tests externals on the raw specifier, so `octane` was emitted verbatim and the dev deps-bundle then packed a second, DOM, runtime beside the universal one — hooks read an empty CURRENT_SCOPE and apps crashed on first render ("null.hooks" via useSyncExternalStore). Rewrite the specifier at emit time instead (rollup output.paths), exact-match `octane` → `octane/universal/native`, in ui and every leaf package build; the dead aliases are removed. __methodDep resolves there via octanejs/octane#1339, so the octane peer floor rises to >=0.6.3 across packages and the workspace's 0.5.0-universal-signals tarball gets an allowedVersions exception. A post-build check fails the build if bare `octane` ever lands in dist/native again.
4 of 6 tasks
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.
Summary
universal-core.ts(the shared root ofoctane/universalandoctane/universal/native) now re-exports__methodDep.scripts/verify-dist.mjsrequired-exports contract covers it on both universal subpaths.Why
The compiler lowers inferred method-call hook dependencies to
import { __methodDep } from 'octane'. Under theuniversal/universal/nativeexport conditions that specifier resolves touniversal-core, which lacked the re-export — universal-target builds fail at module resolution while the default entry compiles fine. The helper is pure (no DOM), so it belongs in the host-neutral core.Found consuming
octane/universal/nativevia@nativescript-community/octane— a leaf component whose compiler-inferred deps included a method call (props.onFoo(...)) crashed the native bundle build with a missing-export error.Changes
packages/octane/src/universal-core.ts: re-export line.packages/octane/scripts/verify-dist.mjs:__methodDepadded to the./universaland./universal/nativerequired-exports lists (the build's import verification now guards the regression).octane.Validation
pnpm -F octane build— dist builds andimports verifiedpasses with the new required exports.pnpm typecheck:files packages/octane/src/universal-core.tsnpx vitest run tests/public-exports.test.ts(4/4)pnpm test— not run (repo-wide suite; one-line re-export + contract-list additions).Risk / follow-ups
octane's default entry already exported it.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Low Risk
Additive public export aligned with the default entry; no auth, data, or behavioral logic changes.
Overview
Fixes universal and universal/native builds that break when the compiler emits
import { __methodDep } from 'octane'for inferred method-call hook dependencies (e.g.props.onFoo(...)). Those export conditions resolve touniversal-core, which previously did not re-export the helper even though the defaultoctaneentry did.universal-core.tsnow re-exports__methodDepfrommethod-dep.js(host-neutral, same as the main entry).verify-dist.mjslists__methodDepamong required public exports for./universaland./universal/nativeso the dist smoke test catches a future regression. Patch changeset foroctane.Reviewed by Cursor Bugbot for commit f2b7d03. Bugbot is set up for automated code reviews on this repo. Configure here.