Skip to content

fix(deps): declare babel syntax typescript - #1483

Open
CristiCeban wants to merge 1 commit into
callstack:mainfrom
CristiCeban:fix/declare-babel-syntax-typescript
Open

CristiCeban wants to merge 1 commit into
callstack:mainfrom
CristiCeban:fix/declare-babel-syntax-typescript

Conversation

@CristiCeban

@CristiCeban CristiCeban commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Re.Pack passes some Babel plugins to Babel by name, and Babel resolves names from the project's config rather than from Re.Pack. Builds only worked when the plugin happened to be resolvable from the project. With pnpm, that usually meant the NODE_PATH set by pnpm's script shims, so builds broke when Xcode or Gradle invoked the CLI directly: Cannot find module '@babel/plugin-syntax-typescript'. Re.Pack's own tests hid this: the integration fixture linked both plugins into the project, and tester-federation-v2 declared one itself.

  • @babel/plugin-syntax-typescript (babel-swc-loader and codegen rules) is now a dependency of Re.Pack and passed to Babel as a resolved path. The project's own copy is still preferred when installed, so a project's Babel version keeps winning.
  • @react-native/babel-plugin-codegen: the codegen rules now use a new @callstack/repack/babel-plugin-codegen wrapper. It finds the plugin through the project's @react-native/babel-preset, the same way babel-plugin-syntax-react-native finds the parser. Re.Pack can't depend on this one directly, because it has to match the project's React Native version.
  • @babel/core is now declared as a peer dependency, since Re.Pack's loaders import it at runtime.
  • The babel-loader docs cover the new wrapper for custom codegen rules.

Test plan

  • pnpm --filter @callstack/repack test covers the new resolver helpers, using a fake resolver to test the lookup order.
  • tests/integration (react-native-parser.test.ts) no longer links @react-native/babel-plugin-codegen and @babel/plugin-syntax-typescript into the fixture project. The codegen test fails on main with Cannot find package '@react-native/babel-plugin-codegen' and passes with this change.
  • tester-federation-v2 no longer declares @babel/plugin-syntax-typescript. Bundling its host app without NODE_PATH, the way Xcode and Gradle do, still compiles:
    cd apps/tester-federation-v2
    env -u NODE_PATH node node_modules/react-native/cli.js webpack-bundle
    --config config.host-app.mts --platform ios --dev false
    --entry-file src/host/index.js --bundle-output /tmp/index.bundle
  • pnpm lint:ci, tsc and pnpm install --frozen-lockfile pass.

@vercel

vercel Bot commented Oct 9, 2026

Copy link
Copy Markdown

@CristiCeban is attempting to deploy a commit to the Callstack Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3be6620

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@callstack/repack Patch
@callstack/repack-plugin-expo-modules Patch
@callstack/repack-plugin-nativewind Patch
@callstack/repack-plugin-reanimated Patch
@callstack/repack-dev-server Patch
@callstack/repack-init Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@CristiCeban
CristiCeban force-pushed the fix/declare-babel-syntax-typescript branch from 3bd8dea to 3be6620 Compare October 9, 2026 15:01
dannyhw pushed a commit to callstack/super-app-showcase that referenced this pull request Oct 9, 2026
Updates Re.Pack from the 5.4 canary to the stable 5.4.2 release, on top
of #175. It also fixes the Release builds and gets the app building and
launching on Xcode 27.

Re.Pack 5.4.2
- Bumps @callstack/repack and @callstack/repack-plugin-reanimated to
5.4.2 in the catalog, host, sdk preset and docs. They're added to
minimumReleaseAgeExclude until they clear the release-age gate.
- Switches react-native.config.js to @callstack/repack/commands, because
/commands/rspack is deprecated.
- Adds @react-native/js-polyfills and @babel/plugin-syntax-typescript as
direct devDependencies. Before, they only resolved through pnpm's
NODE_PATH, so bundling from Xcode and Gradle failed.
- @babel/plugin-syntax-typescript is a workaround until
callstack/repack#1483 is released; there's a TODO next to it.

Release build fixes
- iOS: the bundle build phase now uses the community CLI, so Re.Pack
bundles instead of RN's Metro-only scripts/bundle.js.
- Android: hermesc is now found through hermes-compiler via
react-native, because pnpm doesn't link it into the app's node_modules.
The path includes .exe on Windows.

Xcode 27 / iOS 27
- Raises pod deployment targets that Xcode 27 rejects (SDWebImage,
AsyncStorage).
- Adopts the UIScene lifecycle. Without it, the app crashes on launch
when built with the iOS 27 SDK.

Test plan

