Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
327 commits
Select commit Hold shift + click to select a range
0f0ca8e
refactor(rsc-mf): drop remote client chunkLoadingGlobal override
cursoragent Feb 13, 2026
e75f56e
refactor(rsc-mf): consume bundled action expose via namespace import
cursoragent Feb 13, 2026
336d821
test(rsc-mf): assert action posts avoid remote origin
cursoragent Feb 13, 2026
6c19452
test(rsc-mf): assert host-resolvable x-rsc-action ids
cursoragent Feb 13, 2026
ed0f9f5
refactor(rsc-mf): use namespace imports in host server bundle coverage
cursoragent Feb 13, 2026
a40bae2
refactor(rsc-mf): route host proxy actions through bundled expose imp…
cursoragent Feb 13, 2026
99989e1
test(rsc-mf): assert host proxy action manifest coverage
cursoragent Feb 13, 2026
cf1e7fb
test(rsc-mf): cover bundled nested and increment host actions
cursoragent Feb 13, 2026
6871db7
refactor(rsc-mf): stabilize remote callback registration keying
cursoragent Feb 14, 2026
051929d
refactor(rsc-mf): avoid client stringify in callback dependency
cursoragent Feb 14, 2026
6cb5574
test(rsc-mf): assert posted action ids match host proxy set
cursoragent Feb 14, 2026
76ec229
refactor(rsc-mf): centralize host proxy mapping and manifest forms
cursoragent Feb 14, 2026
4368d53
test(rsc-mf): assert host proxy id list uniqueness and format
cursoragent Feb 14, 2026
25af768
test(rsc-mf): surface direct and bundled proxy id groups
cursoragent Feb 14, 2026
6256add
test(rsc-mf): validate proxy id group union membership
cursoragent Feb 14, 2026
225df15
test(rsc-mf): assert proxy map entry count aligns with ids
cursoragent Feb 14, 2026
d806ec0
test(rsc-mf): assert proxy map entry count aligns with ids
cursoragent Feb 14, 2026
f02e2cf
test(rsc-mf): assert mapped proxy id coverage markers
cursoragent Feb 14, 2026
c220479
refactor(rsc-mf): model effective remote action map keys
cursoragent Feb 14, 2026
db078ac
test(rsc-mf): bind posted action ids to effective map key count
cursoragent Feb 14, 2026
35e033c
test(rsc-mf): handle direct-bundled id collisions in request checks
cursoragent Feb 14, 2026
12dd1e0
test(rsc-mf): expose exact proxy-map equality diagnostics
cursoragent Feb 14, 2026
661c5c3
test(rsc-mf): expose proxy map collision count diagnostics
cursoragent Feb 14, 2026
ee24d53
test(rsc-mf): cover remote client default server action path
cursoragent Feb 14, 2026
7483029
test(rsc-mf): assert request coverage across action families
cursoragent Feb 14, 2026
9d3c307
test(rsc-mf): cover direct host nested and increment actions
cursoragent Feb 14, 2026
0c0ca33
test(rsc-mf): enforce minimum action post volume per mode
cursoragent Feb 14, 2026
963c240
test(rsc-mf): require action-family union coverage for posted ids
cursoragent Feb 14, 2026
6f81467
test(rsc-mf): require action-family union coverage for posted ids
cursoragent Feb 14, 2026
1256515
test(rsc-mf): assert repeated client callback request growth
cursoragent Feb 14, 2026
d321237
test(rsc-mf): align unique posted ids with effective action keys
cursoragent Feb 14, 2026
bf25039
test(rsc-mf): tighten per-family proxy id cardinality checks
cursoragent Feb 14, 2026
93890ab
test(rsc-mf): tighten per-family proxy id cardinality checks
cursoragent Feb 14, 2026
0dec94c
test(rsc-mf): assert action request URL-id parity
cursoragent Feb 14, 2026
047f7d2
test(rsc-mf): assert family union spans all host proxy ids
cursoragent Feb 14, 2026
b4705d9
test(rsc-mf): enforce exact action post cardinality profile
cursoragent Feb 14, 2026
542a4ad
test(rsc-mf): enforce exact action post cardinality profile
cursoragent Feb 14, 2026
be0ceaa
test(rsc-mf): assert uniform per-id action request frequency
cursoragent Feb 14, 2026
549ba4e
refactor(rsc-mf): remove host proxy action glue and use bridge ids
cursoragent Feb 14, 2026
301a7b4
refactor(rsc-mf): auto-register remote callback in federated client
cursoragent Feb 14, 2026
72e8c86
test(rsc-mf): assert callback helper no longer needs expose
cursoragent Feb 14, 2026
13edc5b
refactor(rsc-mf): initialize callback bridge via client side-effect m…
cursoragent Feb 14, 2026
8621bd2
test(rsc-mf): assert callback expose chunk is never requested
cursoragent Feb 14, 2026
daaadd3
refactor(rsc-mf): centralize callback init in remote counter entry
cursoragent Feb 14, 2026
18664e8
docs(rsc-mf): clarify bridge callback helper intent
cursoragent Feb 14, 2026
d6464ff
refactor(rsc-mf): move callback bootstrap to runtime module
cursoragent Feb 14, 2026
7f870fa
refactor(rsc-mf): route exposed modules through runtime bootstrap wra…
cursoragent Feb 14, 2026
a86f3b5
refactor(rsc-mf): move callback registration helper into runtime name…
cursoragent Feb 14, 2026
790f315
test(rsc-mf): assert callback wiring stays in runtime modules
cursoragent Feb 14, 2026
f53e085
test(rsc-mf): enforce runtime boundary across all component sources
cursoragent Feb 14, 2026
6b3054d
refactor(rsc-mf): funnel all remote exposes through runtime boundary
cursoragent Feb 14, 2026
9c2099a
refactor(rsc-mf): define remote exposes from single runtime map
cursoragent Feb 14, 2026
90c4dac
refactor(rsc-mf): guard runtime expose paths in remote config
cursoragent Feb 14, 2026
4da2b0a
test(rsc-mf): validate callback bootstrap wrapper set coverage
cursoragent Feb 14, 2026
f8aabd0
test(rsc-mf): assert remote manifest avoids source-path exposes
cursoragent Feb 14, 2026
25443dc
refactor(rsc-mf): inline callback bootstrap in expose imports
cursoragent Feb 14, 2026
2ef0c80
refactor(rsc-mf): bootstrap callback for all remote exposes
cursoragent Feb 14, 2026
6953bab
refactor(rsc-mf): guard exposes to component modules
cursoragent Feb 14, 2026
347d204
test(rsc-mf): lock lazy callback bootstrap import semantics
cursoragent Feb 14, 2026
7dde578
test(rsc-mf): validate manifest expose set is userland subset
cursoragent Feb 14, 2026
e9f09d3
test(rsc-mf): assert config expose map matches expected userland keys
cursoragent Feb 14, 2026
36966a9
test(rsc-mf): ensure host sources stay callback-wiring free
cursoragent Feb 14, 2026
f56389c
test(rsc-mf): lock host runtime plugins to transparent defaults
cursoragent Feb 14, 2026
b4da5b5
refactor(rsc-mf): memoize callback bootstrap initialization
cursoragent Feb 14, 2026
88fdf16
refactor(rsc-mf): reset callback bootstrap promise after failures
cursoragent Feb 14, 2026
088d643
test(rsc-mf): guard modern config callback wiring boundaries
cursoragent Feb 14, 2026
66097a4
test(rsc-mf): assert modern config keeps transparent runtime boundaries
cursoragent Feb 14, 2026
6a9e740
test(rsc-mf): enforce remote shared-scope and experiment config invar…
cursoragent Feb 14, 2026
8baab1f
refactor(rsc-mf): validate expose keys and protect bootstrap module f…
cursoragent Feb 14, 2026
8435ed6
test(rsc-mf): assert callback posting contract in runtime register so…
cursoragent Feb 14, 2026
b28577b
test(rsc-mf): lock runtime callback transport header semantics
cursoragent Feb 14, 2026
82936fe
test(rsc-mf): assert callback bootstrap derives host origin dynamically
cursoragent Feb 14, 2026
010fc9b
refactor(rsc-mf): normalize callback action URL and assert request Ac…
cursoragent Feb 14, 2026
91e183e
test(rsc-mf): verify action requests preserve RSC accept header
cursoragent Feb 14, 2026
2dbf236
test(rsc-mf): verify expose import files exist via source scan
cursoragent Feb 14, 2026
d18d90b
refactor(rsc-mf): require explicit TypeScript expose entry extensions
cursoragent Feb 14, 2026
fbd36bd
test(rsc-mf): assert runtime exposes wrapper directory stays empty
cursoragent Feb 14, 2026
b0e1593
test(rsc-mf): lock runtime callback helper file surface
cursoragent Feb 14, 2026
114deee
test(rsc-mf): lock callback alias usage to runtime helpers
cursoragent Feb 14, 2026
f071c8d
test(rsc-mf): lock runtime callback initialization contract
cursoragent Feb 14, 2026
1dba1cf
test(rsc-mf): prevent host callback runtime leakage
cursoragent Feb 14, 2026
99b81e1
refactor(rsc-mf): guard expose imports against traversal paths
cursoragent Feb 14, 2026
f8e30d1
refactor(rsc-mf): validate callback bootstrap import boundaries
cursoragent Feb 14, 2026
5762be3
refactor(rsc-mf): validate remote alias before bridge action prefixing
cursoragent Feb 14, 2026
71afe3b
refactor(rsc-mf): enforce http(s) callback action URLs
cursoragent Feb 14, 2026
d72f82c
refactor(rsc-mf): reject callback URLs with embedded credentials
cursoragent Feb 14, 2026
aa01c52
refactor(rsc-mf): trim callback origin and block URL credentials
cursoragent Feb 14, 2026
916209c
refactor(rsc-mf): normalize raw action ids before bridge prefix
cursoragent Feb 14, 2026
97084d6
test(rsc-mf): reduce brittle runtime source assertions
cursoragent Feb 14, 2026
102d1fd
test(rsc-mf): focus source guards on stable integration contracts
cursoragent Feb 14, 2026
9cd4ad0
test(rsc-mf): add runtime callback contract behavior tests
cursoragent Feb 14, 2026
6638c75
test(rsc-mf): cover action-id normalization and empty-origin skip
cursoragent Feb 14, 2026
992d086
test(rsc-mf): cover alias trim dedupe in callback registration
cursoragent Feb 14, 2026
423164b
test(rsc-mf): verify alias changes re-register callback handler
cursoragent Feb 14, 2026
34dc442
test(rsc-mf): cover callback rebind on normalized URL changes
cursoragent Feb 14, 2026
587ab25
test(rsc-mf): assert callback rebind when endpoint path changes
cursoragent Feb 14, 2026
a0168c4
test(rsc-mf): add init callback bootstrap behavior coverage
cursoragent Feb 14, 2026
18cdc2e
test(rsc-mf): move mf config guardrails into behavior tests
cursoragent Feb 14, 2026
2ff9d9e
test(rsc-mf): replace runtime source checks with behavior guards
cursoragent Feb 14, 2026
c429e03
test(rsc-mf): trim remaining source-content guardrail assertions
cursoragent Feb 14, 2026
29137b8
test(rsc-mf): drop remaining filesystem source guard checks
cursoragent Feb 14, 2026
b7dbdc6
test(rsc-mf): expand host config behavior coverage
cursoragent Feb 14, 2026
396e709
test(rsc-mf): add modern config behavior contract tests
cursoragent Feb 14, 2026
23831f7
test(rsc-mf): verify host shared scope alignment
cursoragent Feb 14, 2026
c535de5
refactor(rsc-mf): validate callback URL parse before protocol checks
cursoragent Feb 14, 2026
a38a1d3
refactor(rsc-mf): remove redundant remote bridge import anchor
cursoragent Feb 14, 2026
7e0c483
refactor(rsc-mf): rely on default remote alias in bootstrap
cursoragent Feb 14, 2026
d30b0e2
test(rsc-mf): assert no chunkLoadingGlobal modern config coupling
cursoragent Feb 14, 2026
eab45df
test(rsc-mf): assert modern plugin options and preEntry absence
cursoragent Feb 14, 2026
7dc783c
refactor(rsc-mf): retry callback bootstrap on transient failures
cursoragent Feb 14, 2026
8830523
refactor(rsc-mf): simplify callback keying and cover default alias
cursoragent Feb 14, 2026
0e4dd7a
test(rsc-mf): cover host web chain and remote port precedence
cursoragent Feb 14, 2026
c6dc285
refactor(rsc-mf): fallback bootstrap retries without queueMicrotask
cursoragent Feb 14, 2026
cfbc77e
test(rsc-mf): assert no failed host or remote responses
cursoragent Feb 14, 2026
e9ca0b6
refactor(rsc-mf): normalize callback action pathname before registration
cursoragent Feb 14, 2026
396a96d
test(rsc-mf): assert no failed browser requests in dev and build
cursoragent Feb 14, 2026
4af5b4e
refactor(rsc-mf): fail fast on non-ok callback responses
cursoragent Feb 14, 2026
9fd29b5
refactor(rsc-mf): retry callback fetch once before failing
cursoragent Feb 14, 2026
269e5a4
test(rsc-mf): verify retry policy for callback 5xx and 4xx
cursoragent Feb 14, 2026
c734397
test(rsc-mf): assert callback retry request body reuse
cursoragent Feb 14, 2026
0f92cc2
refactor(rsc-mf): extract callback expose wiring helper
cursoragent Feb 14, 2026
3a8376e
refactor(rsc-mf): allow broader userland expose module paths
cursoragent Feb 14, 2026
48c15eb
refactor(rsc-mf): support relative expose import paths
cursoragent Feb 14, 2026
cfb69fc
refactor(rsc-mf): accept cjs/mjs/cts/mts expose entries
cursoragent Feb 14, 2026
f6beeb9
refactor(rsc-mf): support object expose definitions with import arrays
cursoragent Feb 14, 2026
5d39965
refactor(rsc-mf): normalize mixed expose definition shapes
cursoragent Feb 14, 2026
73814a0
test(rsc-mf): lock mixed expose-definition guardrails
cursoragent Feb 14, 2026
0d5ec92
refactor(rsc-mf): retry callback fetch on 429 responses
cursoragent Feb 14, 2026
ae03f8f
test(rsc-mf): allow multi-import expose definitions in config contract
cursoragent Feb 14, 2026
4a92133
refactor(rsc-mf): dedupe repeated expose import entries
cursoragent Feb 14, 2026
962d1e8
refactor(rsc-mf): retry callback fetch on timeout status codes
cursoragent Feb 14, 2026
04bea87
test(rsc-mf): verify callback retry for 425 responses
cursoragent Feb 14, 2026
a289809
refactor(rsc-mf): trim expose import paths before validation
cursoragent Feb 14, 2026
a689f5b
test(rsc-mf): assert callback network failure after retries
cursoragent Feb 14, 2026
8f9e303
test(rsc-mf): assert dedupe behavior in remote expose config
cursoragent Feb 14, 2026
ba39928
refactor(rsc-mf): normalize callback URLs with trailing slashes
cursoragent Feb 14, 2026
442271f
test(rsc-mf): assert terminal 429 callback failure after retry
cursoragent Feb 14, 2026
7ae305c
refactor(rsc-mf): enforce single-module object import arrays
cursoragent Feb 14, 2026
4ec8948
test(rsc-mf): cover root callback URL slash dedupe
cursoragent Feb 14, 2026
2c4a7f1
test(rsc-mf): cover slash+fragment callback URL dedupe
cursoragent Feb 14, 2026
3b75a5c
test(rsc-mf): cover default-port callback URL normalization
cursoragent Feb 14, 2026
e2ab44d
refactor(rsc-mf): keep remote exposes as plain userland strings
cursoragent Feb 14, 2026
21f7ed4
test(rsc-mf): relax expose-contract checks to behavior-level
cursoragent Feb 14, 2026
51d9f59
test(rsc-mf): cover default https-port callback normalization
cursoragent Feb 14, 2026
de556c1
test(rsc-mf): assert callback rebind when endpoint port changes
cursoragent Feb 14, 2026
44f2ead
refactor(rsc-mf): keep host remote public-path plugin always on
cursoragent Feb 14, 2026
0b0942f
test(rsc-mf): assert browser expose-chunk coverage
cursoragent Feb 14, 2026
28690f1
test(rsc-mf): cover host federated asset proxy middleware
cursoragent Feb 14, 2026
8d4cb53
test(rsc-mf): validate forceRemotePublicPath runtime plugin behavior
cursoragent Feb 14, 2026
1b8615c
test(rsc-mf): cover callback URL host-casing normalization
cursoragent Feb 14, 2026
95bf06c
test(rsc-mf): cover remote entry URL normalization in runtime plugin
cursoragent Feb 14, 2026
57ba0af
test(rsc-mf): cover additional federated asset proxy path markers
cursoragent Feb 14, 2026
b04a9b4
fix(rsc-mf): ignore malformed remote entry URLs in runtime plugin
cursoragent Feb 14, 2026
22b8c20
fix(rsc-mf): add manifest fallback for stale expose chunk paths
cursoragent Feb 14, 2026
9dcaef7
test(rsc-mf): cover shared-asset manifest fallback resolution
cursoragent Feb 14, 2026
4087302
test(rsc-mf): cover css stale-path manifest fallback
cursoragent Feb 14, 2026
bc6434c
test(rsc-mf): assert no-match manifest fallback passthrough
cursoragent Feb 14, 2026
800c14c
fix(rsc-mf): tolerate invalid remote manifest fallback payloads
cursoragent Feb 14, 2026
9b62709
test(rsc-mf): cover manifest-fetch failure passthrough
cursoragent Feb 14, 2026
8b96753
test(rsc-mf): extend manifest fallback query and async-asset coverage
cursoragent Feb 14, 2026
3a11926
refactor(rsc-mf): skip manifest fallback for non-expose proxy paths
cursoragent Feb 14, 2026
4321302
fix(rsc-mf): support alphanumeric fallback hash suffix matching
cursoragent Feb 14, 2026
18a8193
test(rsc-mf): harden manifest fallback URL resolution
cursoragent Feb 14, 2026
260278b
feat(rsc-mf): add remote expose-asset fallback middleware
cursoragent Feb 14, 2026
cc65c74
test(rsc-mf): expand remote manifest fallback contracts
cursoragent Feb 14, 2026
42251e9
fix(rsc-mf): avoid host fallback refetching same expose URL
cursoragent Feb 14, 2026
cdf5a36
fix(rsc-mf): block fallback path traversal escapes
cursoragent Feb 14, 2026
52e1eeb
test(rsc-mf): broaden remote fallback matching coverage
cursoragent Feb 14, 2026
fb1b47f
refactor(rsc-mf): share manifest fallback helpers
cursoragent Feb 14, 2026
101d5cf
test(rsc-mf): add shared manifest fallback helper coverage
cursoragent Feb 14, 2026
80084f9
fix(rsc-mf): mark host fallback fetches as internal
cursoragent Feb 14, 2026
7fc15bf
fix(rsc-mf): skip host proxy on internal fallback requests
cursoragent Feb 14, 2026
2d115bf
fix(rsc-mf): guard fallback helper against invalid origins
cursoragent Feb 14, 2026
a9551bc
test(rsc-mf): cover stale hashed expose fallback paths
cursoragent Feb 14, 2026
ff31a2f
fix(rsc-mf): reject encoded fallback path traversal
cursoragent Feb 14, 2026
9dd6b4e
test(rsc-mf): cover stale-hashed css fallback paths
cursoragent Feb 14, 2026
3407784
test(rsc-mf): cover malformed percent fallback paths
cursoragent Feb 14, 2026
4dcb3f9
test: cover manifest query override precedence
cursoragent Feb 14, 2026
d71fde9
fix(rsc-mf): alias server-only in remote client bundle
cursoragent Feb 14, 2026
ee7456f
test(rsc-mf): guard host rsc streaming mode invariants
cursoragent Feb 14, 2026
b3ea214
fix(rsc-mf): sanitize proxied asset transport headers
cursoragent Feb 14, 2026
42cffd9
refactor(rsc-mf): share safe proxy response helper
cursoragent Feb 14, 2026
e7aa758
test(rsc-mf): expand hop-by-hop header sanitization coverage
cursoragent Feb 14, 2026
bf39dff
fix(rsc-mf): strip proxy-connection hop headers
cursoragent Feb 14, 2026
4220d7c
fix(rsc-mf): sanitize quoted connection hop headers
cursoragent Feb 14, 2026
b52cb63
fix(rsc-mf): normalize quoted connection tokens
cursoragent Feb 14, 2026
91b8d88
test(rsc-mf): cover mixed-case connection token stripping
cursoragent Feb 14, 2026
4f3cb6a
test(rsc-mf): assert proxied response status text
cursoragent Feb 14, 2026
21b5649
fix(rsc-mf): guard no-body statuses in proxy responses
cursoragent Feb 14, 2026
637bddd
test(rsc-mf): cover 205 and 304 proxy body stripping
cursoragent Feb 14, 2026
2994076
fix(rsc-mf): normalize empty quoted connection tokens
cursoragent Feb 14, 2026
18bbd03
fix(rsc-mf): typecheck and finalize federation asset middleware
cursoragent Feb 14, 2026
e1e43b0
test(rsc-mf): cover middleware context body response finalization
cursoragent Feb 14, 2026
6db7873
fix(rsc-mf): prefer hashed manifest fallback assets
cursoragent Feb 14, 2026
eb3907e
test(rsc-mf): lock tsconfig rootDir shared-import contract
cursoragent Feb 14, 2026
d3a15f5
refactor(rsc-mf): localize server fallback utilities per fixture app
cursoragent Feb 14, 2026
f0c0530
refactor(rsc-mf): scope callback bootstrap to client/action exposes
cursoragent Feb 14, 2026
b52276d
refactor(rsc-mf): infer callback bootstrap from expose source directives
cursoragent Feb 14, 2026
03b1c97
refactor(rsc-mf): make callback bootstrap injection source-driven
cursoragent Feb 14, 2026
66f1360
refactor(rsc-mf): infer callback bootstrap from local import graph
cursoragent Feb 14, 2026
29ec045
test(rsc-mf): lock callback bootstrap expose coverage
cursoragent Feb 14, 2026
1259a7f
refactor(rsc-mf): infer callback bootstrap from dynamic imports
cursoragent Feb 14, 2026
aec0a14
fix(rsc-mf): ignore type-only imports in callback bootstrap inference
cursoragent Feb 14, 2026
f8adc5d
fix(rsc-mf): distinguish type-only and runtime specifier edges
cursoragent Feb 14, 2026
2b24a63
test(rsc-mf): cover side-effect import callback inference boundaries
cursoragent Feb 14, 2026
6d2e37d
test(rsc-mf): cover namespace and export-type-all inference edges
cursoragent Feb 14, 2026
11d6e46
test(rsc-mf): cover inline export type-only and mixed bindings
cursoragent Feb 14, 2026
e40ab15
fix(rsc-mf): infer callback bootstrap through commonjs require edges
cursoragent Feb 14, 2026
585a17e
refactor(rsc-mf): use TypeScript AST for callback edge detection
cursoragent Feb 14, 2026
d7b4139
docs(rsc-mf): document AST-based callback edge detection rationale
cursoragent Feb 14, 2026
edbbd3f
test(rsc-mf): cover import-equals and import-type callback inference
cursoragent Feb 14, 2026
438da69
fix(rsc-mf): ignore type-only import-equals callback edges
cursoragent Feb 14, 2026
7410cb8
feat(rsc-mf): auto-resolve remote public paths from federation state
cursoragent Feb 14, 2026
fc5e851
refactor(rsc-mf): generalize remote publicPath runtime resolution
cursoragent Feb 14, 2026
1a291c7
test(rsc-mf): cover federation remotes-array and ssr-only path fallbacks
cursoragent Feb 14, 2026
56679b4
refactor(rsc-mf): remove host fallback middleware layer
cursoragent Feb 14, 2026
84938fb
refactor(rsc-mf): delete all fallback and proxy utilities
cursoragent Feb 14, 2026
112bbec
chore(mf): vendor modern-js-v3 plugin into workspace
cursoragent Feb 14, 2026
75e72d9
refactor(rsc-mf): remove callback pathname normalization helper
cursoragent Feb 14, 2026
43b56b3
Merge remote-tracking branch 'origin/main' into cursor/module-federat…
ScriptedAlchemy Feb 14, 2026
fd6180e
chore: update pnpm-lock.yaml after merge with origin/main
ScriptedAlchemy Feb 14, 2026
b5c40da
feat(modernjs-v3): add plugin-first RSC MF bridge runtime
ScriptedAlchemy Feb 16, 2026
45bd1f8
feat(modernjs-v3): finalize plugin-first MF+RSC bridge flow
ScriptedAlchemy Feb 16, 2026
3f4bcb6
fix(ci): sync pnpm lockfile with @types/react specifiers
ScriptedAlchemy Feb 16, 2026
a64ce9e
refactor(rsc-mf): isolate MF runtime hooks from core
ScriptedAlchemy Feb 17, 2026
494d849
fix(modernjs-v3): guard remote external URL rewrite
ScriptedAlchemy Feb 18, 2026
23160ec
Merge pull request #2 from ScriptedAlchemy/cursor/module-federation-r…
ScriptedAlchemy Feb 18, 2026
de599db
fix(rsc-mf): harden callback routing and target config patching
cursoragent Feb 18, 2026
27af5a7
fix(rsc-mf): harden action fallback and static headers
ScriptedAlchemy Feb 18, 2026
b5f6763
fix(rsc-mf): harden static path and bridge load dedupe
ScriptedAlchemy Feb 18, 2026
66d692f
test(modernjs-v3): include config contract in rstest suite
cursoragent Feb 18, 2026
69eb929
chore(ci): trigger workflow rerun
cursoragent Feb 18, 2026
6180082
fix(ci): resolve lint regressions in rsc-mf changes
cursoragent Feb 18, 2026
c3edf41
test(builder): refresh snapshots after rsc-mf config updates
cursoragent Feb 18, 2026
cf44bf9
test(e2e): align inline-chunk runtime assertions
cursoragent Feb 18, 2026
7642d35
test(e2e): update inline chunk html runtime expectations
cursoragent Feb 18, 2026
8558ccb
fix(rsc-mf): update bridge runtime and test coverage
ScriptedAlchemy Feb 18, 2026
3f4e4d5
fix: harden rsc bridge alias resolution and bundle path checks
cursoragent Feb 18, 2026
c196826
test: format fallback alias runtime guard assertion
cursoragent Feb 18, 2026
22094ea
fix: harden mf rsc bundle loading and runtime hooks
ScriptedAlchemy Feb 18, 2026
52489bf
fix: align callServer window access and avoid global strategy state
ScriptedAlchemy Feb 18, 2026
27bb4e0
chore(rsc-mf): refresh federation canary pins and fixture contracts
ScriptedAlchemy Feb 22, 2026
5683fbe
chore(ci): ignore rsc-mf canary fixture paths in dependency consisten…
ScriptedAlchemy Feb 22, 2026
3a909b7
chore(rsc-mf): remove vendored modernjs-v3 package and keep canary us…
ScriptedAlchemy Feb 23, 2026
9a8776a
Merge branch 'main' of https://github.com/web-infra-dev/modern.js int…
ScriptedAlchemy Feb 24, 2026
ae121f9
fix(ci): sync pnpm lockfile after upstream main merge
ScriptedAlchemy Feb 24, 2026
d5dea8d
chore: commit local package.json change before sync
ScriptedAlchemy Feb 25, 2026
98de3a5
fix(rsc): wrap resolver errors and align inline-chunk hidden-source-m…
ScriptedAlchemy Feb 25, 2026
7b39938
fix(server-core): fallback to strategy on sync bundle load errors
ScriptedAlchemy Feb 25, 2026
6c1c8ea
fix(rsc): harden action URL resolution and test isolation
ScriptedAlchemy Feb 26, 2026
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
310 changes: 310 additions & 0 deletions RSC_MODULE_FEDERATION_OVERVIEW.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,310 @@
# Module Federation + RSC Technical Specification (Current Branch)

