Skip to content

Create mermaid flow diagram and table #3899

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 139 commits into
base: share-filter
Choose a base branch
from

Conversation

ScriptedAlchemy
Copy link
Member

%23%23 Description

This PR introduces comprehensive documentation (`nextjs-mf-sharing-diagram.md`) to clarify the Next.js Module Federation plugin's internal sharing mechanisms. It explains *why* Next.js 14 and 15 share similarly (primarily differing by server vs. client environment, not version) and details the prepared layer-based sharing for Next.js 15. This helps users understand the plugin's behavior and future capabilities.

Additionally, it includes a bug fix to prevent unwanted build configuration files (like `.swcrc`) from being published to npm, which was causing Jest test failures. A minor typo in the Next.js documentation has also been corrected.

%23%23 Related Issue

- Fixes %233873
- Addresses a user request for detailed documentation on Next.js Module Federation sharing internals.

%23%23 Types of changes

- [x] Docs change / refactoring / dependency upgrade
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)

%23%23 Checklist

- [ ] I have added tests to cover my changes.
- [x] All new and existing tests passed.
- [x] I have updated the documentation.

ScriptedAlchemy and others added 30 commits April 29, 2025 08:49
# Conflicts:
#	packages/chrome-devtools/project.json
ScriptedAlchemy and others added 16 commits July 6, 2025 16:16
…ignore

- Update Next.js 4000 app configuration with enhanced module federation settings
- Upgrade Next.js 4000 package dependencies to React 19 with proper script handling
- Enhance address bar component with improved remote button integration
- Update global navigation component with better layout and navigation handling
- Add .node binary files to .gitignore to prevent accidental commits
- Complete incremental merge of all enhanced nodeModulesReconstructedLookup features

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
…mporary files

- Restore __mocks__/remotes/index.js for proper test mocking
- Restore missing pages/router-test.tsx files for both Next.js applications
- Restore missing button components (classic/button.tsx, rsc/button.tsx)
- Restore ui/random.tsx component
- Remove temporary pnpm-lock.yaml files and development artifacts
- Complete final synchronization between branches

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Remove __mocks__/remotes/index.js that was inadvertently restored
- Update pnpm-lock.yaml with latest dependency resolutions
- Final cleanup to ensure branches are properly synchronized

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Fixed failing e2e-next tests by reverting nextjs-mf dependencies from
fixed version '0.0.0-next-20250701105507' back to 'workspace:*' in:
- apps/3001-shop/package.json
- apps/3002-checkout/package.json

This resolves module loading issues where the apps couldn't find
the nextjs-mf patches directory, allowing proper Next.js federation
to work correctly.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Fixed NextFederationPlugin to use correct path '../../loaders/next-flight-loader'
instead of '../../patches/next-flight-loader' since the patches directory
doesn't exist. This resolves module loading errors for Next.js 15+ apps.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
… commit

Restored missing e2e target configurations from the last working commit
9b7dff2:

- Added defaultConfiguration: "development" for both apps
- Added development configuration with devServerTarget
- Fixed production configuration for 3002-checkout to use devServerTarget

This matches the old CI infrastructure that was working properly.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Reverted to the main branch pattern where each e2e test manages its own
server dependencies:

- Updated GitHub workflows to run individual test:e2e commands
- Restored project.json test:e2e configurations from main branch
- Each app now starts required federated dependencies before testing
- Removed centralized server management approach

Shop e2e tests are now working properly with automatic dependency management.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Co-authored-by: Hanric <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: Cursor Agent <[email protected]>
# Conflicts:
#	apps/next-app-router/next-app-router-4000/cypress.config.ts
#	apps/next-app-router/next-app-router-4000/cypress/support/commands.ts
Co-authored-by: Wei Tang Lin <[email protected]>
Co-authored-by: Claude <[email protected]>
…ain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Copy link

changeset-bot bot commented Jul 11, 2025

🦋 Changeset detected

Latest commit: 34bc7b9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 33 packages
Name Type
@module-federation/runtime-tools Patch
@module-federation/enhanced Patch
@module-federation/rspack Patch
@module-federation/inject-external-runtime-core-plugin Patch
@module-federation/modern-js Patch
@module-federation/nextjs-mf Patch
@module-federation/node Patch
@module-federation/rsbuild-plugin Patch
@module-federation/rspress-plugin Patch
@module-federation/storybook-addon Patch
@module-federation/modernjsapp Patch
remote5 Patch
website-new Patch
@module-federation/runtime Patch
@module-federation/webpack-bundler-runtime Patch
@module-federation/sdk Patch
@module-federation/managers Patch
@module-federation/manifest Patch
@module-federation/dts-plugin Patch
@module-federation/third-party-dts-extractor Patch
@module-federation/devtools Patch
@module-federation/bridge-react Patch
@module-federation/bridge-vue3 Patch
@module-federation/bridge-shared Patch
@module-federation/bridge-react-webpack-plugin Patch
@module-federation/retry-plugin Patch
@module-federation/data-prefetch Patch
@module-federation/error-codes Patch
@module-federation/runtime-core Patch
create-module-federation Patch
@module-federation/cli Patch
@module-federation/esbuild Patch
@module-federation/utilities 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

ScriptedAlchemy and others added 9 commits July 11, 2025 14:20
- Added all direct import path shares (next/dist/compiled/*)
- Added all vendored React builds for different contexts
- Added Next.js internals shares including vendored/contexts/
- Added server-side default fallback shares
- Ensured all shares from source code are documented
- Improved accuracy of share configurations

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Created a detailed plan to split the massive changes in packages/enhanced
into 12 focused, incremental PRs:
- Runtime safety fixes (independent)
- Hook renaming refactor
- Container hoisting improvements
- Share filtering features (broken into 4 sub-features)
- Layer support enhancements
- API exports and test coverage

Each PR is self-contained with clear dependencies documented.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Created a detailed plan to split the massive changes in packages/enhanced
into 12 focused, incremental PRs:
- Runtime safety fixes (COMPLETED - PR #3900)
- Hook renaming refactor
- Container hoisting improvements
- Share filtering features (broken into 4 sub-features)
- Layer support enhancements
- API exports and test coverage

Each PR is self-contained with clear dependencies documented.

Also added worktrees/ to .gitignore

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Keep Next 15 and React 19 versions from share-filter branch
- Add utilities dependency from main to Next.js apps
- Keep newer Modern.js versions (2.68.2) from main
- Keep enhanced dependency tracking from share-filter branch
- Keep better error handling from main in EmbedFederationRuntimeModule and StartupHelpers
- Keep specific typing for addRemoteDependency from share-filter branch
- Update imports to use ModuleFederation instead of FederationHost
- Regenerate pnpm-lock.yaml
The utilities package is not imported or used in the 3000-home, 3001-shop, or 3002-checkout apps
- Remove @module-federation/utilities dependency from 3000-home, 3001-shop, and 3002-checkout apps
- Update pnpm lockfile to reflect dependency changes
- Postinstall scripts already set up to fail silently

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@ScriptedAlchemy ScriptedAlchemy force-pushed the share-filter branch 4 times, most recently from 60d6549 to 055deac Compare August 11, 2025 23:07
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