fix: stop the build-time FederationManifest shadowing the runtime one - #136
Merged
Merged
Conversation
`export * from "@softarc/native-federation/domain"` re-exports the core's build-time FederationManifest, which won over the orchestrator's at the public boundary. Consumers got a shape with an extra `main` field that initFederation() ignores. Re-export the orchestrator's explicitly so it shadows the star-export, completing 722e88a on the consumer-facing side. Also export FederationConfig from ./config, next to the withNativeFederation that takes it -- it previously only reached users through the runtime root entry.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
src/index.tsopens withexport * from "@softarc/native-federation/domain". That barrel is the core's build-time contract surface, and it includes aFederationManifestthat won over the orchestrator's at the public boundary:So the published type advertised a
mainfield thatinitFederation()ignores — nothing in the core reads it in a manifest context either. 722e88a fixed this for the internal import; the star-export still shadowed it on the consumer-facing side. This re-exports the orchestrator's explicitly so the explicit export wins.Second,
./configexportswithNativeFederation(cfg: FederationConfig)but notFederationConfigitself, so anyone typing theirfederation.config.jsobject had to reach for the runtime root entry. Now it sits next to the function that takes it.Non-breaking
Nothing removed. The manifest swap only narrows an object type by an optional field that never did anything, so existing consumer code still compiles.
Verification
tsc --noEmitclean,knipclean, lint 0 errors (34 pre-existing warnings in unrelated files)@ts-expect-erroron a manifest entry carryingmain: tsc consumed the directive rather than flagging it unused, confirming the orchestrator's shape now wins at the boundaryDeliberately left for the next major
Both are breaking, so not in this PR:
Imports/Scopes/ImportMap(src/index.ts) are dead — byte-identical copies of the orchestrator's internalimport-map.contract, used nowhere insrc/and absent from the README. Leftovers from when the adapter built import maps itself.FederationInfo,SharedInfo,DenseSharedInfo,ExposesInfo,ChunkInfo,IntegrityMap) are runtime-relevant — the orchestrator imports those itself. The other ~24 are build-time contracts on the entry point an app'smain.tsimports.