This document describes how Module Federation + React Server Components (RSC)
works in this branch based on actual implementation.

Primary implementation paths:
- `packages/modernjs-v3/src/cli/index.ts`
- `packages/modernjs-v3/src/cli/configPlugin.ts`
- `packages/modernjs-v3/src/cli/ssrPlugin.ts`
- `packages/modernjs-v3/src/cli/mfRuntimePlugins/*`
- `packages/modernjs-v3/src/runtime/rsc-bridge-expose.ts`
- `packages/modernjs-v3/src/runtime/rsc-client-callback-bootstrap.js`
- `packages/runtime/render/src/client/callServer.ts`
- `packages/runtime/render/src/server/rsc/rsc.tsx`
- `packages/server/core/src/adapters/node/plugins/resource.ts`
- `packages/modernjs-v3/src/server/*`
- `tests/integration/rsc-mf/*`

## 1) Runtime Components and Responsibilities

The system has four cooperating parts:

1. Config/build patching
- Implemented by `moduleFederationConfigPlugin` and `moduleFederationSSRPlugin`.
- Converts user MF config into CSR/SSR target-specific configs and runtime plugin stacks.

2. Host runtime bridge
- Implemented by `rsc-bridge-runtime-plugin`.
- Loads the remote bridge expose, merges manifest metadata into host runtime manifest,
and creates proxy action modules.

