Skip to content

feat: Re.Pack 6 - raise version baselines and remove deprecated APIs - #1487

Open
dannyhw wants to merge 12 commits into
mainfrom
dannyhw/v6
Open

dannyhw wants to merge 12 commits into
mainfrom
dannyhw/v6

Conversation

@dannyhw

@dannyhw dannyhw commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

This starts Re.Pack 6. It's limited to raising the minimum supported versions, removing code that only existed for older versions, removing APIs deprecated in Re.Pack 5, and updating dependencies where the new floors allow it. Rspack 2 support will come in a follow-up PR.

New minimum versions

Re.Pack 5 Re.Pack 6
Node.js >=18 >=22.12
React Native >=0.74 >=0.82 (New Architecture only)
@module-federation/enhanced >=0.6.10 >=2.0.0
react-native-reanimated (plugin) >=3 >=4

The 0.82 floor is in its own commit (feat!: require React Native 0.82), so reverting that commit gets back to a 0.79 floor if we decide 0.82 is too aggressive. 0.79 matters for Expo SDK 53, and 0.81 for SDK 54. Node 22.12 is the release where require(esm) is no longer behind a flag.

Breaking changes

React Native

  • Native module is TurboModule-only:
    • Android: removed the old-architecture spec, the IS_NEW_ARCHITECTURE_ENABLED build config field and the conditional Gradle setup. The module extends the generated spec directly and gets the call invoker from ReactContext.
    • iOS: removed the RCT_NEW_ARCH_ENABLED branches. The codegen conformance is declared in ScriptManager.mm, so the public headers can still be imported from Swift.
  • Removed code paths for RN < 0.79:
    • the pre-0.79 HMRClient, DevLoadingView / LoadingView and AssetSourceResolver interop
    • the dev-only __REACT_NATIVE_{MAJOR,MINOR,PATCH}_VERSION__ globals
    • text/plain symbolication requests
    • the enableNewDebugger dev-middleware experiment
  • Android library cleanup:
    • removed the CallInvoker sources for RN <= 0.73
    • removed the AGP < 7.3 and NDK < 27 branches
    • removed the hard-coded AGP 7.3.1 buildscript
    • uses BaseReactPackage and the current Gradle DSL
  • The pod uses min_ios_version_supported instead of iOS 12.

Module Federation

  • Removed ModuleFederationPluginV1 and the Federated helpers. Repack.plugins.ModuleFederationPlugin is now an alias of ModuleFederationPluginV2.
  • apps/tester-federation (the V1 app) is removed.

Removed deprecated APIs

  • ChunksToHermesBytecodePlugin (use HermesBytecodePlugin)
  • getPublicPath
  • the --webpackConfig option (use --config)
  • the @callstack/repack/commands/{rspack,webpack} entry points (use @callstack/repack/commands)
  • reanimatedModuleRules

OutputPlugin now rejects the no-op output.bundleFilename, output.sourceMapFilename and output.assetsPath options.

Behaviour

  • getResolveOptions() now defaults enablePackageExports to true, which matches Metro since RN 0.79. RN 0.87+ needs it anyway.
  • The templates/ configs still pass true explicitly, because repack-init downloads them from main and a 5.x init would otherwise pick up Re.Pack 5's false default.

Reanimated plugin

  • Reanimated 3 doesn't support RN 0.82, so ReanimatedPlugin now throws for it and always requires react-native-worklets.
  • reanimated3ModuleRules is removed.

Fixes found along the way

  • ModuleFederationPluginV2 kept only string entries in runtimePlugins, so [path, options] tuples were silently dropped. It now keeps them.
  • ReanimatedPlugin stopped hiding the setUpTests / Critical dependency warning once Reanimated 4 added a [Reanimated] prefix to the message. Tester-app builds are warning-free again on both bundlers.
  • The @callstack/repack build now runs build:js and build:ts one after the other. Babel's --delete-dir-on-start could delete .d.ts files emitted by tsc when turbo ran them in parallel.

Dependency updates

  • @rslib/core 0.6 → 1.0
  • vitest 4 → 5 and vite 7 → 8. The vite 7 hold was only there for Node 18.
  • @types/node 20 → 22
  • terser-webpack-plugin is no longer pinned to 5.5.0; it's now ^5.6.1.
  • @module-federation/enhanced 2.x in testers and integration tests
  • dev-server: open 11
  • init:
    • execa 10
    • chalk 6
    • yargs 18
    • @manypkg/find-root 3
  • Build targets are ES2023 / Node 22. The CI matrix runs Node 22, 24 and 26.

Kept on purpose:

  • webpack ~5.105: @module-federation/enhanced < 2.4 needs it. Raising the MF floor to 2.4 would let us lift it.
  • exit-hook 4: with v5, Ctrl+C triggers a MaxListenersExceeded warning when stdout is redirected.

Docs

  • New "Migrating from Re.Pack 5" guide.
  • Updated:
    • quick-start requirements
    • the Module Federation, module resolution and Reanimated pages
    • the CLI reference
  • Removed the Module Federation V1 page.

