Skip to content

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

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

CristiCeban wants to merge 3 commits 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 @babel/plugin-syntax-typescript 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 the plugin into the project, and tester-federation-v2 declared it itself.

  • @babel/plugin-syntax-typescript is now a dependency of Re.Pack and is passed to Babel as a resolved path, in both babel-swc-loader and the codegen rules.
  • @babel/core is now declared as a peer dependency, since Re.Pack's loaders import it at runtime and the syntax plugin peer-depends on it.

Test plan

  • pnpm --filter @callstack/repack test covers getExtraBabelPlugins and getCodegenTransformRules referencing the resolved plugin path.
  • tests/integration (react-native-parser.test.ts) no longer links @babel/plugin-syntax-typescript into the fixture project; it still links @react-native/babel-plugin-codegen.
  • 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
  • Bare RN 0.87.1 app (pnpm, template config, TS/TSX sources, no direct @babel/plugin-syntax-typescript), bundled with env -u NODE_PATH: main fails with Cannot find module '@babel/plugin-syntax-typescript'; with this change iOS and Android release bundles compile with 0 errors.
  • 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: 5682fc9

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
@CristiCeban
CristiCeban force-pushed the fix/declare-babel-syntax-typescript branch from 3be6620 to 8bb047d Compare October 12, 2026 07:42
for (const name of [
linkPackage(
projectRoot,
'@react-native/babel-plugin-codegen',

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should @react-native/babel-plugin-codegen be resolved in the same way or its not needed?

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.

2 participants