3. Remote runtime bridge
- Implemented by `rsc-bridge-expose`.
- Exposes `{ getManifest, executeAction }` so host can discover and execute remote actions.

4. Client/server action transport
- Client: `callServer.ts` plus callback bootstrap resolver.
- Server: `rsc.tsx` action endpoint (`x-rsc-action` based dispatch).

## 2) Build-Time Specification

### 2.1 Plugin entry wiring

`moduleFederationPlugin` in `packages/modernjs-v3/src/cli/index.ts`:
- Initializes shared mutable plugin options (`csrConfig`, `ssrConfig`, plugin refs).
- Registers browser MF plugin on web target.
- Registers server runtime plugin `@module-federation/modern-js-v3/server`.
- Chains:
- `moduleFederationConfigPlugin(...)`
- `moduleFederationSSRPlugin(...)`

### 2.2 Config loading and cloning

`getMFConfig` in `configPlugin.ts`:
- Source precedence:
1. `userConfig.config` if provided.
2. else `module-federation.config.ts` from project root.
- Uses `jiti` with ESM resolve enabled.

`moduleFederationConfigPlugin`:
- Creates isolated CSR and SSR copies of MF config (`csrConfig`, `ssrConfig`).
- Applies target-specific patching per bundler chain target (`web` vs non-web).