Verification

  • build, typecheck and lint pass. The only lint warning is the existing one in repack-expo. All 13 test tasks pass.
  • tester-app production bundles build with Rspack and webpack on both platforms. The MF v2 host and mini app, and both Expo testers, bundle too.
  • Native builds:
    • tester-app Android debug APK
    • tester-app iOS simulator build
    • Android library AARs, identical before and after the Gradle DSL change
  • On the iOS simulator and the Android emulator, the app runs with Fabric and loads async chunks through ScriptManager.
  • repack-init smoke tests (mjs/cjs) and the website build pass.

dannyhw added 10 commits October 9, 2026 20:26
Drop code paths for React Native < 0.79: the pre-0.79 HMRClient named
exports, text/plain symbolication requests, the enableNewDebugger
dev-middleware experiment, the <= 0.73 Android CallInvoker sources and the
pre-0.76 / AGP < 7.3 Android build branches. The pod now uses React
Native's min_ios_version_supported deployment target. projectRoot is still
passed to dev-middleware, which requires it before 0.83.
Remove ModuleFederationPluginV1 and the Federated helpers, and point
ModuleFederationPlugin at ModuleFederationPluginV2. Module Federation
support now targets @module-federation/enhanced 2.x: runtime plugins use
the ModuleFederation/ModuleFederationRuntimePlugin types, runtime plugins
passed as [path, options] tuples are kept, and the warning filter for the
0.x runtime build is gone. The repack-expo doctor treats
ModuleFederationPlugin as V2, the MF V1 tester app is removed, and the
integration tests cover the 2.0 floor only.
Remove ChunksToHermesBytecodePlugin, getPublicPath, the --webpackConfig
CLI option, the commands/rspack and commands/webpack entry points and
reanimatedModuleRules. OutputPlugin now rejects the no-op
output.bundleFilename, output.sourceMapFilename and output.assetsPath
options.
Require Node.js 22.12, React Native 0.79 and @module-federation/enhanced
2.0 in package manifests, compile for Node 22 and drop Node 18/20 from the
CI matrix. Update dependencies that were held back by the old floors:
vitest 5 with vite 8 (now an explicit peer), @types/node 22, @rslib/core 1,
open 11, and execa 10, chalk 6, yargs 18 and @manypkg/find-root 3 in
repack-init. Move the Module Federation type dependencies to 2.8.0, lift
the terser-webpack-plugin 5.5.0 pin and drop the unused @types/react-dom.
Remove the commands/* export for the deleted entry points.
Add a Re.Pack 5 to 6 migration guide, update the minimum requirements,
remove the ModuleFederationPluginV1 and --webpackConfig references and
switch examples to the unified commands entry point. Add changesets.
Load DevLoadingView and AssetSourceResolver through their default exports
only, drop the dev-only __REACT_NATIVE_*_VERSION__ globals that existed to
pick between them, and remove the NDK < 27 page-size flag, the merged
libreactnativejni.so exclude and the AGP 7.3.1 buildscript from the Android
library. ScriptManagerPackage now extends BaseReactPackage and uses the
non-deprecated ReactModuleInfo constructor.
React Native 0.82 removed the legacy architecture, so the native module is
now built only as a TurboModule. Remove the Android oldarch/newarch spec
sources and the IS_NEW_ARCHITECTURE_ENABLED build config field, always apply
the React Native Gradle plugin, and read the call invoker from ReactContext
instead of CatalystInstance. On iOS, drop the RCT_NEW_ARCH_ENABLED branches;
the codegen spec conformance moves into ScriptManager.mm so the public
headers stay importable from the pod's Swift module.

Reanimated 3 does not support React Native 0.82, so ReanimatedPlugin now
requires Reanimated 4 with react-native-worklets and reanimated3ModuleRules
is removed. The hermesc fallback stays because React Native 0.82 still ships
hermesc inside the react-native package.
Metro has resolved package exports by default since React Native 0.79, and
React Native 0.87+ depends on them, so getResolveOptions now defaults
enablePackageExports to true. Pass false to resolve through main fields only.

Also fix ReanimatedPlugin's warning filter, which no longer matched the
setUpTests message from Reanimated 4's Jest utilities after it gained a
[Reanimated] prefix.
Replace the deprecated packagingOptions block with packaging, splitting the
native library and resource excludes and using keepDebugSymbols for debug
builds. The produced AARs are unchanged.
@changeset-bot

changeset-bot Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 99ca0fb

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 Major
@callstack/repack-plugin-reanimated Major
@callstack/repack-dev-server Major
@callstack/repack-init Major
@callstack/repack-plugin-expo-modules Major
@callstack/repack-plugin-nativewind Major

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

@vercel

vercel Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
repack-website Ready Ready Preview Oct 9, 2026 9:11pm UTC

Request Review

Resolve conflicts with the dependency security updates (#1486):
- apps/tester-federation stays removed
- keep vite 8 / vitest 5 from v6 in the catalog
- regenerate pnpm-lock.yaml from main's lockfile so its transitive
  security bumps carry over
Resolve the pnpm-lock.yaml conflict with the metro update (#1488) by
regenerating it from main's lockfile with v6's dependency changes applied.
@dannyhw dannyhw changed the title feat!: Re.Pack 6 - raise version baselines and remove deprecated APIs feat: Re.Pack 6 - raise version baselines and remove deprecated APIs Oct 9, 2026
@dannyhw
dannyhw added this pull request to stack #1491 October 9, 2026 23:41

This branch was successfully deployed

1 active deployment
Preview — 99ca0fb7 Deployed Oct 9, 2026 by vercel[bot]
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