@appshell/loader 1.0.0-alpha.14 → 1.0.0-alpha.17

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.
Files changed (87) hide show
  1. package/README.md +19 -21
  2. package/dist/main.js +1 -1
  3. package/dist/types/config/src/axios.d.ts +0 -1
  4. package/dist/types/config/src/configmap.d.ts +0 -1
  5. package/dist/types/config/src/context.d.ts +3 -4
  6. package/dist/types/config/src/credentials.d.ts +0 -2
  7. package/dist/types/config/src/generate.manifest.d.ts +0 -1
  8. package/dist/types/config/src/index.d.ts +2 -7
  9. package/dist/types/config/src/mappers/appshell.config.d.ts +0 -1
  10. package/dist/types/config/src/outdated.d.ts +0 -1
  11. package/dist/types/config/src/publish.d.ts +3 -4
  12. package/dist/types/config/src/sync.d.ts +0 -1
  13. package/dist/types/config/src/types.d.ts +9 -15
  14. package/dist/types/config/src/utils/blur.d.ts +0 -1
  15. package/dist/types/config/src/utils/compare.d.ts +0 -1
  16. package/dist/types/config/src/utils/config.d.ts +0 -1
  17. package/dist/types/config/src/utils/copy.d.ts +0 -1
  18. package/dist/types/config/src/utils/index.d.ts +0 -4
  19. package/dist/types/config/src/utils/list.d.ts +0 -1
  20. package/dist/types/config/src/utils/load.d.ts +0 -1
  21. package/dist/types/config/src/validators/AppshellTemplateValidator.d.ts +0 -1
  22. package/dist/types/config/src/validators/index.d.ts +0 -3
  23. package/dist/types/loader/src/index.d.ts +0 -1
  24. package/dist/types/loader/src/loadAppshellComponent.d.ts +0 -1
  25. package/dist/types/loader/src/remoteLoader.d.ts +2 -4
  26. package/dist/types/loader/src/resolvers.d.ts +4 -12
  27. package/dist/types/loader/src/types.d.ts +0 -1
  28. package/dist/types/runtime/src/errors.d.ts +25 -0
  29. package/dist/types/runtime/src/index.d.ts +3 -0
  30. package/dist/types/runtime/src/store.d.ts +25 -0
  31. package/dist/types/runtime/src/types.d.ts +9 -0
  32. package/package.json +10 -3
  33. package/CHANGELOG.md +0 -227
  34. package/__tests__/fixtures/TestComponent.ts +0 -3
  35. package/__tests__/loadAppshellComponent.spec.ts +0 -68
  36. package/__tests__/remoteLoader.spec.ts +0 -120
  37. package/__tests__/resolvers.spec.ts +0 -128
  38. package/dist/types/config/src/axios.d.ts.map +0 -1
  39. package/dist/types/config/src/configmap.d.ts.map +0 -1
  40. package/dist/types/config/src/context.d.ts.map +0 -1
  41. package/dist/types/config/src/credentials.d.ts.map +0 -1
  42. package/dist/types/config/src/deregister.d.ts +0 -3
  43. package/dist/types/config/src/deregister.d.ts.map +0 -1
  44. package/dist/types/config/src/generate.env.d.ts +0 -3
  45. package/dist/types/config/src/generate.env.d.ts.map +0 -1
  46. package/dist/types/config/src/generate.global-config.d.ts +0 -10
  47. package/dist/types/config/src/generate.global-config.d.ts.map +0 -1
  48. package/dist/types/config/src/generate.manifest.d.ts.map +0 -1
  49. package/dist/types/config/src/index.d.ts.map +0 -1
  50. package/dist/types/config/src/mappers/appshell.config.d.ts.map +0 -1
  51. package/dist/types/config/src/outdated.d.ts.map +0 -1
  52. package/dist/types/config/src/publish.d.ts.map +0 -1
  53. package/dist/types/config/src/register.d.ts +0 -4
  54. package/dist/types/config/src/register.d.ts.map +0 -1
  55. package/dist/types/config/src/sync.d.ts.map +0 -1
  56. package/dist/types/config/src/types.d.ts.map +0 -1
  57. package/dist/types/config/src/utils/blur.d.ts.map +0 -1
  58. package/dist/types/config/src/utils/compare.d.ts.map +0 -1
  59. package/dist/types/config/src/utils/config.d.ts.map +0 -1
  60. package/dist/types/config/src/utils/copy.d.ts.map +0 -1
  61. package/dist/types/config/src/utils/index.d.ts.map +0 -1
  62. package/dist/types/config/src/utils/isValidUrl.d.ts +0 -3
  63. package/dist/types/config/src/utils/isValidUrl.d.ts.map +0 -1
  64. package/dist/types/config/src/utils/list.d.ts.map +0 -1
  65. package/dist/types/config/src/utils/load.d.ts.map +0 -1
  66. package/dist/types/config/src/utils/loadJson.d.ts +0 -10
  67. package/dist/types/config/src/utils/loadJson.d.ts.map +0 -1
  68. package/dist/types/config/src/utils/merge.d.ts +0 -4
  69. package/dist/types/config/src/utils/merge.d.ts.map +0 -1
  70. package/dist/types/config/src/validators/AppshellGlobalConfigValidator.d.ts +0 -4
  71. package/dist/types/config/src/validators/AppshellGlobalConfigValidator.d.ts.map +0 -1
  72. package/dist/types/config/src/validators/AppshellManifestValidator.d.ts +0 -4
  73. package/dist/types/config/src/validators/AppshellManifestValidator.d.ts.map +0 -1
  74. package/dist/types/config/src/validators/AppshellTemplateValidator.d.ts.map +0 -1
  75. package/dist/types/config/src/validators/index.d.ts.map +0 -1
  76. package/dist/types/loader/src/index.d.ts.map +0 -1
  77. package/dist/types/loader/src/loadAppshellComponent.d.ts.map +0 -1
  78. package/dist/types/loader/src/remoteLoader.d.ts.map +0 -1
  79. package/dist/types/loader/src/resolvers.d.ts.map +0 -1
  80. package/dist/types/loader/src/types.d.ts.map +0 -1
  81. package/src/index.ts +0 -7
  82. package/src/loadAppshellComponent.ts +0 -66
  83. package/src/remoteLoader.ts +0 -69
  84. package/src/resolvers.ts +0 -110
  85. package/src/types.ts +0 -10
  86. package/tsconfig.json +0 -7
  87. package/webpack.config.js +0 -37