### 2.3 Required contracts and enforced invariants

In `patchMFConfig` and `assertRscMfConfig`:
- `mfConfig.name` is required, otherwise throws.
- If `experiments.rsc === true`, then:
- `experiments.asyncStartup` must be `true`.
- server runtime plugin list must include `@module-federation/node/runtimePlugin`.
- Default `remoteType` becomes `'script'` when unset.

### 2.4 Runtime plugin injection rules

`patchMFConfig` injects:
- Always:
- `@module-federation/modern-js-v3/shared-strategy`
- SSR + dev only:
- `@module-federation/modern-js-v3/resolve-entry-ipv4`
- RSC enabled and remotes present:
- `rsc-bridge-runtime-plugin` (resolved local/esm/cjs path)
- Server target only:
- `@module-federation/node/runtimePlugin`
- `@module-federation/node/record-dynamic-remote-entry-hash-plugin` (dev only)
- `@module-federation/modern-js-v3/inject-node-fetch`

### 2.5 RSC expose normalization

`setRscExposeConfig` in `configPlugin.ts`:
- For each user expose (except internal bridge expose):
- Prepends `RSC_CLIENT_CALLBACK_BOOTSTRAP_MODULE` to expose import list.
- Sets `layer = 'react-server-components'`.
- Ensures internal expose exists:
- `./__rspack_rsc_bridge__ -> rsc-bridge-expose` module, same RSC layer.

