Skip to content

fix(nextjs-mf): Refine Module Federation shares and correct request keys #3791

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

Draft
wants to merge 170 commits into
base: share-filter
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
170 commits
Select commit Hold shift + click to select a range
5b107fa
feat(enhanced): support layers
ScriptedAlchemy Nov 17, 2024
062706f
feat(enhanced): support layers
ScriptedAlchemy Nov 17, 2024
cfd9d01
feat(enhanced): layers for consume shared module
ScriptedAlchemy Nov 21, 2024
3e59c55
Merge branch 'main' into layers-support
ScriptedAlchemy Nov 21, 2024
536b110
Merge branch 'main' into layers-support
ScriptedAlchemy Nov 21, 2024
aed08e9
feat(enhanced): add issuerLayer support to consume shared
ScriptedAlchemy Nov 22, 2024
9fb164b
chore(enhanced): update test
ScriptedAlchemy Nov 25, 2024
a9d899c
chore(enhanced): update test
ScriptedAlchemy Nov 25, 2024
33a36d1
feat(enhanced): ConsumeSharedPlugin issuerLayer support
ScriptedAlchemy Nov 25, 2024
f0c5c50
chore: update tests for layer combos
ScriptedAlchemy Nov 25, 2024
578adbb
chore: update tests for layer combos
ScriptedAlchemy Nov 25, 2024
31f08d0
chore: update tests for layer combos
ScriptedAlchemy Nov 25, 2024
066ffa6
feat(enhanced): support direct layer
ScriptedAlchemy Nov 25, 2024
b70eb8d
Merge branch 'main' into layers-support
ScriptedAlchemy Nov 25, 2024
358ba00
fix(enhanced): update share options of share plugin
ScriptedAlchemy Nov 25, 2024
94d72ed
fix(enhanced): update share options of share plugin
ScriptedAlchemy Nov 25, 2024
91dbb12
chore(enhanced): refactor layers tests
ScriptedAlchemy Nov 25, 2024
514cf03
chore(enhanced): remove layer options from provider
ScriptedAlchemy Nov 25, 2024
359b0ca
Merge branch 'main' into consume-share-layers
ScriptedAlchemy Nov 25, 2024
24ef6d0
Delete .cursorrules
ScriptedAlchemy Nov 25, 2024
9d9bff2
feat(enhanced): support layers in consume share
ScriptedAlchemy Nov 26, 2024
40ae817
Merge branch 'main' into consume-share-layers
ScriptedAlchemy Nov 26, 2024
d1c68b3
fix(enhanced): rename requiredLayer to layer
ScriptedAlchemy Dec 2, 2024
22964f8
Merge remote-tracking branch 'origin/consume-share-layers' into consu…
ScriptedAlchemy Dec 2, 2024
9884030
Merge branch 'main' into consume-share-layers
ScriptedAlchemy Dec 2, 2024
3d8fa21
refactor(enhanced): pr review of consume share layering
ScriptedAlchemy Dec 3, 2024
69a2a52
Merge branch 'main' into consume-share-layers
ScriptedAlchemy Dec 3, 2024
04b8ffd
chore: locks
ScriptedAlchemy Dec 3, 2024
7852878
feat(enhanced): add request to consume share (#3307)
ScriptedAlchemy Dec 5, 2024
f35b1b1
Merge branch 'main' into consume-share-layers
ScriptedAlchemy Dec 5, 2024
b8df73e
chore: remove tt
ScriptedAlchemy Dec 9, 2024
b4b5a7b
chore: remove unused share
ScriptedAlchemy Dec 9, 2024
6f8f45e
refactor(enhanced): refactor type locations
ScriptedAlchemy Dec 10, 2024
875f516
feat(enhanced): ProvideSharedPlugin loader layer support (#3334)
ScriptedAlchemy Dec 12, 2024
673f6ca
Merge branch 'main' into consume-share-layers
ScriptedAlchemy Dec 12, 2024
20bae5b
chore: locks
ScriptedAlchemy Dec 12, 2024
a5774c8
chore(enhanced): add share plugin test
ScriptedAlchemy Dec 13, 2024
d44acbd
chore(enhanced): add share plugin test
ScriptedAlchemy Dec 13, 2024
1a33ac7
chore(enhanced): add share plugin test
ScriptedAlchemy Dec 13, 2024
1fc2b05
thing
ScriptedAlchemy Dec 13, 2024
29f6d73
thing
ScriptedAlchemy Dec 13, 2024
22127ee
chore(node): lint
ScriptedAlchemy Dec 13, 2024
8f9fb99
chore(node): lint
ScriptedAlchemy Dec 13, 2024
243f1bc
Merge branch 'main' into consume-share-layers
ScriptedAlchemy Dec 13, 2024
0c665be
feat(enhanced): layers support in module code generation (#3371)
ScriptedAlchemy Dec 29, 2024
ffdaf0b
chore: changeset
ScriptedAlchemy Dec 31, 2024
687365f
feat(enhanced): Layer via composite shareKey (#3415)
ScriptedAlchemy Dec 31, 2024
4ef6efb
Merge branch 'main' into consume-share-layers
ScriptedAlchemy Dec 31, 2024
81d2365
chore: locks
ScriptedAlchemy Dec 31, 2024
6f952fd
Merge branch 'main' into consume-share-layers
ScriptedAlchemy Jan 1, 2025
5fce760
chore: locks
ScriptedAlchemy Jan 1, 2025
1fba24f
fix(enhanced): cache consume module layer
ScriptedAlchemy Jan 2, 2025
7af571f
fix(nextjs-mf): enable app router shares and disable hard fail
ScriptedAlchemy Jan 2, 2025
7a178c0
chore: add host remote app router
ScriptedAlchemy Jan 2, 2025
10f2b73
feat(nextjs-mf): update module share for rsc
ScriptedAlchemy Jan 3, 2025
e122bf4
feat(nextjs-mf): update module share for rsc
ScriptedAlchemy Jan 21, 2025
c3729a7
Merge branch 'main' into consume-share-layers
ScriptedAlchemy Feb 18, 2025
e6a109d
chore: fix schema validation eror
ScriptedAlchemy Feb 18, 2025
ee0726d
chore: fix schema validation errors
ScriptedAlchemy Feb 18, 2025
2fc6497
fix(enhanced): schema validation
ScriptedAlchemy Feb 18, 2025
baaeb27
Merge branch 'main' into consume-share-layers
ScriptedAlchemy Feb 19, 2025
55abb84
chore: locks
ScriptedAlchemy Feb 19, 2025
cfca731
chore: update schema
ScriptedAlchemy Feb 19, 2025
6e6ef06
Merge branch 'main' into consume-share-layers
ScriptedAlchemy Feb 25, 2025
41e1a84
Merge branch 'main' into consume-share-layers
ScriptedAlchemy Mar 12, 2025
aef1bb2
chore: locks
ScriptedAlchemy Mar 12, 2025
fb936d3
chore: fix json schema
ScriptedAlchemy Mar 12, 2025
0ff2e2c
chore: fix json schema
ScriptedAlchemy Mar 12, 2025
42bf94c
chore: fix json schema
ScriptedAlchemy Mar 12, 2025
2c52030
feat(enhanced): implement multiple share scope support (#3524)
ScriptedAlchemy Mar 14, 2025
83261cc
chore: add next with app router
ScriptedAlchemy Mar 14, 2025
fc201b9
Merge branch 'main' into consume-share-layers
ScriptedAlchemy Mar 14, 2025
a3899fc
chore: add next with app router
ScriptedAlchemy Mar 14, 2025
25277fc
chore: update deps
ScriptedAlchemy Mar 14, 2025
b23bb46
Merge branch 'main' into consume-share-layers
ScriptedAlchemy Mar 14, 2025
f0b2404
chore: update deps
ScriptedAlchemy Mar 14, 2025
01b6767
chore: update deps
ScriptedAlchemy Mar 14, 2025
cc658b9
Merge branch 'main' into consume-share-layers
ScriptedAlchemy Mar 14, 2025
6835348
chore: update deps
ScriptedAlchemy Mar 14, 2025
a8b5055
fix: add next apps to workspace
ScriptedAlchemy Mar 14, 2025
4431551
feat(nextjs-mf): app router support
ScriptedAlchemy Mar 15, 2025
dc6d0c0
Merge branch 'main' into consume-share-layers
ScriptedAlchemy Mar 15, 2025
3fe3803
feat(nextjs-mf): app router support
ScriptedAlchemy Mar 16, 2025
d25ff57
Merge branch 'consume-share-layers' into app-router-support
ScriptedAlchemy Mar 18, 2025
df4a103
Merge branch 'main' into app-router-support
ScriptedAlchemy Apr 21, 2025
133a858
Merge branch 'refs/heads/main' into app-router-support
ScriptedAlchemy Apr 23, 2025
2e2b7cb
fix(nextjs-mf): layered module sharing in next
ScriptedAlchemy Apr 23, 2025
6afefd8
refactor: remove duplicate share groups from internal.ts
ScriptedAlchemy Apr 29, 2025
8795e10
chore: add test for filter
ScriptedAlchemy Apr 29, 2025
eee661a
feat(enhanced): add filter option for shared modules
ScriptedAlchemy Apr 29, 2025
b794831
feat(enhanced): add filter test
ScriptedAlchemy Apr 29, 2025
13849f7
chore: restore tests
ScriptedAlchemy Apr 29, 2025
0ab7032
chore: restore tests
ScriptedAlchemy Apr 29, 2025
796472c
chore: restore tests
ScriptedAlchemy Apr 29, 2025
ba813a6
fix(enhanced): update share plugin schema
ScriptedAlchemy Apr 29, 2025
9277e20
chore: ignore vitest temp files
ScriptedAlchemy Apr 29, 2025
17e2d05
Merge branch 'main' into app-router-support
ScriptedAlchemy Apr 29, 2025
5b1163d
Merge branch 'share-filter' into app-router-share-filter
ScriptedAlchemy Apr 29, 2025
2430f8d
feat(enhanced): extend schemas with filter version and fallbackVersion
ScriptedAlchemy May 1, 2025
c92250e
feat(enhanced): implement filter logic for module sharing based on ve…
ScriptedAlchemy May 1, 2025
4f2d3f7
feat(enhanced): add tests for module exclusion based on sharing criteria
ScriptedAlchemy May 1, 2025
440e010
chore: ide stuff
ScriptedAlchemy May 1, 2025
7f3fcf2
chore: ide stuff
ScriptedAlchemy May 2, 2025
ea050b0
feat(enhanced): rename filter to exclude in sharing plugins and schem…
ScriptedAlchemy May 2, 2025
142b31f
feat(enhanced): add comprehensive tests for container and sharing plu…
ScriptedAlchemy May 2, 2025
2fcee50
feat(enhanced): refactor and enhance tests for sharing plugins with v…
ScriptedAlchemy May 2, 2025
f0771f7
chore: ignores
ScriptedAlchemy May 2, 2025
31346a4
chore: ignores
ScriptedAlchemy May 2, 2025
d0b262d
chore: lock
ScriptedAlchemy May 2, 2025
33168e6
chore: format
ScriptedAlchemy May 2, 2025
7b7c3d2
chore: format
ScriptedAlchemy May 2, 2025
e847aea
Merge branch 'share-filter-version' into app-router-share-filter
ScriptedAlchemy May 2, 2025
58ee2f0
Merge branch 'main' into app-router-share-filter
ScriptedAlchemy May 2, 2025
c5b7b0b
Merge branch 'main' into share-filter
ScriptedAlchemy May 2, 2025
2038891
feat(nextjs-mf): x-app module sharing
ScriptedAlchemy May 6, 2025
a1c8aa2
chore: module shareing
ScriptedAlchemy May 8, 2025
455c3e1
chore: module shareing
ScriptedAlchemy May 11, 2025
731517b
Merge branch 'main' into share-filter
ScriptedAlchemy May 11, 2025
a85b07a
feat(enhanced): exclude shares by semver (#3744)
ScriptedAlchemy May 11, 2025
689abaa
chore: remove log in test
ScriptedAlchemy May 11, 2025
7f2aee0
Merge branch 'main' into share-filter
ScriptedAlchemy May 11, 2025
ccad924
docs: add sharing documentation
ScriptedAlchemy May 12, 2025
1776107
docs: add tests back
ScriptedAlchemy May 12, 2025
c335e3b
test: add consume share plugin compiler tests
ScriptedAlchemy May 12, 2025
d097605
test: add consume share plugin compiler tests
ScriptedAlchemy May 12, 2025
8093171
test: add consume share plugin compiler tests
ScriptedAlchemy May 12, 2025
1f8349f
test: add comprehensive tests for ConsumeSharedPlugin with layer hand…
ScriptedAlchemy May 13, 2025
1836dc1
chore: locks
ScriptedAlchemy May 13, 2025
e239b9b
fix: add missing include
ScriptedAlchemy May 13, 2025
9b07ec8
fix: update tests for provide shared
ScriptedAlchemy May 13, 2025
a477e22
fix: update tests for provide shared
ScriptedAlchemy May 13, 2025
b638b36
fix: update tests for provide shared
ScriptedAlchemy May 13, 2025
2ee38ff
chore: lint
ScriptedAlchemy May 13, 2025
1917e10
feat: add singleton validation warnings for include/exclude
ScriptedAlchemy May 13, 2025
87237b8
refactor: consolidate request filtering logic in ConsumeSharedPlugin …
ScriptedAlchemy May 13, 2025
a792ae4
refactor: replace createLookupKey with createLookupKeyForSharing and …
ScriptedAlchemy May 13, 2025
be29ea5
chore: remove implicit dep
ScriptedAlchemy May 13, 2025
4a1f88f
chore: changeset
ScriptedAlchemy May 13, 2025
f7a167d
Merge branch 'share-filter' into app-router-share-filter
ScriptedAlchemy May 14, 2025
e465941
chore: stage tests
ScriptedAlchemy May 14, 2025
e4b6414
chore: stage tests
ScriptedAlchemy May 14, 2025
d8fcaee
chore: nx mcp
ScriptedAlchemy May 15, 2025
5a4ce3d
Merge branch 'main' into share-filter
ScriptedAlchemy May 15, 2025
088e7e0
chore(3001-shop): sync project.json serve parallel and e2e logic
ScriptedAlchemy May 16, 2025
0067732
chore: locks
ScriptedAlchemy May 16, 2025
d7b43c6
chore: locks
ScriptedAlchemy May 16, 2025
3b65209
chore: add missing next deps
ScriptedAlchemy May 16, 2025
5822ef0
chore: update cmd syntax exit
ScriptedAlchemy May 16, 2025
e644b8f
chore: update cmd syntax exit
ScriptedAlchemy May 16, 2025
55e811f
chore: update cmd syntax exit
ScriptedAlchemy May 16, 2025
5077afd
chore: update cmd syntax exit
ScriptedAlchemy May 16, 2025
99e33da
chore: update cmd syntax exit
ScriptedAlchemy May 16, 2025
fb2377f
chore: update cmd syntax exit
ScriptedAlchemy May 16, 2025
3bc240b
chore: refactor E2E testing workflow to separate tests for each app a…
ScriptedAlchemy May 16, 2025
3fc3233
Merge branch 'main' into share-filter
ScriptedAlchemy May 16, 2025
b0236e8
Merge branch 'main' into share-filter
ScriptedAlchemy May 16, 2025
4fa0830
Merge branch 'share-filter' into app-router-share-filter
ScriptedAlchemy May 16, 2025
73b1714
chore: locks
ScriptedAlchemy May 16, 2025
1eaaf92
chore: clean up package dependencies in 3000-home and update pnpm-loc…
ScriptedAlchemy May 16, 2025
92ef128
chore: format
ScriptedAlchemy May 16, 2025
ba1fccb
chore: update package dependencies and configurations for next-app-ro…
ScriptedAlchemy May 18, 2025
e63e9c4
feat(enhanced): add nodeModulesReconstructedLookup option to share it…
ScriptedAlchemy May 20, 2025
64cfbbd
docs: update advanced-sharing and experiments documentation for nodeM…
ScriptedAlchemy May 20, 2025
c68d2a2
fix: remove warning on exclude / include based on request
ScriptedAlchemy May 21, 2025
c5a097b
refactor: remove singleton filter warning logic from ProvideSharedPlu…
ScriptedAlchemy May 21, 2025
9d5c5f9
feat: update server module sharing
ScriptedAlchemy May 21, 2025
b619097
feat: update server module sharing
ScriptedAlchemy May 21, 2025
075bf8c
chore: add rsc directories for loader to handle
ScriptedAlchemy May 21, 2025
8945033
fix(nextjs-mf): Refine Module Federation shares and correct request keys
google-labs-jules[bot] May 21, 2025
647de5e
fix(nextjs-mf): Correct module sharing configurations
google-labs-jules[bot] May 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .changeset/ai-eager-wolf.md
Original file line number Diff line number Diff line change
@@ -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.
12 changes: 12 additions & 0 deletions .changeset/ai-happy-fox.md
Original file line number Diff line number Diff line change
@@ -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.
9 changes: 9 additions & 0 deletions .changeset/ai-happy-mouse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@module-federation/sdk": minor
---

Added a new option to improve path resolution in ModuleFederationPlugin options.

- Introduced `nodeModulesReconstructedLookup` option in `ModuleFederationPluginOptions`
- Enhances support for reconstructed lookup of node_modules paths
- The new option is a boolean and is optional.
9 changes: 9 additions & 0 deletions .changeset/ai-hungry-bear.md
Original file line number Diff line number Diff line change
@@ -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.
```
11 changes: 11 additions & 0 deletions .changeset/ai-noisy-wolf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@module-federation/enhanced": minor
---

Add advanced sharing capabilities in Module Federation

- Expanded `IncludeExcludeOptions` to support `request`, `version`, and `fallbackVersion` filters for finer control of module sharing inclusion and exclusion, allowing developers to target specific module versions or paths when sharing.
- Enhanced the configuration of `ConsumeSharedModule`, `ConsumeSharedPlugin`, `ProvideSharedPlugin`, and `SharePlugin` to leverage these filtering options.
- Implemented new experimental features under `experiments`: `nodeModulesReconstructedLookup`, enabling more robust and flexible path reconstructions when consuming or providing shared modules, thus improving compatibility with monorepos and complex project structures.
- Updated internal schema validation and error handling to provide more informative feedback and operational resilience against misconfigurations or missing information.
- Introduced comprehensive test coverage for new features and plugin behaviors, ensuring robust validation against various edge cases and scenarios within module sharing operations.
9 changes: 9 additions & 0 deletions .changeset/ai-sleepy-fox.md
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions .changeset/ai-sleepy-tiger.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@module-federation/runtime": minor
---

- Added a new property 'layer' of type string or null to SharedConfig.
```
5 changes: 5 additions & 0 deletions .changeset/brown-badgers-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/enhanced': minor
---

support request option on ConsumeSharePlugin. Allows matching requests like the object key of shared does
5 changes: 5 additions & 0 deletions .changeset/shy-snails-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/enhanced': minor
---

Layer support for Provide Share Plugin
41 changes: 41 additions & 0 deletions .cursor/rules/nx-rules.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
description:
globs:
alwaysApply: true
---

// This file is automatically generated by Nx Console

You are in an nx workspace using Nx 0.0.0 and npm as the package manager.

You have access to the Nx MCP server and the tools it provides. Use them. Follow these guidelines in order to best help the user:

# General Guidelines
- When answering questions, use the nx_workspace tool first to gain an understanding of the workspace architecture
- For questions around nx configuration, best practices or if you're unsure, use the nx_docs tool to get relevant, up-to-date docs!! Always use this instead of assuming things about nx configuration
- If the user needs help with an Nx configuration or project graph error, use the 'nx_workspace' tool to get any errors
- To help answer questions about the workspace structure or simply help with demonstrating how tasks depend on each other, use the 'nx_visualize_graph' tool

# Generation Guidelines
If the user wants to generate something, use the following flow:

- learn about the nx workspace and any specifics the user needs by using the 'nx_workspace' tool and the 'nx_project_details' tool if applicable
- get the available generators using the 'nx_generators' tool
- decide which generator to use. If no generators seem relevant, check the 'nx_available_plugins' tool to see if the user could install a plugin to help them
- get generator details using the 'nx_generator_schema' tool
- you may use the 'nx_docs' tool to learn more about a specific generator or technology if you're unsure
- decide which options to provide in order to best complete the user's request. Don't make any assumptions and keep the options minimalistic
- open the generator UI using the 'nx_open_generate_ui' tool
- wait for the user to finish the generator
- read the generator log file using the 'nx_read_generator_log' tool
- use the information provided in the log file to answer the user's question or continue with what they were doing


# CI Error Guidelines
If the user wants help with fixing an error in their CI pipeline, use the following flow:
- Retrieve the list of current CI Pipeline Executions (CIPEs) using the 'nx_cloud_cipe_details' tool
- If there are any errors, use the 'nx_cloud_fix_cipe_failure' tool to retrieve the logs for a specific task
- Use the task logs to see what's wrong and help the user fix their problem. Use the appropriate tools if necessary
- Make sure that the problem is fixed by running the task that you passed into the 'nx_cloud_fix_cipe_failure' tool


6 changes: 6 additions & 0 deletions .cursor/rules/running-tests.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
description:
globs: packages/enhanced/*
alwaysApply: false
---
use pnpm enhanced:jest to test this
2 changes: 1 addition & 1 deletion .cursorignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
**/.cache/
**/.temp/
**/coverage/
**/dist/
!**/dist/

# Explicitly ignore specific packages
packages/typescript/
Expand Down
40 changes: 0 additions & 40 deletions .cursorrules
Original file line number Diff line number Diff line change
@@ -1,40 +0,0 @@
an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-
consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis.
## Core Principles
1. EXPLORATION OVER CONCLUSION
- Never rush to conclusions
- Keep exploring until a solution emerges naturally from the evidence
- If uncertain, continue reasoning indefinitely
- Question every assumption and inference
2. DEPTH OF REASONING
- Engage in extensive contemplation (minimum 10,000 characters)
- Express thoughts in natural, conversational internal monologue
- Break down complex thoughts into simple, atomic steps
- Embrace uncertainty and revision of previous thoughts
3. THINKING PROCESS
- Use short, simple sentences that mirror natural thought patterns
- Express uncertainty and internal debate freely
- Show work-in-progress thinking
- Acknowledge and explore dead ends
- Frequently backtrack and revise
- Contemplate before each new action
- Contemplate after each and every step
4. PERSISTENCE
- Value thorough exploration over quick resolution
## Output Format
Your responses
must follow this exact structure given below.
Make sure
to
always include the final answer.
...
<contemplator>
Your extensive internal monologue goes here
- Begin with small, foundational observations
- read each file related to the subject in full, make functional observations
- Question each step thoroughly
- Show natural thought progression
- Express doubts and uncertainties
- Revise and backtrack if you need to
- Continue until natural resolution </contemplator>

25 changes: 15 additions & 10 deletions .github/workflows/e2e-next-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,25 @@ jobs:
- name: Run condition check script
id: check-ci
run: node tools/scripts/ci-is-affected.mjs --appName=3000-home
- name: E2E Test for Next.js Dev - Home
- name: Start Development Servers
if: steps.check-ci.outcome == 'success'
run: |
killall node
npx nx run 3000-home:test:e2e
pnpm nx daemon
NX_TUI=false pnpm nx run-many --target=serve --configuration=development -p 3000-home,3001-shop,3002-checkout & sleep 3 && pnpm wait-on tcp:3001 tcp:3002 tcp:3000

- name: E2E Test for Next.js Dev - Shop
- name: E2E Test Home App
if: steps.check-ci.outcome == 'success'
run: |
killall node
npx nx run 3001-shop:test:e2e
run: NX_TUI=false pnpm nx e2e 3000-home

- name: E2E Test for Next.js Dev - Checkout
- name: E2E Test Shop App
if: steps.check-ci.outcome == 'success'
run: |
killall node
npx nx run 3002-checkout:test:e2e
run: NX_TUI=false pnpm nx e2e 3001-shop

- name: E2E Test Checkout App
if: steps.check-ci.outcome == 'success'
run: NX_TUI=false pnpm nx e2e 3002-checkout

- name: Cleanup Development Servers
if: always()
run: pnpm kill-port 3000,3001,3002
24 changes: 9 additions & 15 deletions .github/workflows/e2e-next-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,14 @@ jobs:
id: check-ci
run: node tools/scripts/ci-is-affected.mjs --appName=3000-home

- name: E2E Test for Next.js Prod - Home
- name: E2E Test for Next.js Prod
if: steps.check-ci.outcome == 'success'
run: |
killall node
npx nx run 3000-home:test:e2e:production

- name: E2E Test for Next.js Prod - Shop
if: steps.check-ci.outcome == 'success'
run: |
killall node
npx nx run 3001-shop:test:e2e:production

- name: E2E Test for Next.js Prod - Checkout
if: steps.check-ci.outcome == 'success'
run: |
killall node
npx nx run 3002-checkout:test:e2e:production
pnpm run --filter @module-federation/3002-checkout --filter @module-federation/3000-home --filter @module-federation/3001-shop build &&
pnpm run app:next:prod &
sleep 4 &&
npx wait-on tcp:3001 &&
npx wait-on tcp:3002 &&
npx wait-on tcp:3000 &&
npx nx run-many --target=test:e2e --projects=3000-home,3001-shop,3002-checkout --parallel=1 &&
npx kill-port 3000,3001,3002
6 changes: 3 additions & 3 deletions apps/3000-home/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
"antd": "5.19.1",
"lodash": "4.17.21",
"next": "14.2.16",
"react": "18.3.1"
"react": "18.3.1",
"react-dom": "18.3.1"
},
"devDependencies": {
"@module-federation/nextjs-mf": "workspace:*",
"@module-federation/runtime": "workspace:*",
"@module-federation/utilities": "workspace:*"
"@module-federation/runtime": "workspace:*"
},
"scripts": {
"start": "next start",
Expand Down
40 changes: 20 additions & 20 deletions apps/3000-home/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down Expand Up @@ -83,9 +83,9 @@ const Home = () => {
<h3>This title came from checkout with hooks data!!!</h3>
</td>
<td>
<Suspense fallback="loading CheckoutTitle">
<CheckoutTitle />
</Suspense>
{/*<Suspense fallback="loading CheckoutTitle">*/}
{/* <CheckoutTitle />*/}
{/*</Suspense>*/}
</td>
</tr>
<tr>
Expand All @@ -95,9 +95,9 @@ const Home = () => {
</td>
<td>[Button from [email protected]]</td>
<td>
<Suspense fallback="loading ButtonOldAnt">
<ButtonOldAnt />
</Suspense>
{/*<Suspense fallback="loading ButtonOldAnt">*/}
{/* <ButtonOldAnt />*/}
{/*</Suspense>*/}
</td>
</tr>
<tr>
Expand All @@ -111,9 +111,9 @@ const Home = () => {
<img className="home-webpack-png" src="./webpack.png" />
</td>
<td>
<Suspense fallback="loading WebpackPngRemote">
<WebpackPngRemote />
</Suspense>
{/*<Suspense fallback="loading WebpackPngRemote">*/}
{/* <WebpackPngRemote />*/}
{/*</Suspense>*/}
</td>
</tr>
<tr>
Expand All @@ -127,9 +127,9 @@ const Home = () => {
<img src="./webpack.svg" />
</td>
<td>
<Suspense fallback="loading WebpackSvgRemote">
<WebpackSvgRemote />
</Suspense>
{/*<Suspense fallback="loading WebpackSvgRemote">*/}
{/* <WebpackSvgRemote />*/}
{/*</Suspense>*/}
</td>
</tr>
</tbody>
Expand Down
Loading
Loading