@@ -46,7 +46,7 @@ export type ComparisonTarget = {
46
46
  export type CliConfig = Record<string, string> & {
47
47
  apiKey: string;
48
48
  registry: string;
49
- environment: string;
49
+ application: string;
50
50
  scopeId: string;
51
51
  authIssuer: string;
52
52
  clientId: string;
@@ -60,14 +60,14 @@ export type AppshellConfigRemote<TMetadata = Metadata> = {
60
60
  export type AppshellConfig<TMetadata = Metadata> = {
61
61
  name?: string;
62
62
  remotes?: Record<string, AppshellConfigRemote<TMetadata>>;
63
- environment?: Record<string, unknown>;
63
+ vars?: Record<string, unknown>;
64
64
  overrides?: AppshellOverrides;
65
65
  };
66
66
  export type AppshellTemplate<TMetadata = Metadata> = {
67
67
  name?: string;
68
68
  remotes?: Record<string, AppshellConfigRemote<TMetadata>>;
69
69
  module: ModuleFederationPluginOptions;
70
- environment?: Record<string, unknown>;
70
+ vars?: Record<string, unknown>;
71
71
  overrides?: AppshellOverrides;
72
72
  };
73
73
  /** Appshell manifest types */
@@ -81,40 +81,35 @@ export type AppshellRemote<TMetadata = Metadata> = {
81
81
  metadata: TMetadata;
82
82
  };
83
83
  export type AppshellOverrides = {
84
- environment: Record<string, Record<string, string | number | undefined>>;
84
+ vars: Record<string, Record<string, string | number | undefined>>;
85
85
  };
86
86
  export type AppshellManifest<TMetadata = Metadata> = {
87
87
  remotes: Record<string, AppshellRemote<TMetadata>>;
88
88
  modules: Record<string, ModuleFederationPluginOptions>;
89
- environment: Record<string, Record<string, string | number | undefined>>;
89
+ vars: Record<string, Record<string, string | number | undefined>>;
90
90
  overrides?: AppshellOverrides;
91
91
  };
92
92
  export type AppshellIndex = Record<string, string>;
93
93
  export type Metadata = Record<string, unknown>;
94
- export type AppshellGlobalConfig<TMetadata = Metadata> = {
95
- index: AppshellIndex;
96
- metadata?: Record<string, TMetadata>;
97
- overrides?: AppshellOverrides;
98
- };
99
94
  /** An `AppshellRemote` the registry already resolved, so the browser needs no manifest fetch. */
100
95
  export type ResolvedRemote<TMetadata = Metadata> = AppshellRemote<TMetadata>;
101
96
  /**
102
97
  * The wire contract for `window.__appshell_config__`. Deliberately not an
103
98
  * `AppshellManifest`: that is a build artifact, and reusing it left it unclear
104
99
  * which fields the browser actually needs. `modules` is build-time webpack
105
- * config and never crosses the wire; `environment` arrives already merged with
106
- * the environment's overrides, leaving the browser only local overrides to apply.
100
+ * config and never crosses the wire; `vars` arrives already merged with the
101
+ * application's overrides, leaving the browser only local overrides to apply.
107
102
  */
108
103
  export type AppshellComposition<TMetadata = Metadata> = {
109
104
  /** `scope/name` — makes the payload self-describing for fetch-on-miss and for `env diff`. */
110
- environmentId: string;
105
+ applicationId: string;
111
106
  revision: number;
112
107
  /** The remote key the host mounts at the root, and the props it is given. */
113
108
  root: string;
114
109
  rootProps: Record<string, unknown>;
115
110
  index: AppshellIndex;
116
111
  remotes: Record<string, ResolvedRemote<TMetadata>>;
117
- environment: Record<string, Record<string, string | number | undefined>>;
112
+ vars: Record<string, Record<string, string | number | undefined>>;
118
113
  /**
119
114
  * Present whenever a per-developer overlay changed anything about this render — a
120
115
  * redirected remote, a different shell bundle, or both. The shell is expected to
@@ -306,4 +301,3 @@ export interface ModuleFederationPluginOptions {
306
301
  */
307
302
  shared?: (string | SharedObject)[] | SharedObject;
308
303
  }
309
- //# sourceMappingURL=types.d.ts.map
@@ -1,3 +1,2 @@
1
1
  declare const _default: (token?: string, chars?: number) => string;
2
2
  export default _default;
3
- //# sourceMappingURL=blur.d.ts.map
@@ -5,4 +5,3 @@ export declare const compareDependencies: (sample: ComparisonTarget, baseline: C
5
5
  export declare const compareSharedDependencies: (packageSpec: PackageSpec, sharedModule: SharedModuleSpec) => ComparisonResults;
6
6
  export declare const compareSharedModules: (sampleSpec: SharedModuleSpec, baselineSpec: SharedModuleSpec) => ComparisonResults;
7
7
  export declare const printResults: (results: ComparisonResults) => void;
8
- //# sourceMappingURL=compare.d.ts.map
@@ -3,4 +3,3 @@ import { CliConfig } from '../types';
3
3
  export declare const readConfig: (configPath: string) => CliConfig;
4
4
  export declare const writeConfig: (configPath: string, config: CliConfig) => void;
5
5
  export declare const mergeConfigWithArgs: (config: CliConfig, argv: yargs.ArgumentsCamelCase<unknown>) => void;
6
- //# sourceMappingURL=config.d.ts.map
@@ -8,4 +8,3 @@ declare const _default: (pattern: {
8
8
  to: string;
9
9
  }) => void;
10
10
  export default _default;
11
- //# sourceMappingURL=copy.d.ts.map
@@ -2,9 +2,5 @@ export { default as blur } from './blur';
2
2
  export { compareDependencies, compareDependency, compareSharedDependencies, compareSharedModules, extractDependencies, printResults, } from './compare';
3
3
  export { mergeConfigWithArgs, readConfig, writeConfig } from './config';
4
4
  export { default as copy } from './copy';
5
- export { default as isValidUrl } from './isValidUrl';
6
5
  export { default as list } from './list';
7
6
  export { default as load, loadAll } from './load';
8
- export { default as loadJson } from './loadJson';
9
- export { default as merge } from './merge';
10
- //# sourceMappingURL=index.d.ts.map
@@ -7,4 +7,3 @@
7
7
  */
8
8
  declare const list: (dirPath: string, depth?: number, target?: string | RegExp) => string[];
9
9
  export default list;
10
- //# sourceMappingURL=list.d.ts.map
@@ -11,4 +11,3 @@ declare const load: <TSchema>(configPath: string) => TSchema;
11
11
  */
12
12
  export declare const loadAll: <TSchema>(...paths: string[]) => TSchema[];
13
13
  export default load;
14
- //# sourceMappingURL=load.d.ts.map
@@ -1,4 +1,3 @@
1
1
  import { ConfigValidator } from '../types';
2
2
  declare const _default: ConfigValidator;
3
3
  export default _default;
4
- //# sourceMappingURL=AppshellTemplateValidator.d.ts.map
@@ -1,4 +1 @@
1
- export { default as AppshellGlobalConfigValidator } from './AppshellGlobalConfigValidator';
2
- export { default as AppshellManifestValidator } from './AppshellManifestValidator';
3
1
  export { default as AppshellTemplateValidator } from './AppshellTemplateValidator';
4
- //# sourceMappingURL=index.d.ts.map
@@ -3,4 +3,3 @@ export type { RemoteLoaderOptions } from './remoteLoader';
3
3
  export * from './resolvers';
4
4
  export * from './types';
5
5
  export default remoteLoader;
6
- //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1,2 @@
1
1
  declare const _default: <TComponent>(scope: string, module: string, remoteEntryUrl: string, shareScope?: string) => Promise<TComponent>;
2
2
  export default _default;
3
- //# sourceMappingURL=loadAppshellComponent.d.ts.map
@@ -1,8 +1,7 @@
1
- import type { AppshellComposition, AppshellGlobalConfig } from '@appshell/config';
1
+ import type { AppshellComposition } from '@appshell/config';
2
2
  import { type RemoteResolver } from './resolvers';
3
3
  declare global {
4
4
  interface Window {
5
- [key: string]: unknown;
6
5
  __appshell_config__?: AppshellComposition;
7
6
  }
8
7
  }
@@ -11,6 +10,5 @@ export type RemoteLoaderOptions = {
11
10
  /** Replaces the resolver chain outright; a seam for tests and embedders. */
12
11
  resolver?: RemoteResolver;
13
12
  };
14
- declare const _default: (config: AppshellGlobalConfig, options?: RemoteLoaderOptions) => <TComponent>(key: string) => Promise<readonly [Awaited<TComponent>, import("@appshell/config").AppshellManifest]>;
13
+ declare const _default: (options?: RemoteLoaderOptions) => <TComponent>(key: string) => Promise<readonly [Awaited<TComponent>, import("@appshell/config").ResolvedRemote]>;
15
14
  export default _default;
16
- //# sourceMappingURL=remoteLoader.d.ts.map
@@ -1,20 +1,12 @@
1
- import type { AppshellComposition, AppshellGlobalConfig, AppshellManifest, ResolvedRemote } from '@appshell/config';
1
+ import type { AppshellComposition, ResolvedRemote } from '@appshell/config';
2
2
  export type RemoteResolution = {
3
3
  remote: ResolvedRemote;
4
- /** Already merged with the environment's overrides — nothing left for the browser to layer on. */
5
- environment: Record<string, string | number | undefined>;
6
- /** Back-compat payload for `ManifestProvider`; synthesized when the source was a composition. */
7
- manifest: AppshellManifest;
4
+ /** Already merged with the application's overrides — nothing left for the browser to layer on. */
5
+ vars: Record<string, string | number | undefined>;
8
6
  };
9
7
  export type RemoteResolver = (key: string) => Promise<RemoteResolution | undefined>;
10
8
  /** The registry inlined the composition into the page, so no network call is needed. */
11
9
  export declare const inlineResolver: (composition?: AppshellComposition) => RemoteResolver;
12
- /** Fetch-on-miss: covers an app activated after this page was served. */
10
+ /** Fetch-on-miss: covers a package activated after this page was served. */
13
11
  export declare const registryResolver: (composition?: AppshellComposition, origin?: string) => RemoteResolver;
14
- /**
15
- * Pre-registry hosts: follow `index[key]` to the app's own manifest. The override
16
- * merge stays here because in this mode no server has done it.
17
- */
18
- export declare const legacyManifestResolver: (config: AppshellGlobalConfig) => RemoteResolver;
19
12
  export declare const chainResolvers: (...resolvers: RemoteResolver[]) => RemoteResolver;
20
- //# sourceMappingURL=resolvers.d.ts.map
@@ -8,4 +8,3 @@ export interface ModuleContainer<TComponent> {
8
8
  init(shareScope: ShareScope<TComponent>): Promise<void>;
9
9
  get(module: string): Promise<() => Record<string, TComponent>>;
10
10
  }
11
- //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,25 @@
1
+ /**
2
+ * A package asked for vars that were never delivered.
3
+ *
4
+ * Almost always one of three things: the package was loaded outside `remoteLoader`
5
+ * (a test, a storybook, a direct import), the host and the package resolved separate
6
+ * copies of `@appshell/runtime` because one of them failed to declare it as a
7
+ * singleton, or the scope compiled into the package is not the scope the registry
8
+ * knows it by.
9
+ */
10
+ export declare class MissingVarsError extends Error {
11
+ readonly scope: string;
12
+ constructor(scope: string, known: string[]);
13
+ }
14
+ /**
15
+ * Something tried to replace vars that were already delivered for a scope.
16
+ *
17
+ * The first write wins and is final. Within one page load a scope has exactly one
18
+ * vars object — both resolvers read it from the same `composition.vars[scope]` — so a
19
+ * differing second write is a bug or a package reaching for a scope that is not its own,
20
+ * and neither should be applied quietly.
21
+ */
22
+ export declare class VarsConflictError extends Error {
23
+ readonly scope: string;
24
+ constructor(scope: string);
25
+ }
@@ -0,0 +1,3 @@
1
+ export { MissingVarsError, VarsConflictError } from './errors';
2
+ export { hasVars, readVars, resetVars, setVars } from './store';
3
+ export type { Vars } from './types';
@@ -0,0 +1,25 @@
1
+ import type { Vars } from './types';
2
+ /**
3
+ * Delivers a scope's vars. Called by `@appshell/loader` immediately before the remote
4
+ * is loaded, so they are in place before the package's modules evaluate.
5
+ *
6
+ * The first write for a scope wins and is frozen. Re-delivering the identical vars is a
7
+ * no-op — the same remote can be mounted more than once — but replacing them throws.
8
+ * That is what keeps one package from overwriting another's: by the time any package
9
+ * evaluates, the host has already written for it.
10
+ *
11
+ * It does not make a scope's vars *private*. Any code on the page can still read another
12
+ * scope by name, and nothing short of a separate realm would change that.
13
+ */
14
+ export declare const setVars: (scope: string, vars: Vars) => void;
15
+ /**
16
+ * Reads a scope's vars, throwing rather than handing back an empty object — a package
17
+ * that silently renders with no configuration is the failure this replaced.
18
+ *
19
+ * Prefer `getVars()` from `@appshell/vars`, which supplies the scope for you.
20
+ */
21
+ export declare const readVars: <TVars extends Vars = Vars>(scope: string) => TVars;
22
+ /** Whether a scope has been delivered, for callers that want to branch instead of catch. */
23
+ export declare const hasVars: (scope: string) => boolean;
24
+ /** Test seam. Not part of the contract a package should build on. */
25
+ export declare const resetVars: () => void;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * A package's runtime configuration, already merged by the registry — a package's
3
+ * declared vars, then the application's `overrides.vars`.
4
+ *
5
+ * Structurally identical to `AppshellComposition['vars'][scope]` in `@appshell/config`,
6
+ * but declared here rather than imported. This package is a shared singleton loaded
7
+ * into every micro-frontend on the page, so it carries no dependencies at all.
8
+ */
9
+ export type Vars = Record<string, string | number | undefined>;
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "@appshell/loader",
3
- "version": "1.0.0-alpha.14",
3
+ "version": "1.0.0-alpha.17",
4
4
  "description": "Utility for loading Appshell components",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/loader/src/index.d.ts",
7
- "repository": "https://github.com/appshell-org/appshell.git",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/appshellhq/appshell.git"
10
+ },
8
11
  "author": "Robert Hamilton <rh@navaris.com>",
9
12
  "publishConfig": {
10
13
  "access": "public",
@@ -18,6 +21,9 @@
18
21
  "start": "webpack --watch --mode development && npm run build:types",
19
22
  "stats": "webpack --json > stats.json"
20
23
  },
24
+ "files": [
25
+ "dist"
26
+ ],
21
27
  "keywords": [
22
28
  "module federation",
23
29
  "micro-frontends",
@@ -25,7 +31,8 @@
25
31
  ],
26
32
  "license": "MIT",
27
33
  "dependencies": {
34
+ "@appshell/runtime": "^1.0.0-alpha.17",
28
35
  "@module-federation/enhanced": "^2.8.2"
29
36
  },
30
- "gitHead": "7dc77badfed56201b3e177f62e55609a360f7e0e"
37
+ "gitHead": "98c549b896365c997a8a37b75a6c366b9211ec16"
31
38
  }
package/CHANGELOG.md DELETED
@@ -1,227 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- # [1.0.0-alpha.14](https://github.com/appshell-org/appshell/compare/v1.0.0-alpha.13...v1.0.0-alpha.14) (2026-08-23)
7
-
8
- **Note:** Version bump only for package @appshell/loader
9
-
10
- # [1.0.0-alpha.13](https://github.com/appshell-org/appshell/compare/v1.0.0-alpha.12...v1.0.0-alpha.13) (2026-08-22)
11
-
12
- ### Bug Fixes
13
-
14
- - **loader,react:** stop forcing a full page reload on remote updates ([36b96c4](https://github.com/appshell-org/appshell/commit/36b96c471dcedf1d29847ef5e41fb21c04864d45))
15
-
16
- ### Features
17
-
18
- - **hmr:** checkpoint current composed app hot reload work ([165788d](https://github.com/appshell-org/appshell/commit/165788d2f276e5f82b750d84abf6cab2e73f8f64))
19
-
20
- # [1.0.0-alpha.12](https://github.com/appshell-org/appshell/compare/v1.0.0-alpha.11...v1.0.0-alpha.12) (2026-08-21)
21
-
22
- ### Bug Fixes
23
-
24
- - improve local federation HMR and shell share behavior ([463d85c](https://github.com/appshell-org/appshell/commit/463d85ce0f18f6111a09b5d94d39d24fb813abc8))
25
-
26
- # [1.0.0-alpha.11](https://github.com/appshell-org/appshell/compare/v1.0.0-alpha.10...v1.0.0-alpha.11) (2026-08-20)
27
-
28
- ### Features
29
-
30
- - **loader:** migrate remote loading to @module-federation/enhanced runtime ([fda2d5d](https://github.com/appshell-org/appshell/commit/fda2d5ddfa5487f9aae55669392a08e55a491461)), closes [#RUNTIME-010](https://github.com/appshell-org/appshell/issues/RUNTIME-010)
31
-
32
- # [1.0.0-alpha.10](https://github.com/appshell-org/appshell/compare/v1.0.0-alpha.9...v1.0.0-alpha.10) (2026-08-19)
33
-
34
- **Note:** Version bump only for package @appshell/loader
35
-
36
- # [1.0.0-alpha.9](https://github.com/appshell-org/appshell/compare/v1.0.0-alpha.8...v1.0.0-alpha.9) (2026-08-19)
37
-
38
- ### Bug Fixes
39
-
40
- - **example:** resolve CSP/module-federation issues blocking local dev ([f8de4e1](https://github.com/appshell-org/appshell/commit/f8de4e1cfe495a7d4ae8e6374189384847c21309))
41
-
42
- # [1.0.0-alpha.8](https://github.com/appshell-org/appshell/compare/v1.0.0-alpha.7...v1.0.0-alpha.8) (2026-08-19)
43
-
44
- **Note:** Version bump only for package @appshell/loader
45
-
46
- # [1.0.0-alpha.7](https://github.com/appshell-org/appshell/compare/v1.0.0-alpha.6...v1.0.0-alpha.7) (2026-08-18)
47
-
48
- **Note:** Version bump only for package @appshell/loader
49
-
50
- **Note:** Version bump only for package @appshell/loader
51
-
52
- # [1.0.0-alpha.6](https://github.com/appshell-org/appshell/compare/v1.0.0-alpha.5...v1.0.0-alpha.6) (2026-08-18)
53
-
54
- **Note:** Version bump only for package @appshell/loader
55
-
56
- # [1.0.0-alpha.5](https://github.com/appshell-org/appshell/compare/v1.0.0-alpha.4...v1.0.0-alpha.5) (2026-08-18)
57
-
58
- **Note:** Version bump only for package @appshell/loader
59
-
60
- **Note:** Version bump only for package @appshell/loader
61
-
62
- # [1.0.0-alpha.4](https://github.com/appshell-org/appshell/compare/v1.0.0-alpha.3...v1.0.0-alpha.4) (2026-08-18)
63
-
64
- **Note:** Version bump only for package @appshell/loader
65
-
66
- **Note:** Version bump only for package @appshell/loader
67
-
68
- # [1.0.0-alpha.3](https://github.com/appshell-org/appshell/compare/v1.0.0-alpha.2...v1.0.0-alpha.3) (2026-08-18)
69
-
70
- **Note:** Version bump only for package @appshell/loader
71
-
72
- # 0.12.0-alpha.0 (2026-04-20)
73
-
74
- ### Bug Fixes
75
-
76
- - appshell loader override check ([aedda4a](https://github.com/appshell-org/appshell/commit/aedda4abf81560297dce03df09fba68e8785242f))
77
- - configurable api key header support, minor fixes ([2f0bf02](https://github.com/appshell-org/appshell/commit/2f0bf027b92398f91b8e8cbfbf543d61fe37b7a0))
78
- - hot module replacement support, example updates ([a67d230](https://github.com/appshell-org/appshell/commit/a67d2303b40f5911373225cc0b4ccf9b67c33d11))
79
- - registry projection, enable env overwrite, refactor docker workflow, consolidate env names ([33a28fe](https://github.com/appshell-org/appshell/commit/33a28fe76b58e05c5b6b6b33d4b402e52bb29e70))
80
- - rename @appshell/react-federated-component package to @appshell/react ([0b74498](https://github.com/appshell-org/appshell/commit/0b74498bf17ba73db4d936c8a012af1d3b111a28))
81
- - replace config intermediate file with template ([9b79e65](https://github.com/appshell-org/appshell/commit/9b79e65b355686a0cca273c89c7164bb031e8437))
82
- - update repository URLs from navaris/appshell to appshell-org/appshell ([506a90d](https://github.com/appshell-org/appshell/commit/506a90d94a6f6e10f463987d408550f48624bfd0))
83
-
84
- ### Features
85
-
86
- - api key support ([9cdcbee](https://github.com/appshell-org/appshell/commit/9cdcbee36e44b8a179b49768d74a25767f1cc5f2))
87
- - appshell cli api key support, init sync and outdated commands ([#6](https://github.com/appshell-org/appshell/issues/6)) ([acc5fa2](https://github.com/appshell-org/appshell/commit/acc5fa234f91a167038161d5080481c43f8eb8b4))
88
- - AppshellComponent impl ([2b82621](https://github.com/appshell-org/appshell/commit/2b82621c13302f790a8e1c457f9a82f39903fc1f))
89
- - consolidate runtime artifacts ([#26](https://github.com/appshell-org/appshell/issues/26)) ([a29479a](https://github.com/appshell-org/appshell/commit/a29479a49f0c5ec1273c9f8e4c7384096f2d4ba0))
90
- - environment variable override for federated components ([#27](https://github.com/appshell-org/appshell/issues/27)) ([d32de0b](https://github.com/appshell-org/appshell/commit/d32de0b0d1cbb1792715e1b363c80ed4600df155))
91
- - foundation refactor wip ([339b930](https://github.com/appshell-org/appshell/commit/339b9306accaa9aba1712f3a0dee6c4cab7ed273))
92
-
93
- ## [0.5.1-alpha.0](https://github.com/appshell-org/appshell/compare/@appshell/loader@0.5.0...@appshell/loader@0.5.1-alpha.0) (2026-04-20)
94
-
95
- ### Bug Fixes
96
-
97
- - update repository URLs from navaris/appshell to appshell-org/appshell ([506a90d](https://github.com/appshell-org/appshell/commit/506a90d94a6f6e10f463987d408550f48624bfd0))
98
-
99
- # [0.5.0](https://github.com/navaris/appshell/compare/@appshell/loader@0.4.0...@appshell/loader@0.5.0) (2025-08-12)
100
-
101
- ### Bug Fixes
102
-
103
- - configurable api key header support, minor fixes ([2f0bf02](https://github.com/navaris/appshell/commit/2f0bf027b92398f91b8e8cbfbf543d61fe37b7a0))
104
-
105
- ### Features
106
-
107
- - appshell cli api key support, init sync and outdated commands ([#6](https://github.com/navaris/appshell/issues/6)) ([acc5fa2](https://github.com/navaris/appshell/commit/acc5fa234f91a167038161d5080481c43f8eb8b4))
108
-
109
- # [0.5.0-alpha.0](https://github.com/navaris/appshell/compare/@appshell/loader@0.4.0...@appshell/loader@0.5.0-alpha.0) (2025-08-10)
110
-
111
- ### Bug Fixes
112
-
113
- - include credentials when fetching the manifests ([4e0ee79](https://github.com/navaris/appshell/commit/4e0ee79b4ba93d34fd6a0e1a5f6bf2fc9f3994cc))
114
-
115
- ### Features
116
-
117
- - appshell cli api key support, init sync and outdated commands ([#6](https://github.com/navaris/appshell/issues/6)) ([acc5fa2](https://github.com/navaris/appshell/commit/acc5fa234f91a167038161d5080481c43f8eb8b4))
118
-
119
- # [0.4.0](https://github.com/navaris/appshell/compare/@appshell/loader@0.3.0...@appshell/loader@0.4.0) (2024-09-24)
120
-
121
- ### Features
122
-
123
- - api key support ([9cdcbee](https://github.com/navaris/appshell/commit/9cdcbee36e44b8a179b49768d74a25767f1cc5f2))
124
-
125
- # [0.4.0-alpha.0](https://github.com/navaris/appshell/compare/@appshell/loader@0.3.1-alpha.0...@appshell/loader@0.4.0-alpha.0) (2024-09-05)
126
-
127
- ### Features
128
-
129
- - api key support ([8c91e62](https://github.com/navaris/appshell/commit/8c91e6240b3d879af9bdd5949924865da0e0f8a1))
130
-
131
- ## [0.3.1-alpha.0](https://github.com/navaris/appshell/compare/@appshell/loader@0.3.0...@appshell/loader@0.3.1-alpha.0) (2024-08-31)
132
-
133
- ### Bug Fixes
134
-
135
- - bump pipeline ([8bb63bc](https://github.com/navaris/appshell/commit/8bb63bcae1928c01bb6bc853d88010939e686af5))
136
-
137
- # [0.3.0](https://github.com/navaris/appshell/compare/@appshell/loader@0.2.1...@appshell/loader@0.3.0) (2024-01-25)
138
-
139
- ### Features
140
-
141
- - AppshellComponent impl ([2b82621](https://github.com/navaris/appshell/commit/2b82621c13302f790a8e1c457f9a82f39903fc1f))
142
-
143
- ## [0.2.1](https://github.com/navaris/appshell/compare/@appshell/loader@0.2.0...@appshell/loader@0.2.1) (2023-08-29)
144
-
145
- ### Bug Fixes
146
-
147
- - appshell loader override check ([aedda4a](https://github.com/navaris/appshell/commit/aedda4abf81560297dce03df09fba68e8785242f))
148
-
149
- # [0.2.0](https://github.com/navaris/appshell/compare/@appshell/loader@0.2.0-alpha.1...@appshell/loader@0.2.0) (2023-08-28)
150
-
151
- **Note:** Version bump only for package @appshell/loader
152
-
153
- # [0.2.0-alpha.1](https://github.com/navaris/appshell/compare/@appshell/loader@0.2.0-alpha.0...@appshell/loader@0.2.0-alpha.1) (2023-08-28)
154
-
155
- ### Features
156
-
157
- - environment variable override for federated components ([#27](https://github.com/navaris/appshell/issues/27)) ([d32de0b](https://github.com/navaris/appshell/commit/d32de0b0d1cbb1792715e1b363c80ed4600df155))
158
-
159
- # [0.2.0-alpha.0](https://github.com/navaris/appshell/compare/@appshell/loader@0.1.0...@appshell/loader@0.2.0-alpha.0) (2023-08-23)
160
-
161
- ### Features
162
-
163
- - consolidate runtime artifacts ([#26](https://github.com/navaris/appshell/issues/26)) ([a29479a](https://github.com/navaris/appshell/commit/a29479a49f0c5ec1273c9f8e4c7384096f2d4ba0))
164
-
165
- # [0.1.0](https://github.com/navaris/appshell/compare/@appshell/loader@0.1.0-alpha.1...@appshell/loader@0.1.0) (2023-07-11)
166
-
167
- ### Bug Fixes
168
-
169
- - registry projection, enable env overwrite, refactor docker workflow, consolidate env names ([33a28fe](https://github.com/navaris/appshell/commit/33a28fe76b58e05c5b6b6b33d4b402e52bb29e70))
170
- - rename @appshell/react-federated-component package to @appshell/react ([0b74498](https://github.com/navaris/appshell/commit/0b74498bf17ba73db4d936c8a012af1d3b111a28))
171
- - replace config intermediate file with template ([9b79e65](https://github.com/navaris/appshell/commit/9b79e65b355686a0cca273c89c7164bb031e8437))
172
-
173
- # [0.1.0-alpha.1](https://github.com/navaris/appshell/compare/@appshell/loader@0.0.3...@appshell/loader@0.1.0-alpha.1) (2023-07-05)
174
-
175
- ### Features
176
-
177
- - foundation refactor wip ([339b930](https://github.com/navaris/appshell/commit/339b9306accaa9aba1712f3a0dee6c4cab7ed273))
178
-
179
- # [0.1.0-alpha.0](https://github.com/navaris/appshell/compare/@appshell/loader@0.0.3...@appshell/loader@0.1.0-alpha.0) (2023-07-05)
180
-
181
- ### Features
182
-
183
- - registry index ([8e6ee0a](https://github.com/navaris/appshell/commit/8e6ee0a6a377584efa2ee702168025f46108b8c5))
184
-
185
- ## [0.0.3](https://github.com/navaris/appshell/compare/@appshell/loader@0.0.3-alpha.2...@appshell/loader@0.0.3) (2023-06-29)
186
-
187
- **Note:** Version bump only for package @appshell/loader
188
-
189
- ## [0.0.3-alpha.2](https://github.com/navaris/appshell/compare/@appshell/loader@0.0.2...@appshell/loader@0.0.3-alpha.2) (2023-06-29)
190
-
191
- **Note:** Version bump only for package @appshell/loader
192
-
193
- ## [0.0.3-alpha.1](https://github.com/navaris/appshell/compare/@appshell/loader@0.0.3-alpha.0...@appshell/loader@0.0.3-alpha.1) (2023-06-29)
194
-
195
- ### Bug Fixes
196
-
197
- - update npm package visibility ([1ef4119](https://github.com/navaris/appshell/commit/1ef411903dd038dfc781e8ce0700811e5460c903))
198
-
199
- ## [0.0.3-alpha.0](https://github.com/navaris/appshell/compare/@appshell/loader@0.0.2-alpha.0...@appshell/loader@0.0.3-alpha.0) (2023-06-29)
200
-
201
- **Note:** Version bump only for package @appshell/loader
202
-
203
- ## [0.0.2](https://github.com/navaris/appshell/compare/@appshell/loader@0.0.2-alpha.0...@appshell/loader@0.0.2) (2023-06-29)
204
-
205
- **Note:** Version bump only for package @appshell/loader
206
-
207
- ## [0.0.2-alpha.0](https://github.com/navaris/appshell/compare/@appshell/loader@0.0.1...@appshell/loader@0.0.2-alpha.0) (2023-06-15)
208
-
209
- ### Bug Fixes
210
-
211
- - hot module replacement support, example updates ([a67d230](https://github.com/navaris/appshell/commit/a67d2303b40f5911373225cc0b4ccf9b67c33d11))
212
-
213
- =======
214
-
215
- ## 0.0.1 (2023-06-15)
216
-
217
- **Note:** Version bump only for package @appshell/loader
218
-
219
- ## [0.0.1-alpha.1](https://github.com/navaris/appshell/compare/@appshell/loader@0.0.1-alpha.0...@appshell/loader@0.0.1-alpha.1) (2023-06-15)
220
-
221
- ### Bug Fixes
222
-
223
- - hot module replacement support, example updates ([a67d230](https://github.com/navaris/appshell/commit/a67d2303b40f5911373225cc0b4ccf9b67c33d11))
224
-
225
- ## 0.0.1-alpha.0 (2023-03-19)
226
-
227
- **Note:** Version bump only for package @appshell/loader
@@ -1,3 +0,0 @@
1
- const TestComponent = () => 'test component';
2
-
3
- export default TestComponent;
@@ -1,68 +0,0 @@
1
- /** @jest-environment jsdom */
2
-
3
- jest.mock('@module-federation/enhanced/runtime', () => ({
4
- init: jest.fn(),
5
- getInstance: jest.fn(() => null),
6
- registerRemotes: jest.fn(),
7
- loadRemote: jest.fn(),
8
- }));
9
-
10
- type ComponentType = () => string;
11
- const TestComponent: ComponentType = () => 'test component';
12
-
13
- describe('loadAppshellComponent', () => {
14
- beforeEach(() => {
15
- jest.resetModules();
16
- });
17
-
18
- it('should load the Appshell component via the federation runtime', async () => {
19
- const runtime = await import('@module-federation/enhanced/runtime');
20
- (runtime.loadRemote as jest.Mock).mockResolvedValue({ default: TestComponent });
21
- const loadAppshellComponent = (await import('../src/loadAppshellComponent')).default;
22
-
23
- const Component = await loadAppshellComponent<ComponentType>(
24
- 'TestModule',
25
- './TestComponent',
26
- 'http://test.com/remoteEntry.js',
27
- );
28
-
29
- expect(Component).toBe(TestComponent);
30
- expect(runtime.registerRemotes).toHaveBeenCalledWith([
31
- { name: 'TestModule', entry: 'http://test.com/remoteEntry.js' },
32
- ]);
33
- expect(runtime.loadRemote).toHaveBeenCalledWith('TestModule/TestComponent');
34
- });
35
-
36
- it('should initialize the runtime and register each scope only once', async () => {
37
- const runtime = await import('@module-federation/enhanced/runtime');
38
- (runtime.loadRemote as jest.Mock).mockResolvedValue({ default: TestComponent });
39
- const loadAppshellComponent = (await import('../src/loadAppshellComponent')).default;
40
-
41
- await loadAppshellComponent('TestModule', './TestComponent', 'http://test.com/remoteEntry.js');
42
- await loadAppshellComponent('TestModule', './TestComponent', 'http://test.com/remoteEntry.js');
43
-
44
- expect(runtime.init).toHaveBeenCalledTimes(1);
45
- expect(runtime.registerRemotes).toHaveBeenCalledTimes(1);
46
- });
47
-
48
- it('should throw if the remote module cannot be loaded', async () => {
49
- const runtime = await import('@module-federation/enhanced/runtime');
50
- (runtime.loadRemote as jest.Mock).mockResolvedValue(null);
51
- const loadAppshellComponent = (await import('../src/loadAppshellComponent')).default;
52
-
53
- await expect(
54
- loadAppshellComponent('TestModule', './TestComponent', 'http://test.com/remoteEntry.js'),
55
- ).rejects.toThrow(/Failed to find module container/i);
56
- });
57
-
58
- it('should not call init when a host federation instance already exists', async () => {
59
- const runtime = await import('@module-federation/enhanced/runtime');
60
- (runtime.getInstance as jest.Mock).mockReturnValue({});
61
- (runtime.loadRemote as jest.Mock).mockResolvedValue({ default: TestComponent });
62
- const loadAppshellComponent = (await import('../src/loadAppshellComponent')).default;
63
-
64
- await loadAppshellComponent('TestModule', './TestComponent', 'http://test.com/remoteEntry.js');
65
-
66
- expect(runtime.init).not.toHaveBeenCalled();
67
- });
68
- });