### 2.6 Dev server and source defaults

`moduleFederationConfigPlugin` config output:
- Sets `REMOTE_IP_STRATEGY` define always.
- Sets `FEDERATION_IPV4` define in SSR dev mode.
- When exposes exist, adds wildcard CORS headers for dev server.
- Sets `source.enableAsyncEntry` to:
- explicit user value if provided
- else `!enableRsc` fallback

## 3) Server-Side Loading and Static Asset Support

### 3.1 Strategy-based bundle loading in server-core

`packages/server/core/src/adapters/node/plugins/resource.ts`:
- Introduces strategy registry:
- `registerBundleLoaderStrategy`
- `getBundleLoaderStrategies`
- `loadBundle(filepath)` algorithm:
1. `require` / `compatibleRequire`
2. if immediate non-promise export: return
3. if promise export: await once
4. if unresolved/error: iterate registered strategies
5. if still unresolved: log and return `undefined`

### 3.2 Async-startup loader strategy

`packages/modernjs-v3/src/server/asyncStartupLoader.ts`:
- Detects async-startup signature:
- `var __webpack_exports__ = __webpack_require__.x();`
- and `__webpack_require__.mfAsyncStartup`
- Rewrites call to:
- `__webpack_require__.x({}, [])`
- Executes patched bundle in VM context and returns exports.

