@appshell/react 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.
- package/README.md +36 -49
- package/dist/main.js +1 -1
- package/dist/types/config/src/axios.d.ts +0 -1
- package/dist/types/config/src/configmap.d.ts +0 -1
- package/dist/types/config/src/context.d.ts +3 -4
- package/dist/types/config/src/credentials.d.ts +0 -2
- package/dist/types/config/src/generate.manifest.d.ts +0 -1
- package/dist/types/config/src/index.d.ts +2 -7
- package/dist/types/config/src/mappers/appshell.config.d.ts +0 -1
- package/dist/types/config/src/outdated.d.ts +0 -1
- package/dist/types/config/src/publish.d.ts +3 -4
- package/dist/types/config/src/sync.d.ts +0 -1
- package/dist/types/config/src/types.d.ts +9 -15
- package/dist/types/config/src/utils/blur.d.ts +0 -1
- package/dist/types/config/src/utils/compare.d.ts +0 -1
- package/dist/types/config/src/utils/config.d.ts +0 -1
- package/dist/types/config/src/utils/copy.d.ts +0 -1
- package/dist/types/config/src/utils/index.d.ts +0 -4
- package/dist/types/config/src/utils/list.d.ts +0 -1
- package/dist/types/config/src/utils/load.d.ts +0 -1
- package/dist/types/config/src/validators/AppshellTemplateValidator.d.ts +0 -1
- package/dist/types/config/src/validators/index.d.ts +0 -3
- package/dist/types/loader/src/index.d.ts +0 -1
- package/dist/types/loader/src/loadAppshellComponent.d.ts +0 -1
- package/dist/types/loader/src/remoteLoader.d.ts +2 -4
- package/dist/types/loader/src/resolvers.d.ts +4 -12
- package/dist/types/loader/src/types.d.ts +0 -1
- package/dist/types/react/src/components/LoadingError.d.ts +0 -1
- package/dist/types/react/src/components/{AppshellComponent.d.ts → RemoteSlot.d.ts} +4 -21
- package/dist/types/react/src/contexts/RemoteContext.d.ts +0 -1
- package/dist/types/react/src/hooks/useRemote.d.ts +1 -2
- package/dist/types/react/src/index.d.ts +1 -9
- package/dist/types/react/src/resources/jsonResource.d.ts +0 -1
- package/dist/types/react/src/types.d.ts +0 -1
- package/dist/types/runtime/src/errors.d.ts +25 -0
- package/dist/types/runtime/src/index.d.ts +3 -0
- package/dist/types/runtime/src/store.d.ts +25 -0
- package/dist/types/runtime/src/types.d.ts +9 -0
- package/package.json +12 -3
- package/CHANGELOG.md +0 -231
- package/__tests__/AppshellComponent.spec.tsx +0 -53
- package/__tests__/LoadingError.spec.tsx +0 -14
- package/__tests__/ManifestContext.spec.tsx +0 -50
- package/__tests__/ReactHost.spec.tsx +0 -136
- package/__tests__/__snapshots__/AppshellComponent.spec.tsx.snap +0 -9
- package/__tests__/__snapshots__/LoadingError.spec.tsx.snap +0 -88
- package/__tests__/__snapshots__/ReactHost.spec.tsx.snap +0 -11
- package/__tests__/fixtures/Manifest.ts +0 -16
- package/__tests__/fixtures/TestComponent.tsx +0 -5
- package/__tests__/fixtures/TestGlobalConfig.ts +0 -8
- package/__tests__/jsonResource.spec.ts +0 -27
- package/__tests__/useRemote.spec.tsx +0 -36
- package/__tests__/utils/waitForResource.ts +0 -15
- package/dist/types/config/src/axios.d.ts.map +0 -1
- package/dist/types/config/src/configmap.d.ts.map +0 -1
- package/dist/types/config/src/context.d.ts.map +0 -1
- package/dist/types/config/src/credentials.d.ts.map +0 -1
- package/dist/types/config/src/deregister.d.ts +0 -3
- package/dist/types/config/src/deregister.d.ts.map +0 -1
- package/dist/types/config/src/generate.env.d.ts +0 -3
- package/dist/types/config/src/generate.env.d.ts.map +0 -1
- package/dist/types/config/src/generate.global-config.d.ts +0 -10
- package/dist/types/config/src/generate.global-config.d.ts.map +0 -1
- package/dist/types/config/src/generate.manifest.d.ts.map +0 -1
- package/dist/types/config/src/index.d.ts.map +0 -1
- package/dist/types/config/src/mappers/appshell.config.d.ts.map +0 -1
- package/dist/types/config/src/outdated.d.ts.map +0 -1
- package/dist/types/config/src/publish.d.ts.map +0 -1
- package/dist/types/config/src/register.d.ts +0 -4
- package/dist/types/config/src/register.d.ts.map +0 -1
- package/dist/types/config/src/sync.d.ts.map +0 -1
- package/dist/types/config/src/types.d.ts.map +0 -1
- package/dist/types/config/src/utils/blur.d.ts.map +0 -1
- package/dist/types/config/src/utils/compare.d.ts.map +0 -1
- package/dist/types/config/src/utils/config.d.ts.map +0 -1
- package/dist/types/config/src/utils/copy.d.ts.map +0 -1
- package/dist/types/config/src/utils/index.d.ts.map +0 -1
- package/dist/types/config/src/utils/isValidUrl.d.ts +0 -3
- package/dist/types/config/src/utils/isValidUrl.d.ts.map +0 -1
- package/dist/types/config/src/utils/list.d.ts.map +0 -1
- package/dist/types/config/src/utils/load.d.ts.map +0 -1
- package/dist/types/config/src/utils/loadJson.d.ts +0 -10
- package/dist/types/config/src/utils/loadJson.d.ts.map +0 -1
- package/dist/types/config/src/utils/merge.d.ts +0 -4
- package/dist/types/config/src/utils/merge.d.ts.map +0 -1
- package/dist/types/config/src/validators/AppshellGlobalConfigValidator.d.ts +0 -4
- package/dist/types/config/src/validators/AppshellGlobalConfigValidator.d.ts.map +0 -1
- package/dist/types/config/src/validators/AppshellManifestValidator.d.ts +0 -4
- package/dist/types/config/src/validators/AppshellManifestValidator.d.ts.map +0 -1
- package/dist/types/config/src/validators/AppshellTemplateValidator.d.ts.map +0 -1
- package/dist/types/config/src/validators/index.d.ts.map +0 -1
- package/dist/types/loader/src/index.d.ts.map +0 -1
- package/dist/types/loader/src/loadAppshellComponent.d.ts.map +0 -1
- package/dist/types/loader/src/remoteLoader.d.ts.map +0 -1
- package/dist/types/loader/src/resolvers.d.ts.map +0 -1
- package/dist/types/loader/src/types.d.ts.map +0 -1
- package/dist/types/react/src/components/AppshellComponent.d.ts.map +0 -1
- package/dist/types/react/src/components/LoadingError.d.ts.map +0 -1
- package/dist/types/react/src/components/ReactHost.d.ts +0 -9
- package/dist/types/react/src/components/ReactHost.d.ts.map +0 -1
- package/dist/types/react/src/contexts/GlobalConfigContext.d.ts +0 -11
- package/dist/types/react/src/contexts/GlobalConfigContext.d.ts.map +0 -1
- package/dist/types/react/src/contexts/ManifestContext.d.ts +0 -12
- package/dist/types/react/src/contexts/ManifestContext.d.ts.map +0 -1
- package/dist/types/react/src/contexts/MetadataContext.d.ts +0 -11
- package/dist/types/react/src/contexts/MetadataContext.d.ts.map +0 -1
- package/dist/types/react/src/contexts/RemoteContext.d.ts.map +0 -1
- package/dist/types/react/src/hooks/useGlobalConfig.d.ts +0 -4
- package/dist/types/react/src/hooks/useGlobalConfig.d.ts.map +0 -1
- package/dist/types/react/src/hooks/useManifest.d.ts +0 -4
- package/dist/types/react/src/hooks/useManifest.d.ts.map +0 -1
- package/dist/types/react/src/hooks/useMetadata.d.ts +0 -4
- package/dist/types/react/src/hooks/useMetadata.d.ts.map +0 -1
- package/dist/types/react/src/hooks/useRemote.d.ts.map +0 -1
- package/dist/types/react/src/index.d.ts.map +0 -1
- package/dist/types/react/src/resources/jsonResource.d.ts.map +0 -1
- package/dist/types/react/src/types.d.ts.map +0 -1
- package/src/components/AppshellComponent.tsx +0 -97
- package/src/components/LoadingError.tsx +0 -15
- package/src/components/ReactHost.tsx +0 -55
- package/src/contexts/GlobalConfigContext.tsx +0 -17
- package/src/contexts/ManifestContext.tsx +0 -40
- package/src/contexts/MetadataContext.tsx +0 -17
- package/src/contexts/RemoteContext.tsx +0 -22
- package/src/hooks/useGlobalConfig.ts +0 -7
- package/src/hooks/useManifest.ts +0 -7
- package/src/hooks/useMetadata.ts +0 -6
- package/src/hooks/useRemote.ts +0 -7
- package/src/index.ts +0 -11
- package/src/resources/jsonResource.ts +0 -35
- package/src/types.ts +0 -3
- package/tsconfig.json +0 -7
- package/webpack.config.js +0 -42
|
@@ -18,4 +18,3 @@ export declare const groupByBaselineModule: (conflicts: Record<string, Compariso
|
|
|
18
18
|
*/
|
|
19
19
|
declare const _default: (workingDir: string, registry: string, conflicts: Record<string, ComparisonResult>, resolutionStrategy?: ResolutionStrategy, packageManager?: PackageManager, dryRun?: boolean) => Promise<void>;
|
|
20
20
|
export default _default;
|
|
21
|
-
//# sourceMappingURL=sync.d.ts.map
|
|
@@ -46,7 +46,7 @@ export type ComparisonTarget = {
|
|
|
46
46
|
export type CliConfig = Record<string, string> & {
|
|
47
47
|
apiKey: string;
|
|
48
48
|
registry: string;
|
|
49
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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; `
|
|
106
|
-
*
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
@@ -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
|
|
@@ -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
|
|
@@ -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
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { AppshellComposition
|
|
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: (
|
|
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,
|
|
1
|
+
import type { AppshellComposition, ResolvedRemote } from '@appshell/config';
|
|
2
2
|
export type RemoteResolution = {
|
|
3
3
|
remote: ResolvedRemote;
|
|
4
|
-
/** Already merged with the
|
|
5
|
-
|
|
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
|
|
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
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import { AppshellIndex } from '@appshell/config';
|
|
2
1
|
import { ReactElement, ReactNode } from 'react';
|
|
3
2
|
export type ExtendedProps = Record<string, unknown>;
|
|
4
|
-
|
|
5
|
-
interface Window {
|
|
6
|
-
__appshell_index__: AppshellIndex;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
export type AppshellComponentProps<TProps extends ExtendedProps = ExtendedProps> = {
|
|
3
|
+
export type RemoteSlotProps<TProps extends ExtendedProps = ExtendedProps> = {
|
|
10
4
|
remote: string;
|
|
11
5
|
fallback?: ReactNode;
|
|
12
6
|
} & TProps;
|
|
@@ -25,21 +19,10 @@ export type AppshellComponentProps<TProps extends ExtendedProps = ExtendedProps>
|
|
|
25
19
|
* client still falls back to a full reload — which is the right place for that decision,
|
|
26
20
|
* because it is the only side that knows whether the update applied.
|
|
27
21
|
*/
|
|
28
|
-
declare const
|
|
29
|
-
<TProps extends ExtendedProps>({ remote, fallback, ...rest }:
|
|
22
|
+
declare const RemoteSlot: {
|
|
23
|
+
<TProps extends ExtendedProps>({ remote, fallback, ...rest }: RemoteSlotProps<TProps>): ReactElement<TProps>;
|
|
30
24
|
defaultProps: {
|
|
31
25
|
fallback: undefined;
|
|
32
26
|
};
|
|
33
27
|
};
|
|
34
|
-
export default
|
|
35
|
-
/**
|
|
36
|
-
* @deprecated This component is deprecated and will be removed in future versions.
|
|
37
|
-
* Please use AppshellComponent instead.
|
|
38
|
-
*/
|
|
39
|
-
export declare const FederatedComponent: {
|
|
40
|
-
<TProps extends ExtendedProps>({ remote, fallback, ...rest }: AppshellComponentProps<TProps>): ReactElement<TProps>;
|
|
41
|
-
defaultProps: {
|
|
42
|
-
fallback: undefined;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
//# sourceMappingURL=AppshellComponent.d.ts.map
|
|
28
|
+
export default RemoteSlot;
|
|
@@ -9,4 +9,3 @@ export declare const RemoteContext: React.Context<AppshellRemote | undefined>;
|
|
|
9
9
|
export declare const RemoteProvider: FC<RemoteProviderProps>;
|
|
10
10
|
export declare const RemoteConsumer: React.Consumer<AppshellRemote | undefined>;
|
|
11
11
|
export default RemoteContext;
|
|
12
|
-
//# sourceMappingURL=RemoteContext.d.ts.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AppshellRemote } from '@appshell/config';
|
|
2
|
-
/** The remote backing the nearest `
|
|
2
|
+
/** The remote backing the nearest `RemoteSlot` — it already knows its own key. */
|
|
3
3
|
declare const _default: () => AppshellRemote | undefined;
|
|
4
4
|
export default _default;
|
|
5
|
-
//# sourceMappingURL=useRemote.d.ts.map
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
export { default as
|
|
2
|
-
export { default as ReactHost } from './components/ReactHost';
|
|
3
|
-
export { GlobalConfigProvider } from './contexts/GlobalConfigContext';
|
|
4
|
-
export { ManifestProvider } from './contexts/ManifestContext';
|
|
5
|
-
export { MetadataProvider } from './contexts/MetadataContext';
|
|
1
|
+
export { default as RemoteSlot } from './components/RemoteSlot';
|
|
6
2
|
export { RemoteProvider } from './contexts/RemoteContext';
|
|
7
|
-
export { default as useGlobalConfig } from './hooks/useGlobalConfig';
|
|
8
|
-
export { default as useManifest } from './hooks/useManifest';
|
|
9
|
-
export { default as useMetadata } from './hooks/useMetadata';
|
|
10
3
|
export { default as useRemote } from './hooks/useRemote';
|
|
11
4
|
export { default as jsonResource } from './resources/jsonResource';
|
|
12
|
-
//# sourceMappingURL=index.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,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/react",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.17",
|
|
4
4
|
"description": "React utilities for building micro-frontends with Appshell and Module Federation",
|
|
5
5
|
"main": "dist/main.js",
|
|
6
6
|
"types": "dist/types/react/src/index.d.ts",
|
|
7
|
-
"repository":
|
|
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",
|
|
@@ -17,6 +20,9 @@
|
|
|
17
20
|
"start": "webpack --watch --mode development --stats-error-details",
|
|
18
21
|
"stats": "webpack --json > stats.json"
|
|
19
22
|
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
20
26
|
"keywords": [
|
|
21
27
|
"module federation",
|
|
22
28
|
"micro-frontends",
|
|
@@ -27,5 +33,8 @@
|
|
|
27
33
|
"react": "^18.2.0",
|
|
28
34
|
"react-dom": "^18.2.0"
|
|
29
35
|
},
|
|
30
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "98c549b896365c997a8a37b75a6c366b9211ec16",
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@appshell/runtime": "^1.0.0-alpha.17"
|
|
39
|
+
}
|
|
31
40
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,231 +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/react
|
|
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
|
-
**Note:** Version bump only for package @appshell/react
|
|
29
|
-
|
|
30
|
-
# [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)
|
|
31
|
-
|
|
32
|
-
**Note:** Version bump only for package @appshell/react
|
|
33
|
-
|
|
34
|
-
# [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)
|
|
35
|
-
|
|
36
|
-
**Note:** Version bump only for package @appshell/react
|
|
37
|
-
|
|
38
|
-
# [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)
|
|
39
|
-
|
|
40
|
-
**Note:** Version bump only for package @appshell/react
|
|
41
|
-
|
|
42
|
-
**Note:** Version bump only for package @appshell/react
|
|
43
|
-
|
|
44
|
-
# [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)
|
|
45
|
-
|
|
46
|
-
**Note:** Version bump only for package @appshell/react
|
|
47
|
-
|
|
48
|
-
# [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)
|
|
49
|
-
|
|
50
|
-
**Note:** Version bump only for package @appshell/react
|
|
51
|
-
|
|
52
|
-
**Note:** Version bump only for package @appshell/react
|
|
53
|
-
|
|
54
|
-
# [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)
|
|
55
|
-
|
|
56
|
-
**Note:** Version bump only for package @appshell/react
|
|
57
|
-
|
|
58
|
-
**Note:** Version bump only for package @appshell/react
|
|
59
|
-
|
|
60
|
-
# [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)
|
|
61
|
-
|
|
62
|
-
**Note:** Version bump only for package @appshell/react
|
|
63
|
-
|
|
64
|
-
# 0.12.0-alpha.0 (2026-04-20)
|
|
65
|
-
|
|
66
|
-
### Bug Fixes
|
|
67
|
-
|
|
68
|
-
- appshell loader override check ([aedda4a](https://github.com/appshell-org/appshell/commit/aedda4abf81560297dce03df09fba68e8785242f))
|
|
69
|
-
- capture direct dependencies passed to FederatedComponent for re-render ([3621879](https://github.com/appshell-org/appshell/commit/36218793a5cb47f74bd8d1ce93deffdb1b85cd1c))
|
|
70
|
-
- rename @appshell/react-federated-component package to @appshell/react ([0b74498](https://github.com/appshell-org/appshell/commit/0b74498bf17ba73db4d936c8a012af1d3b111a28))
|
|
71
|
-
- update repository URLs from navaris/appshell to appshell-org/appshell ([506a90d](https://github.com/appshell-org/appshell/commit/506a90d94a6f6e10f463987d408550f48624bfd0))
|
|
72
|
-
|
|
73
|
-
### Features
|
|
74
|
-
|
|
75
|
-
- api key support ([9cdcbee](https://github.com/appshell-org/appshell/commit/9cdcbee36e44b8a179b49768d74a25767f1cc5f2))
|
|
76
|
-
- AppshellComponent impl ([2b82621](https://github.com/appshell-org/appshell/commit/2b82621c13302f790a8e1c457f9a82f39903fc1f))
|
|
77
|
-
- consolidate runtime artifacts ([#26](https://github.com/appshell-org/appshell/issues/26)) ([a29479a](https://github.com/appshell-org/appshell/commit/a29479a49f0c5ec1273c9f8e4c7384096f2d4ba0))
|
|
78
|
-
|
|
79
|
-
## [0.4.1-alpha.0](https://github.com/appshell-org/appshell/compare/@appshell/react@0.4.0...@appshell/react@0.4.1-alpha.0) (2026-04-20)
|
|
80
|
-
|
|
81
|
-
### Bug Fixes
|
|
82
|
-
|
|
83
|
-
- update repository URLs from navaris/appshell to appshell-org/appshell ([506a90d](https://github.com/appshell-org/appshell/commit/506a90d94a6f6e10f463987d408550f48624bfd0))
|
|
84
|
-
|
|
85
|
-
# [0.4.0](https://github.com/navaris/appshell/compare/@appshell/react@0.3.0...@appshell/react@0.4.0) (2024-09-24)
|
|
86
|
-
|
|
87
|
-
### Features
|
|
88
|
-
|
|
89
|
-
- api key support ([9cdcbee](https://github.com/navaris/appshell/commit/9cdcbee36e44b8a179b49768d74a25767f1cc5f2))
|
|
90
|
-
|
|
91
|
-
# [0.4.0-alpha.0](https://github.com/navaris/appshell/compare/@appshell/react@0.3.1-alpha.0...@appshell/react@0.4.0-alpha.0) (2024-09-05)
|
|
92
|
-
|
|
93
|
-
### Features
|
|
94
|
-
|
|
95
|
-
- api key support ([8c91e62](https://github.com/navaris/appshell/commit/8c91e6240b3d879af9bdd5949924865da0e0f8a1))
|
|
96
|
-
|
|
97
|
-
## [0.3.1-alpha.0](https://github.com/navaris/appshell/compare/@appshell/react@0.3.0...@appshell/react@0.3.1-alpha.0) (2024-08-31)
|
|
98
|
-
|
|
99
|
-
### Bug Fixes
|
|
100
|
-
|
|
101
|
-
- bump pipeline ([8bb63bc](https://github.com/navaris/appshell/commit/8bb63bcae1928c01bb6bc853d88010939e686af5))
|
|
102
|
-
|
|
103
|
-
# [0.3.0](https://github.com/navaris/appshell/compare/@appshell/react@0.2.2...@appshell/react@0.3.0) (2024-01-25)
|
|
104
|
-
|
|
105
|
-
### Features
|
|
106
|
-
|
|
107
|
-
- AppshellComponent impl ([2b82621](https://github.com/navaris/appshell/commit/2b82621c13302f790a8e1c457f9a82f39903fc1f))
|
|
108
|
-
|
|
109
|
-
## [0.2.2](https://github.com/navaris/appshell/compare/@appshell/react@0.2.1...@appshell/react@0.2.2) (2024-01-04)
|
|
110
|
-
|
|
111
|
-
### Bug Fixes
|
|
112
|
-
|
|
113
|
-
- capture direct dependencies passed to FederatedComponent for re-render ([3621879](https://github.com/navaris/appshell/commit/36218793a5cb47f74bd8d1ce93deffdb1b85cd1c))
|
|
114
|
-
|
|
115
|
-
## [0.2.1](https://github.com/navaris/appshell/compare/@appshell/react@0.2.0...@appshell/react@0.2.1) (2023-08-29)
|
|
116
|
-
|
|
117
|
-
### Bug Fixes
|
|
118
|
-
|
|
119
|
-
- appshell loader override check ([aedda4a](https://github.com/navaris/appshell/commit/aedda4abf81560297dce03df09fba68e8785242f))
|
|
120
|
-
|
|
121
|
-
# [0.2.0](https://github.com/navaris/appshell/compare/@appshell/react@0.2.0-alpha.0...@appshell/react@0.2.0) (2023-08-28)
|
|
122
|
-
|
|
123
|
-
**Note:** Version bump only for package @appshell/react
|
|
124
|
-
|
|
125
|
-
# [0.2.0-alpha.0](https://github.com/navaris/appshell/compare/@appshell/react@0.1.0...@appshell/react@0.2.0-alpha.0) (2023-08-23)
|
|
126
|
-
|
|
127
|
-
### Features
|
|
128
|
-
|
|
129
|
-
- consolidate runtime artifacts ([#26](https://github.com/navaris/appshell/issues/26)) ([a29479a](https://github.com/navaris/appshell/commit/a29479a49f0c5ec1273c9f8e4c7384096f2d4ba0))
|
|
130
|
-
|
|
131
|
-
# [0.1.0](https://github.com/navaris/appshell/compare/@appshell/react@0.1.0-alpha.6...@appshell/react@0.1.0) (2023-07-11)
|
|
132
|
-
|
|
133
|
-
**Note:** Version bump only for package @appshell/react
|
|
134
|
-
|
|
135
|
-
# 0.1.0-alpha.6 (2023-07-10)
|
|
136
|
-
|
|
137
|
-
### Bug Fixes
|
|
138
|
-
|
|
139
|
-
- rename @appshell/react-federated-component package to @appshell/react ([0b74498](https://github.com/navaris/appshell/commit/0b74498bf17ba73db4d936c8a012af1d3b111a28))
|
|
140
|
-
|
|
141
|
-
# [0.1.0-alpha.5](https://github.com/navaris/appshell/compare/@appshell/react-federated-component@0.1.0-alpha.4...@appshell/react-federated-component@0.1.0-alpha.5) (2023-07-10)
|
|
142
|
-
|
|
143
|
-
### Bug Fixes
|
|
144
|
-
|
|
145
|
-
- registry projection, enable env overwrite, refactor docker workflow, consolidate env names ([33a28fe](https://github.com/navaris/appshell/commit/33a28fe76b58e05c5b6b6b33d4b402e52bb29e70))
|
|
146
|
-
|
|
147
|
-
# [0.1.0-alpha.4](https://github.com/navaris/appshell/compare/@appshell/react-federated-component@0.1.0-alpha.3...@appshell/react-federated-component@0.1.0-alpha.4) (2023-07-06)
|
|
148
|
-
|
|
149
|
-
### Bug Fixes
|
|
150
|
-
|
|
151
|
-
- metadata urls ([efcce1c](https://github.com/navaris/appshell/commit/efcce1ce4cb1745afa83661cae1414a73f837483))
|
|
152
|
-
|
|
153
|
-
# [0.1.0-alpha.3](https://github.com/navaris/appshell/compare/@appshell/react-federated-component@0.1.0-alpha.2...@appshell/react-federated-component@0.1.0-alpha.3) (2023-07-06)
|
|
154
|
-
|
|
155
|
-
### Bug Fixes
|
|
156
|
-
|
|
157
|
-
- support metadata generation ([4df202f](https://github.com/navaris/appshell/commit/4df202f0fd3b9ca6c660975b75eb0ac9b60225c2))
|
|
158
|
-
|
|
159
|
-
# [0.1.0-alpha.2](https://github.com/navaris/appshell/compare/@appshell/react-federated-component@0.1.0-alpha.1...@appshell/react-federated-component@0.1.0-alpha.2) (2023-07-06)
|
|
160
|
-
|
|
161
|
-
### Bug Fixes
|
|
162
|
-
|
|
163
|
-
- lint ([a4861ab](https://github.com/navaris/appshell/commit/a4861abfe82d1e0ab815aaa62cdf7907229d0136))
|
|
164
|
-
|
|
165
|
-
### Features
|
|
166
|
-
|
|
167
|
-
- appshell start, cleanup dev workflow ([74fd2e5](https://github.com/navaris/appshell/commit/74fd2e5a5acd2415482268175c7f3f16cd7c93ec))
|
|
168
|
-
|
|
169
|
-
# [0.1.0-alpha.1](https://github.com/navaris/appshell/compare/@appshell/react-federated-component@0.0.3...@appshell/react-federated-component@0.1.0-alpha.1) (2023-07-05)
|
|
170
|
-
|
|
171
|
-
### Features
|
|
172
|
-
|
|
173
|
-
- foundation refactor wip ([339b930](https://github.com/navaris/appshell/commit/339b9306accaa9aba1712f3a0dee6c4cab7ed273))
|
|
174
|
-
|
|
175
|
-
# [0.1.0-alpha.0](https://github.com/navaris/appshell/compare/@appshell/react-federated-component@0.0.3...@appshell/react-federated-component@0.1.0-alpha.0) (2023-07-05)
|
|
176
|
-
|
|
177
|
-
### Features
|
|
178
|
-
|
|
179
|
-
- registry index ([8e6ee0a](https://github.com/navaris/appshell/commit/8e6ee0a6a377584efa2ee702168025f46108b8c5))
|
|
180
|
-
|
|
181
|
-
## [0.0.3](https://github.com/navaris/appshell/compare/@appshell/react-federated-component@0.0.3-alpha.2...@appshell/react-federated-component@0.0.3) (2023-06-29)
|
|
182
|
-
|
|
183
|
-
**Note:** Version bump only for package @appshell/react-federated-component
|
|
184
|
-
|
|
185
|
-
## [0.0.3-alpha.2](https://github.com/navaris/appshell/compare/@appshell/react-federated-component@0.0.2...@appshell/react-federated-component@0.0.3-alpha.2) (2023-06-29)
|
|
186
|
-
|
|
187
|
-
**Note:** Version bump only for package @appshell/react-federated-component
|
|
188
|
-
|
|
189
|
-
## [0.0.3-alpha.1](https://github.com/navaris/appshell/compare/@appshell/react-federated-component@0.0.3-alpha.0...@appshell/react-federated-component@0.0.3-alpha.1) (2023-06-29)
|
|
190
|
-
|
|
191
|
-
### Bug Fixes
|
|
192
|
-
|
|
193
|
-
- update npm package visibility ([1ef4119](https://github.com/navaris/appshell/commit/1ef411903dd038dfc781e8ce0700811e5460c903))
|
|
194
|
-
|
|
195
|
-
## [0.0.3-alpha.0](https://github.com/navaris/appshell/compare/@appshell/react-federated-component@0.0.2-alpha.1...@appshell/react-federated-component@0.0.3-alpha.0) (2023-06-29)
|
|
196
|
-
|
|
197
|
-
**Note:** Version bump only for package @appshell/react-federated-component
|
|
198
|
-
|
|
199
|
-
## [0.0.2](https://github.com/navaris/appshell/compare/@appshell/react-federated-component@0.0.2-alpha.1...@appshell/react-federated-component@0.0.2) (2023-06-29)
|
|
200
|
-
|
|
201
|
-
**Note:** Version bump only for package @appshell/react-federated-component
|
|
202
|
-
|
|
203
|
-
## [0.0.2-alpha.1](https://github.com/navaris/appshell/compare/@appshell/react-federated-component@0.0.2-alpha.0...@appshell/react-federated-component@0.0.2-alpha.1) (2023-06-24)
|
|
204
|
-
|
|
205
|
-
### Bug Fixes
|
|
206
|
-
|
|
207
|
-
- add useEffect dependencies for federated component ([616039e](https://github.com/navaris/appshell/commit/616039ebb3f46f34db0b82acfb6ee5438a6b4731))
|
|
208
|
-
|
|
209
|
-
## [0.0.2-alpha.0](https://github.com/navaris/appshell/compare/@appshell/react-federated-component@0.0.1...@appshell/react-federated-component@0.0.2-alpha.0) (2023-06-15)
|
|
210
|
-
|
|
211
|
-
### Bug Fixes
|
|
212
|
-
|
|
213
|
-
- hot module replacement support, example updates ([a67d230](https://github.com/navaris/appshell/commit/a67d2303b40f5911373225cc0b4ccf9b67c33d11))
|
|
214
|
-
|
|
215
|
-
## 0.0.1 (2023-06-15)
|
|
216
|
-
|
|
217
|
-
**Note:** Version bump only for package @appshell/react-federated-component
|
|
218
|
-
|
|
219
|
-
## [0.0.1-alpha.2](https://github.com/navaris/appshell/compare/@appshell/react-federated-component@0.0.1-alpha.1...@appshell/react-federated-component@0.0.1-alpha.2) (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.1](https://github.com/navaris/appshell/compare/@appshell/react-federated-component@0.0.1-alpha.0...@appshell/react-federated-component@0.0.1-alpha.1) (2023-03-19)
|
|
226
|
-
|
|
227
|
-
**Note:** Version bump only for package @appshell/react-federated-component
|
|
228
|
-
|
|
229
|
-
## 0.0.1-alpha.0 (2023-03-19)
|
|
230
|
-
|
|
231
|
-
**Note:** Version bump only for package @appshell/react-federated-component
|