@appshell/webpack-plugin 1.0.0-alpha.71 → 1.0.0-alpha.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,7 +17,6 @@ export declare const manifestFrom: <TMetadata extends Record<string, unknown>>(t
17
17
  components: Record<string, import("./types").PublishedRemote<TMetadata>>;
18
18
  remotes?: string[];
19
19
  shared?: import("./types").SharedContract;
20
- bundle?: import("./types").BundleDigest;
21
20
  tokens?: Record<string, import("./types").AppshellTokenUsage>;
22
21
  overrides?: import("./types").AppshellOverrides;
23
22
  };
@@ -31,7 +30,6 @@ declare const _default: <TMetadata extends Record<string, unknown>>(templatePath
31
30
  components: Record<string, import("./types").PublishedRemote<TMetadata>>;
32
31
  remotes?: string[];
33
32
  shared?: import("./types").SharedContract;
34
- bundle?: import("./types").BundleDigest;
35
33
  tokens?: Record<string, import("./types").AppshellTokenUsage>;
36
34
  overrides?: import("./types").AppshellOverrides;
37
35
  } | null>;
@@ -7,6 +7,7 @@ export type { AppshellContext } from './context';
7
7
  export { clearCredential, credentialsPath, resolveToken, saveCredential } from './credentials';
8
8
  export type { Credential } from './credentials';
9
9
  export { default as generateManifest, manifestFrom } from './generate.manifest';
10
+ export { loaderOf } from './loader';
10
11
  export { default as outdated } from './outdated';
11
12
  export { activate, openOverlay, publish } from './publish';
12
13
  export type { OpenedOverlay, OverlayRemotePatch, PublishOptions, PublishResult } from './publish';
@@ -0,0 +1,18 @@
1
+ import { ModuleFederationLoader } from './types';
2
+ /**
3
+ * How to load one component, derived from the Module Federation config that emits it.
4
+ *
5
+ * One definition, used twice: the manifest a publish stores, and the patch an overlay
6
+ * sends. Those describe the same thing from either side of a publish, and two copies of
7
+ * the derivation would disagree the moment one of them changed — the drift being that an
8
+ * overlay addresses a dev server's bundle by a container name the build no longer uses,
9
+ * which surfaces as module federation failing to find a container rather than as anything
10
+ * naming the cause.
11
+ *
12
+ * The federation fields sit under a kind rather than at the top level, so they read as one
13
+ * framework's vocabulary rather than as something generic.
14
+ */
15
+ export declare const loaderOf: (module: {
16
+ shareScope?: string;
17
+ filename?: string;
18
+ }, federationKey: string) => ModuleFederationLoader;
@@ -4,7 +4,6 @@ export declare const toAppshellManifest: <TMetadata extends Record<string, unkno
4
4
  components: Record<string, PublishedRemote<TMetadata>>;
5
5
  remotes?: string[];
6
6
  shared?: SharedContract;
7
- bundle?: import("../types").BundleDigest;
8
7
  tokens?: Record<string, import("../types").AppshellTokenUsage>;
9
8
  overrides?: import("../types").AppshellOverrides;
10
9
  };