### 3.3 Server plugin registration

`packages/modernjs-v3/src/server/index.ts`:
- Registers `mfAsyncStartupLoaderStrategy` globally into server-core loader registry.
- In production:
- adds static middleware serving only `/bundles/*.js|.json`
- Optional:
- adds wildcard CORS middleware when `MODERN_MF_AUTO_CORS` is set.

## 4) RSC Bridge Protocol

### 4.1 Internal bridge expose

Remote exposes:
- Key: `./__rspack_rsc_bridge__`
- Interface:
- `getManifest(): ManifestLike`
- `executeAction(actionId: string, args: unknown[]): Promise<unknown>`

`ManifestLike` shape:
- `serverManifest?: Record<string, any>`
- `clientManifest?: Record<string, any>`
- `serverConsumerModuleMap?: Record<string, any>`

### 4.2 Host merge behavior

In `rsc-bridge-runtime-plugin.ts`, `ensureRemoteAliasMerged(alias, args)`:
1. Ensure single in-flight merge per alias via `aliasMergePromises`.
2. Install proxy module ID:
- `__modernjs_mf_rsc_action_proxy__:<alias>`
3. Load remote bridge:
- `${alias}/__rspack_rsc_bridge__`
4. Read remote manifest and merge into host `__webpack_require__.rscM`.
5. Track alias as merged (`mergedRemoteAliases`).

