[v6] Drop Module Federation v1 support and migrate fully to v2
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Refactorización
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- react-native, typescript, webpack
- Área
- build-system, documentation, testing, tooling
Línea de trabajo
Comienza con la actualización de dependencias necesaria en packages/repack e inspecciona ModuleFederationPluginV2.ts, el directorio FederationRuntimePlugins y los archivos de plugins, utilidades, aplicaciones, pruebas y documentación indicados. Ejecuta las pruebas unitarias y de integración relevantes, incluidas ModuleFederationPluginV2.test.ts y NativeEntryPlugin.test.ts. Se considera terminado cuando se haya eliminado la compatibilidad con V1, V2 sea el valor predeterminado y el alias conservado, las dependencias y las pruebas coincidan con el rango compatible y las aplicaciones y la documentación se hayan migrado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Motivation
Re.Pack currently ships two Module Federation implementations side by side: ModuleFederationPluginV1 (built on webpack's/Rspack's native container API) and ModuleFederationPluginV2 (built on @module-federation/enhanced). The generic Repack.plugins.ModuleFederationPlugin export still resolves to V1 and logs a notice on every build stating that the next major will repoint it at V2. v6 is that major.
MF v1 is no longer being iterated on upstream — all Module Federation development happens in the @module-federation/* v2 packages. Carrying both implementations doubles the plugin surface, the documentation, the tester apps and the test matrix, and it blocks a set of cleanups that only make sense once V1 is gone.
Part of #1414 (Roadmap to V6), which already lists MF v2+ as a minimum-version target and "updated docs for MF v2" as a deliverable.
Breaking changes
Repack.plugins.ModuleFederationPluginstarts resolving to the V2 implementation. Configs written against the V1 option shape need migrating.ModuleFederationPluginV1is removed.@module-federation/enhancedeffectively becomes a required peer dependency instead of an optional one. V1 needed no extra install; V2 hard-fails without it (ensureModuleFederationPackageInstalledinpackages/repack/src/plugins/ModuleFederationPluginV2.ts).- The build-side
Federatednamespace (createRemote,SHARED_REACT,SHARED_REACT_NATIVEinpackages/repack/src/utils/federated.ts) is removed — it is only consumed by V1.
Scope
Core
- Repoint
ModuleFederationPluginat the V2 implementation and drop thebeforeCompiledeprecation notice inpackages/repack/src/plugins/ModuleFederationPlugin.ts - Keep
ModuleFederationPluginV2exported as an alias so existing v5 configs continue to work unchanged - Remove
packages/repack/src/plugins/ModuleFederationPluginV1.ts, its export fromplugins/index.ts, and its unit tests - Remove
packages/repack/src/utils/federated.tsand its re-export fromutils/index.ts - Decide the fate of the client-side
Federatednamespace (importModule,createURLResolverinpackages/repack/src/modules/ScriptManager/federated.ts) — superseded by the MF v2 resolver runtime plugin, but it is public API and may be used independently of the build plugin - Move
@module-federation/enhancedout ofpeerDependenciesMeta.optionaland raise the peer floor to a 2.x range
Apps and tests
- Migrate
apps/tester-federationto V2, or fold it intoapps/tester-federation-v2and delete it — once both are on V2 they largely duplicate each other, so consolidating into a singletester-federationapp is probably the better outcome - Drop the
with Module Federation v1case intests/integration/src/plugins/NativeEntryPlugin.test.ts - Update the MF version matrix in the same file (currently 0.15.0 / 0.21.0 / 2.0.1) to match the new supported range
Docs
- Remove
website/src/latest/api/plugins/module-federation-v1.mdxand renamemodule-federation-v2.mdxtomodule-federation.mdx - Rewrite
website/src/latest/docs/features/module-federation.md, which currently just redirects readers to the Re.Pack 4.x docs with a caveat that they are out of date - Add an MF v1 → v2 section to the v5 → v6 migration guide
Prerequisite
This depends on first bumping @module-federation/enhanced in packages/repack from 0.8.9 to 2.x. That bump is a small standalone change but does have breakage of its own:
FederationRuntimePluginwas renamed toModuleFederationRuntimePluginandFederationHosttoModuleFederation, affecting all three runtime plugins inpackages/repack/src/modules/FederationRuntimePlugins/runtimePluginswidened to(string | [string, Record<string, unknown>])[], soadaptRuntimePluginsneeds to handle the tuple form — which also unlocks passing options to runtime plugins- the
jest.mock('@module-federation/enhanced/rspack')automock inModuleFederationPluginV2.test.tsno longer produces a constructor and needs an explicit factory
As a bonus, moving to @module-federation/enhanced >= 2.4.0 also releases the webpack hold at ~5.105.0 in pnpm-workspace.yaml, which exists solely because older MF versions depend on a webpack internal removed in 5.106.
- Lenguaje dominante
- TypeScript
- Estrellas
- 1.9k
- Forks
- 168
- Merge medio
- 2 d 4 h
- PR fusionados (30 d)
- 13
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de callstack/repack
-
json as string in JS bundleAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
callstack/repack#1461 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
babelLoader always uses hermes-parser, unlike Metro — 90s on one prebuilt filePosiblemente ocupada @elirangoshen la tomó hace 36 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 78/100
callstack/repack#1447 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
area:repack type:feature
Dificultad 5/5 Más de una semana Aptitud para principiantes 42/100
callstack/repack#1423 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[v6] Rework the SWC setup: native Flow support and a modernized getJsTransformRulesPosiblemente ocupada @whydidoo la tomó hoy. Abiertoarea:repack type:feature
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
callstack/repack#1422 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Roadmap to V6Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
callstack/repack#1414 · 1 comentario · 3 reacciones ·
Los mantenedores suelen responder en 1 día
Todos los issues de callstack/repack
Issues similares
-
Dependencies view: `getParent` loops forever on untitled documents, extension host runs out of memoryPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 Menos de una hora Aptitud para principiantes 82/100
awslabs/visual-asset-management-system#413 ·
Los mantenedores suelen responder en 1 día
-
bug confirmed perf
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
videojs/video.js#9400 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug pending triage scope/agent
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
good first issue hacktoberfest
Dificultad 2/5 Medio día Aptitud para principiantes 70/100
HelpCode-ai/anythingmcp#996 ·
Los mantenedores suelen responder en 1 día