@@ -1,4 +1,4 @@
1
- import { AppshellManifest, Metadata } from './types';
1
+ import { AppshellManifest, Metadata, ModuleFederationLoader } from './types';
2
2
  export type PublishOptions = {
3
3
  registry: string;
4
4
  token?: string;
@@ -28,10 +28,22 @@ export declare const publish: ({ registry, token, name, version, manifest, visib
28
28
  * @param application `scope/name`
29
29
  */
30
30
  export declare const activate: (registry: string, application: string, packageId: string, token?: string) => Promise<void>;
31
- /** What an overlay redirects a single remote to. */
31
+ /** What an overlay redirects a single remote to, or introduces one as. */
32
32
  export type OverlayRemotePatch = {
33
33
  remoteEntryUrl: string;
34
34
  manifestUrl?: string;
35
+ /**
36
+ * How to load this build's copy, from the Module Federation config that emits it.
37
+ *
38
+ * Sent because the loader describes the code being loaded, and an overlay points at
39
+ * this build rather than the published one. Without it a redirect addresses a dev
40
+ * server's bundle by whatever container name the last publish happened to have, so
41
+ * renaming the container locally resolves to a container the browser cannot find.
42
+ *
43
+ * It is also what lets an overlay introduce a component that is not published yet: a
44
+ * redirect inherits the published loader, an addition has no published anything.
45
+ */
46
+ loader?: ModuleFederationLoader;
35
47
  /**
36
48
  * The remote's `metadata` as this build declares it.
37
49
  *
@@ -120,11 +120,6 @@ export type AppshellConfig<TMetadata = Metadata> = {
120
120
  };
121
121
  export type AppshellTemplate<TMetadata = Metadata> = {
122
122
  name?: string;
123
- /**
124
- * Digest of everything the build emitted, computed during the compilation. On the
125
- * template rather than in the yaml because only the build knows it.
126
- */
127
- bundle?: BundleDigest;
128
123
  /** Carried from the yaml for publish to read; never mapped into the manifest. */
129
124
  visibility?: 'public' | 'private';
130
125
  components?: Record<string, AppshellConfigRemote<TMetadata>>;
@@ -169,24 +164,6 @@ export type AppshellTokenUsage = {
169
164
  required: string[];
170
165
  optional: string[];
171
166
  };
172
- /**
173
- * A digest of the bytes a package emitted, so its identity covers its code.
174
- *
175
- * Without it a manifest describes a bundle it cannot vouch for. The addresses a package
176
- * asks the registry for live in its source, not in anything it declares — so an edit that
177
- * changed which remotes it loads left the manifest byte-identical, and republishing the
178
- * changed build was a no-op rather than a version conflict. Two builds that differ
179
- * anywhere are now different packages.
180
- *
181
- * Over every emitted asset rather than the entry alone. The entry does change whenever a
182
- * chunk does — but only where chunk filenames carry a content hash, which is a convention
183
- * a project may not follow and nothing here can enforce.
184
- */
185
- export type BundleDigest = {
186
- algorithm: 'sha384';
187
- /** Base64, over each asset's name and bytes in sorted order. */
188
- digest: string;
189
- };
190
167
  /** A shared-dependency contract, named as one framework's model among possible models. */
191
168
  export type SharedContract = {
192
169
  apiVersion: 'federation.appshell.org/v1';
@@ -209,8 +186,6 @@ export type AppshellManifest<TMetadata = Metadata> = {
209
186
  * type-generation flags sat inside the package digest.
210
187
  */
211
188
  shared?: SharedContract;
212
- /** What this package's code hashes to; absent when built outside a compilation. */
213
- bundle?: BundleDigest;
214
189
  vars: Record<string, Record<string, string | number | undefined>>;
215
190
  /** Keyed by federation scope, so a merged manifest still says which package needs what. */
216
191
  tokens?: Record<string, AppshellTokenUsage>;
@@ -262,6 +237,16 @@ export type AppshellComposition<TMetadata = Metadata> = {
262
237
  overlay?: {
263
238
  id: string;
264
239
  remotes: string[];
240
+ /**
241
+ * Those of `remotes` the overlay introduced rather than redirected — components the
242
+ * application does not publish, running for this developer and nobody else.
243
+ *
244
+ * Separate from `remotes` because the two are not the same claim. A redirected
245
+ * component exists for everyone and this browser runs a different copy of it; an
246
+ * added one does not exist outside this overlay at all, so a feature built on top of
247
+ * one works here and is absent everywhere else.
248
+ */
249
+ added?: string[];
265
250
  shellFlavor: 'prod' | 'dev';
266
251
  theme?: string;
267
252
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appshell/webpack-plugin",
3
- "version": "1.0.0-alpha.71",
3
+ "version": "1.0.0-alpha.73",
4
4
  "description": "Webpack plugin used to generate a global Appshell configuration for micro-frontends built with Module Federation",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/types/webpack-plugin/src/index.d.ts",
@@ -33,8 +33,8 @@
33
33
  "plugin"
34
34
  ],
35
35
  "license": "MIT",
36
- "gitHead": "2605aafa8f54460c6c05c175f657ef0a830570ab",
36
+ "gitHead": "00740825a81e453566a3333d8253afc6a9744310",
37
37
  "dependencies": {
38
- "@appshell/tokens": "^1.0.0-alpha.71"
38
+ "@appshell/tokens": "^1.0.0-alpha.73"
39
39
  }
40
40
  }