### 4.3 ID namespacing and mapping

Module ID namespace:
- `remote-module:<alias>:<rawModuleId>`

Action ID namespace:
- `remote:<alias>:<rawActionId>`

Why these are different namespaces:
- `remote-module:*` is used for module identity inside `clientManifest` and
`serverConsumerModuleMap` (module graph identity).
- `remote:*` is used for server action references in `serverManifest` and
request header `x-rsc-action` (action invocation identity).
- Keeping them distinct avoids conflating module resolution IDs with action
dispatch IDs, even when both originate from the same remote alias.

Action remap map:
- global key: `__MODERN_RSC_MF_ACTION_ID_MAP__`
- semantics:
- `rawActionId -> remote:<alias>:rawActionId` when unique
- `rawActionId -> false` when collision across remotes is detected

Conflict policy:
- `assertNoConflict` throws if two remotes produce different payloads for same manifest key.

## 5) Client Action Dispatch Specification

### 5.1 Core call path

`packages/runtime/render/src/client/callServer.ts`:
- `requestCallServer(id, args)`:
- resolves action ID through global resolver key `__MODERN_RSC_ACTION_RESOLVER__`
- endpoint:
- `'/'` for `main`/`index`/missing entry
- else `/${window.__MODERN_JS_ENTRY_NAME}`
- request:
- `method: POST`
- header `Accept: text/x-component`
- header `x-rsc-action: <resolved-action-id>`
- body `encodeReply(args)`

Branch history note:
- This resolver indirection is new on this branch.
- On `main`, `callServer` sent the incoming action ID directly in
`x-rsc-action` with no global remap hook.

### 5.2 Bootstrap resolver and callback install

`rsc-client-callback-bootstrap.js`:
- Calls `setResolveActionId(resolveActionId)` once.
- Repeatedly installs `setServerCallback` into discovered client.browser runtimes.
- Hooks webpack chunk loader (`__webpack_require__.e`) to re-install callbacks after late chunk loads.

Branch history note:
- `rsc-client-callback-bootstrap.js` and the chunk-loader hook are added on this
branch (not present on `main`).
- The hook is a runtime compatibility workaround to catch callbacks loaded after
initial bootstrap. A cleaner long-term option would be a first-class runtime
lifecycle event from federation/runtime instead of patching `__webpack_require__.e`.

`resolveActionId(id)` behavior:
1. If already prefixed (`remote:`), return as-is.
2. If remap entry is string, return mapped prefixed ID.
3. If remap entry is `false`, return raw ID.
4. Else:
- attempts fallback alias resolution when a single remote alias can be inferred,
- otherwise waits briefly on remap waiters map.

## 6) Server Action Execution Specification

`packages/runtime/render/src/server/rsc/rsc.tsx`:
- Reads header `x-rsc-action`.
- Loads action via `loadServerAction(serverReference)`.
- Decodes args:
- `multipart/form-data` -> `decodeReply(formData)`
- else text -> `decodeReply(text)`
- Executes action (`await Promise.resolve(action.apply(null, args))`).
- Renders response stream via `renderToReadableStream`.

Error behavior:
- Missing action header: `404`.
- Decode failure: `400`.
- Execution failure: `500`.
- In development, `500` includes error message/stack in body.

## 7) SSR Remote Entry URL Normalization

In `rsc-bridge-runtime-plugin.ts`:
- Snapshot patching normalizes:
- `ssrPublicPath`
- `remoteEntry.path`
- `ssrRemoteEntry` fallbacks from snapshot metadata
- If remote entry is broken (`undefined`, empty, malformed), plugin attempts to reconstruct from snapshot fields.
- Node-like runtime branch may prefix entry path with `bundles/` when `ssrRemoteEntry` is missing.

Recommendation:
- Preferred steady-state is to require a complete snapshot contract (non-undefined
`ssrRemoteEntry`/public path fields) from upstream runtime metadata.
- Current reconstruction logic exists for compatibility with incomplete snapshots
seen in practice; it should be reduced/removed once snapshot completeness is guaranteed.

## 8) Fixture Specification (`tests/integration/rsc-mf`)

Host config (`tests/integration/rsc-mf/host`):
- `server.rsc = true`
- `source.enableAsyncEntry = false`
- `moduleFederationPlugin({ ssr: true })`
- remote manifest URL uses `RSC_MF_REMOTE_PORT` and points to `/static/mf-manifest.json`

Remote config (`tests/integration/rsc-mf/remote`):
- `server.rsc = true`
- `server.ssr = true`
- `source.enableAsyncEntry = false`
- `output.assetPrefix = http://127.0.0.1:${remotePort}`
- MF exposes include server/client components + actions.
- MF experiments include:
- `asyncStartup: true`
- `rsc: true`

Tested contracts:
- Remote server components render in host RSC route.
- Remote client components hydrate and function in host page.
- Remote actions execute via host endpoint and carry expected action headers.
- Expose list includes user exposes plus `./__rspack_rsc_bridge__`.

## 9) Known Caveats (Current State)

1. Fallback alias auto-prefixing
- In the bootstrap resolver, unresolved raw IDs may be auto-prefixed to a fallback alias when one remote is detectable.
- This can misroute host-local actions in mixed host+remote pages.

2. Double `bundles/` risk
- SSR entry normalization can build `.../bundles/bundles/...` URLs for certain snapshot/publicPath combinations.

3. Collision path with `false` remap values
- On raw action ID collisions across remotes, remap map stores `false`.
- Resolver then sends raw ID, while host manifest action keys are namespaced (`remote:<alias>:...`), causing unresolved lookup without explicit disambiguation.

## 10) Practical Integration Rules

Use these rules to avoid known failure modes:
- Always set `experiments.asyncStartup = true` when using `experiments.rsc = true`.
- Keep unique action IDs across remotes when possible.
- Keep remote snapshot fields complete (`publicPath` and remote entry metadata) in SSR.
- For fixture-like setups, keep `source.enableAsyncEntry = false` for host and remote until async-entry semantics are explicitly validated for your target.
36 changes: 35 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,26 @@
"read-yaml-file>js-yaml": "3.14.2",
"@remix-run/router": ">=1.23.2",
"h3": ">=1.15.5",
"@rspack/core@2.0.0-beta.2": "npm:@rspack-canary/core@2.0.0-canary-032bd1ff-20260212021235",
"@module-federation/bridge-react": "https://pkg.pr.new/module-federation/core/@module-federation/bridge-react@c160c7ae3246c65fa50f19d966b8acd32448580a",
"@module-federation/bridge-react-webpack-plugin": "https://pkg.pr.new/module-federation/core/@module-federation/bridge-react-webpack-plugin@c160c7ae3246c65fa50f19d966b8acd32448580a",
"@module-federation/bridge-shared": "https://pkg.pr.new/module-federation/core/@module-federation/bridge-shared@c160c7ae3246c65fa50f19d966b8acd32448580a",
"@module-federation/cli": "https://pkg.pr.new/module-federation/core/@module-federation/cli@c160c7ae3246c65fa50f19d966b8acd32448580a",
"@module-federation/data-prefetch": "https://pkg.pr.new/module-federation/core/@module-federation/data-prefetch@c160c7ae3246c65fa50f19d966b8acd32448580a",
"@module-federation/dts-plugin": "https://pkg.pr.new/module-federation/core/@module-federation/dts-plugin@c160c7ae3246c65fa50f19d966b8acd32448580a",
"@module-federation/enhanced": "https://pkg.pr.new/module-federation/core/@module-federation/enhanced@c160c7ae3246c65fa50f19d966b8acd32448580a",
"@module-federation/error-codes": "https://pkg.pr.new/module-federation/core/@module-federation/error-codes@c160c7ae3246c65fa50f19d966b8acd32448580a",
"@module-federation/inject-external-runtime-core-plugin": "https://pkg.pr.new/module-federation/core/@module-federation/inject-external-runtime-core-plugin@c160c7ae3246c65fa50f19d966b8acd32448580a",
"@module-federation/managers": "https://pkg.pr.new/module-federation/core/@module-federation/managers@c160c7ae3246c65fa50f19d966b8acd32448580a",
"@module-federation/manifest": "https://pkg.pr.new/module-federation/core/@module-federation/manifest@c160c7ae3246c65fa50f19d966b8acd32448580a",
"@module-federation/rsbuild-plugin": "https://pkg.pr.new/module-federation/core/@module-federation/rsbuild-plugin@c160c7ae3246c65fa50f19d966b8acd32448580a",
"@module-federation/rspack": "https://pkg.pr.new/module-federation/core/@module-federation/rspack@c160c7ae3246c65fa50f19d966b8acd32448580a",
"@module-federation/runtime": "https://pkg.pr.new/module-federation/core/@module-federation/runtime@c160c7ae3246c65fa50f19d966b8acd32448580a",
"@module-federation/runtime-core": "https://pkg.pr.new/module-federation/core/@module-federation/runtime-core@c160c7ae3246c65fa50f19d966b8acd32448580a",
"@module-federation/runtime-tools": "https://pkg.pr.new/module-federation/core/@module-federation/runtime-tools@c160c7ae3246c65fa50f19d966b8acd32448580a",
"@module-federation/sdk": "https://pkg.pr.new/module-federation/core/@module-federation/sdk@c160c7ae3246c65fa50f19d966b8acd32448580a",
"@module-federation/third-party-dts-extractor": "https://pkg.pr.new/module-federation/core/@module-federation/third-party-dts-extractor@c160c7ae3246c65fa50f19d966b8acd32448580a",
"@module-federation/webpack-bundler-runtime": "https://pkg.pr.new/module-federation/core/@module-federation/webpack-bundler-runtime@c160c7ae3246c65fa50f19d966b8acd32448580a",
"tar": ">=7.5.4",
"diff": ">=4.0.4",
"debug": ">=4.4.3",
Expand Down Expand Up @@ -116,6 +136,20 @@
"debug": "4.1.1",
"uuid": "3.4.0",
"trim": "0.0.1"
}
},
"onlyBuiltDependencies": [
"@biomejs/biome",
"@parcel/watcher",
"@swc/core",
"bufferutil",
"core-js",
"es5-ext",
"esbuild",
"less",
"nx",
"puppeteer",
"sharp",
"utf-8-validate"
]
}
}
Loading