This repo consumes published npm packages by default. The vendor/mf-core git submodule is available for Module Federation R&D when you need to build and test local MF package changes before a canary is published.
For normal app development, use npm dependencies only:
pnpm install
pnpm devThe app manifests pin:
@module-federation/metro,@module-federation/metro-plugin-rnef, and@module-federation/runtimeto0.0.0-main-20260508022256zephyr-native-cacheandzephyr-metro-pluginto0.0.0-canary.62
Root pnpm.overrides keeps transitive @module-federation/* packages aligned to the same canary.
The submodule is tracked at vendor/mf-core and follows feat/native-cache-hashes.
git submodule update --init --recursive
git submodule status vendor/mf-coreTo update it to the configured branch tip:
git submodule update --remote --recursive vendor/mf-coreIf the submodule pointer changes and you want that exact commit shared with the repo, commit the vendor/mf-core gitlink change in the parent repo.
Use the submodule only when intentionally producing local MF package tarballs:
pnpm build:mf-coreThis runs scripts/build-mf-core.sh, which installs/builds the MF packages inside vendor/mf-core and writes generated tarballs to tarballs/:
module-federation-error-codes.tgzmodule-federation-sdk.tgzmodule-federation-runtime-core.tgzmodule-federation-runtime.tgzmodule-federation-metro.tgzmodule-federation-metro-plugin-rnef.tgz
tarballs/*.tgz is ignored by git. These artifacts are local experiment outputs, not committed release assets.
The repo does not consume tarballs/ by default. To test a local MF build, temporarily change the relevant package specs to file: tarballs.
For app-level dependencies, update apps/*/package.json as needed:
"@module-federation/metro": "file:../../tarballs/module-federation-metro.tgz",
"@module-federation/metro-plugin-rnef": "file:../../tarballs/module-federation-metro-plugin-rnef.tgz",
"@module-federation/runtime": "file:../../tarballs/module-federation-runtime.tgz"For transitive internals, update root package.json pnpm.overrides as needed:
"@module-federation/error-codes": "file:./tarballs/module-federation-error-codes.tgz",
"@module-federation/sdk": "file:./tarballs/module-federation-sdk.tgz",
"@module-federation/runtime-core": "file:./tarballs/module-federation-runtime-core.tgz",
"@module-federation/runtime": "file:./tarballs/module-federation-runtime.tgz"Then refresh dependencies and start Metro with a cache reset:
pnpm install
pnpm dev:raw.pnpmfile.cjs strips integrity hashes for file:tarballs/ resolutions so pnpm re-extracts rebuilt tarballs after each local pack.
After the experiment, switch package specs and overrides back to published versions, then reinstall:
pnpm install
pnpm dev:rawBefore opening or updating a PR, verify the repo is back on published packages unless the PR explicitly needs local tarball specs:
pnpm -r list @module-federation/metro @module-federation/metro-plugin-rnef @module-federation/runtime --depth 0- Use npm canaries for normal app work.
- Use
vendor/mf-coreonly for local MF source experiments. - Commit the submodule gitlink only when the repo should pin a new R&D commit.
- Do not commit generated
tarballs/*.tgzfiles. - Do not leave
file:./tarballsorfile:../../tarballsspecs in a PR unless that PR is explicitly about local tarball consumption.