diff --git a/.changeset/ai-eager-wolf.md b/.changeset/ai-eager-wolf.md new file mode 100644 index 00000000000..ab5fe276767 --- /dev/null +++ b/.changeset/ai-eager-wolf.md @@ -0,0 +1,12 @@ +--- +"@module-federation/runtime-core": minor +--- + +Added support for OR ranges in semantic version satisfaction logic with comprehensive unit tests. + +- Implemented parsing for OR (||) conditions in version ranges. + - Split input ranges by || to evaluate alternatives individually. + - Ensured logical handling of wildcards '*' and 'x' within ranges. +- Refactored internal parsing to support more complex range constructs. +- Added comprehensive test cases to cover diverse scenarios for OR range support. +- Introduced error handling during range processing, with console logging for tracking issues. diff --git a/.changeset/ai-happy-fox.md b/.changeset/ai-happy-fox.md new file mode 100644 index 00000000000..51821121aff --- /dev/null +++ b/.changeset/ai-happy-fox.md @@ -0,0 +1,12 @@ +--- +"@module-federation/nextjs-mf": minor +--- + +Refactor and enhance module federation support for Next.js. + +- Introduced `getShareScope` function to dynamically generate the default share scope based on the client or server environment, replacing static DEFAULT_SHARE_SCOPE declarations. +- Implemented `RscManifestInterceptPlugin` to intercept and modify client reference manifests, ensuring proper prefix handling. +- Refined server-side externals handling to ensure shared federation modules are bundled. +- Simplified and modularized sharing logic by creating distinct functions for React, React DOM, React JSX Runtime, and React JSX Dev Runtime package configurations. +- Captured the original webpack public path for potential use in plugins and adjustments. +- Enhanced logging for debug tracing of shared module resolution processes in runtimePlugin. diff --git a/.changeset/ai-hungry-bear.md b/.changeset/ai-hungry-bear.md new file mode 100644 index 00000000000..444a92082bf --- /dev/null +++ b/.changeset/ai-hungry-bear.md @@ -0,0 +1,9 @@ +"@module-federation/enhanced": minor +--- + +Enhancements to layer handling in module federation tests and configuration. + +- Improved handling of `shareKey` for layers within `ConsumeSharedPlugin` and `ProvideSharedPlugin`. + - Conditionally prepend the `shareKey` with the `layer` if applicable. +- Introduced new layer configurations to support more nuanced federation scenarios that consider multiple layers of dependency. +``` diff --git a/.changeset/ai-sleepy-fox.md b/.changeset/ai-sleepy-fox.md new file mode 100644 index 00000000000..36d84f71503 --- /dev/null +++ b/.changeset/ai-sleepy-fox.md @@ -0,0 +1,9 @@ +--- +"@module-federation/enhanced": patch +--- + +Refactored module sharing configuration handling. + +- Simplified plugin schema for better maintainability +- Improved layer-based module sharing test coverage +- Removed redundant plugin exports diff --git a/.changeset/ai-sleepy-tiger.md b/.changeset/ai-sleepy-tiger.md new file mode 100644 index 00000000000..6c11ece998e --- /dev/null +++ b/.changeset/ai-sleepy-tiger.md @@ -0,0 +1,6 @@ +--- +"@module-federation/runtime": minor +--- + +- Added a new property 'layer' of type string or null to SharedConfig. +``` diff --git a/.changeset/brown-badgers-fetch.md b/.changeset/brown-badgers-fetch.md new file mode 100644 index 00000000000..00d28f1f096 --- /dev/null +++ b/.changeset/brown-badgers-fetch.md @@ -0,0 +1,5 @@ +--- +'@module-federation/enhanced': minor +--- + +support request option on ConsumeSharePlugin. Allows matching requests like the object key of shared does diff --git a/.changeset/shy-snails-battle.md b/.changeset/shy-snails-battle.md new file mode 100644 index 00000000000..8d4fb5ec2f1 --- /dev/null +++ b/.changeset/shy-snails-battle.md @@ -0,0 +1,5 @@ +--- +'@module-federation/enhanced': minor +--- + +Layer support for Provide Share Plugin diff --git a/.cursor/rules/running-tests.mdc b/.cursor/rules/running-tests.mdc new file mode 100644 index 00000000000..dfc8df4c75f --- /dev/null +++ b/.cursor/rules/running-tests.mdc @@ -0,0 +1,6 @@ +--- +description: +globs: packages/enhanced/* +alwaysApply: false +--- +use pnpm enhanced:jest to test this diff --git a/.cursorignore b/.cursorignore index 9ff4e05b449..5b264c56cf9 100644 --- a/.cursorignore +++ b/.cursorignore @@ -2,7 +2,7 @@ **/.cache/ **/.temp/ **/coverage/ -**/dist/ +!**/dist/ # Explicitly ignore specific packages packages/typescript/ diff --git a/apps/3000-home/pages/index.tsx b/apps/3000-home/pages/index.tsx index 905aa7c5767..442d412bdc7 100644 --- a/apps/3000-home/pages/index.tsx +++ b/apps/3000-home/pages/index.tsx @@ -1,15 +1,15 @@ import React, { Suspense, lazy } from 'react'; import Head from 'next/head'; -import CheckoutTitle from 'checkout/CheckoutTitle'; -import ButtonOldAnt from 'checkout/ButtonOldAnt'; +// import CheckoutTitle from 'checkout/CheckoutTitle'; +// import ButtonOldAnt from 'checkout/ButtonOldAnt'; // const CheckoutTitle = lazy(() => import('checkout/CheckoutTitle')); // const ButtonOldAnt = lazy(() => import('checkout/ButtonOldAnt')); -const WebpackSvgRemote = lazy(() => - import('shop/WebpackSvg').then((m) => { - return m; - }), -); -const WebpackPngRemote = lazy(() => import('shop/WebpackPng')); +// const WebpackSvgRemote = lazy(() => +// import('shop/WebpackSvg').then((m) => { +// return m; +// }), +// ); +// const WebpackPngRemote = lazy(() => import('shop/WebpackPng')); const Home = () => { return ( @@ -83,9 +83,9 @@ const Home = () => {
layout.js
and{' '}
- page.js
files.
- {pathname}
+ {JSON.stringify(params)}
+ {searchParams?.toString() ?? ''}
+ {segments?.join(', ') ?? ''}
+ {segment}
+ + This page exists in the 'pages' directory of an app that primarily uses + the App Router ('app' directory). +
++ Below are links demonstrating navigation potentially involving different + router types: +
++ Note: The instruction "sets both routers" was interpreted as + demonstrating links to potentially different router contexts. +
+