- pnpm typecheck, pnpm lint, pnpm test, pnpm peers check and pnpm
format:check pass.
- pnpm pods then build and run:
  - iOS Debug / Android Debug, with pnpm start running the dev servers.
- iOS Release / Android Release, with production builds of the mini apps
(react-native bundle --dev false) served on ports 9001–9003.
- In each of the 4 builds, from a clean install, check:
  - sign in as the demo user
  - Trading list with live prices
  - BTC detail with chart, then open and close the trade sheet
  - Wallet portfolio
  - Account, then sign out
dannyhw pushed a commit to callstack/super-app-showcase that referenced this pull request Oct 9, 2026
Updates Re.Pack from the 5.4 canary to the stable 5.4.2 release, on top
of #175. It also fixes the Release builds and gets the app building and
launching on Xcode 27.

Re.Pack 5.4.2
- Bumps @callstack/repack and @callstack/repack-plugin-reanimated to
5.4.2 in the catalog, host, sdk preset and docs. They're added to
minimumReleaseAgeExclude until they clear the release-age gate.
- Switches react-native.config.js to @callstack/repack/commands, because
/commands/rspack is deprecated.
- Adds @react-native/js-polyfills and @babel/plugin-syntax-typescript as
direct devDependencies. Before, they only resolved through pnpm's
NODE_PATH, so bundling from Xcode and Gradle failed.
- @babel/plugin-syntax-typescript is a workaround until
callstack/repack#1483 is released; there's a TODO next to it.

Release build fixes
- iOS: the bundle build phase now uses the community CLI, so Re.Pack
bundles instead of RN's Metro-only scripts/bundle.js.
- Android: hermesc is now found through hermes-compiler via
react-native, because pnpm doesn't link it into the app's node_modules.
The path includes .exe on Windows.

Xcode 27 / iOS 27
- Raises pod deployment targets that Xcode 27 rejects (SDWebImage,
AsyncStorage).
- Adopts the UIScene lifecycle. Without it, the app crashes on launch
when built with the iOS 27 SDK.

Test plan

- pnpm typecheck, pnpm lint, pnpm test, pnpm peers check and pnpm
format:check pass.
- pnpm pods then build and run:
  - iOS Debug / Android Debug, with pnpm start running the dev servers.
- iOS Release / Android Release, with production builds of the mini apps
(react-native bundle --dev false) served on ports 9001–9003.
- In each of the 4 builds, from a clean install, check:
  - sign in as the demo user
  - Trading list with live prices
  - BTC detail with chart, then open and close the trade sheet
  - Wallet portfolio
  - Account, then sign out
dannyhw pushed a commit to callstack/super-app-showcase that referenced this pull request Oct 9, 2026
Updates Re.Pack from the 5.4 canary to the stable 5.4.2 release, on top
of #175. It also fixes the Release builds and gets the app building and
launching on Xcode 27.

Re.Pack 5.4.2
- Bumps @callstack/repack and @callstack/repack-plugin-reanimated to
5.4.2 in the catalog, host, sdk preset and docs. They're added to
minimumReleaseAgeExclude until they clear the release-age gate.
- Switches react-native.config.js to @callstack/repack/commands, because
/commands/rspack is deprecated.
- Adds @react-native/js-polyfills and @babel/plugin-syntax-typescript as
direct devDependencies. Before, they only resolved through pnpm's
NODE_PATH, so bundling from Xcode and Gradle failed.
- @babel/plugin-syntax-typescript is a workaround until
callstack/repack#1483 is released; there's a TODO next to it.

Release build fixes
- iOS: the bundle build phase now uses the community CLI, so Re.Pack
bundles instead of RN's Metro-only scripts/bundle.js.
- Android: hermesc is now found through hermes-compiler via
react-native, because pnpm doesn't link it into the app's node_modules.
The path includes .exe on Windows.

Xcode 27 / iOS 27
- Raises pod deployment targets that Xcode 27 rejects (SDWebImage,
AsyncStorage).
- Adopts the UIScene lifecycle. Without it, the app crashes on launch
when built with the iOS 27 SDK.

Test plan

- pnpm typecheck, pnpm lint, pnpm test, pnpm peers check and pnpm
format:check pass.
- pnpm pods then build and run:
  - iOS Debug / Android Debug, with pnpm start running the dev servers.
- iOS Release / Android Release, with production builds of the mini apps
(react-native bundle --dev false) served on ports 9001–9003.
- In each of the 4 builds, from a clean install, check:
  - sign in as the demo user
  - Trading list with live prices
  - BTC detail with chart, then open and close the trade sheet
  - Wallet portfolio
  - Account, then sign out

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant