@appshell/react 1.0.0-alpha.14 → 1.0.0-alpha.16
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/CHANGELOG.md +11 -0
- package/README.md +36 -49
- package/__tests__/{AppshellComponent.spec.tsx → RemoteSlot.spec.tsx} +6 -13
- package/__tests__/__snapshots__/{AppshellComponent.spec.tsx.snap → RemoteSlot.spec.tsx.snap} +1 -1
- package/__tests__/fixtures/Manifest.ts +1 -1
- package/dist/main.js +1 -1
- package/dist/types/config/src/context.d.ts +3 -3
- package/dist/types/config/src/credentials.d.ts +0 -1
- package/dist/types/config/src/credentials.d.ts.map +1 -1
- package/dist/types/config/src/index.d.ts +2 -6
- package/dist/types/config/src/index.d.ts.map +1 -1
- package/dist/types/config/src/publish.d.ts +3 -3
- package/dist/types/config/src/publish.d.ts.map +1 -1
- package/dist/types/config/src/types.d.ts +9 -14
- package/dist/types/config/src/types.d.ts.map +1 -1
- package/dist/types/config/src/utils/index.d.ts +0 -3
- package/dist/types/config/src/utils/index.d.ts.map +1 -1
- package/dist/types/config/src/validators/index.d.ts +0 -2
- package/dist/types/config/src/validators/index.d.ts.map +1 -1
- package/dist/types/loader/src/remoteLoader.d.ts +2 -3
- package/dist/types/loader/src/remoteLoader.d.ts.map +1 -1
- package/dist/types/loader/src/resolvers.d.ts +4 -11
- package/dist/types/loader/src/resolvers.d.ts.map +1 -1
- package/dist/types/react/src/components/{AppshellComponent.d.ts → RemoteSlot.d.ts} +5 -21
- package/dist/types/react/src/components/RemoteSlot.d.ts.map +1 -0
- package/dist/types/react/src/hooks/useRemote.d.ts +1 -1
- package/dist/types/react/src/hooks/useRemote.d.ts.map +1 -1
- package/dist/types/react/src/index.d.ts +1 -8
- package/dist/types/react/src/index.d.ts.map +1 -1
- package/dist/types/runtime/src/errors.d.ts +26 -0
- package/dist/types/runtime/src/errors.d.ts.map +1 -0
- package/dist/types/runtime/src/index.d.ts +4 -0
- package/dist/types/runtime/src/index.d.ts.map +1 -0
- package/dist/types/runtime/src/store.d.ts +26 -0
- package/dist/types/runtime/src/store.d.ts.map +1 -0
- package/dist/types/runtime/src/types.d.ts +10 -0
- package/dist/types/runtime/src/types.d.ts.map +1 -0
- package/package.json +9 -3
- package/src/components/{AppshellComponent.tsx → RemoteSlot.tsx} +12 -29
- package/src/hooks/useRemote.ts +1 -1
- package/src/index.ts +1 -8
- package/webpack.config.js +3 -0
- package/__tests__/ManifestContext.spec.tsx +0 -50
- package/__tests__/ReactHost.spec.tsx +0 -136
- package/__tests__/__snapshots__/ReactHost.spec.tsx.snap +0 -11
- package/__tests__/fixtures/TestGlobalConfig.ts +0 -8
- 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/register.d.ts +0 -4
- package/dist/types/config/src/register.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/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/react/src/components/AppshellComponent.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/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/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/hooks/useGlobalConfig.ts +0 -7
- package/src/hooks/useManifest.ts +0 -7
- package/src/hooks/useMetadata.ts +0 -6
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export type AppshellContext = {
|
|
2
2
|
registry?: string;
|
|
3
3
|
/** Activation target as `scope/name`. */
|
|
4
|
-
|
|
4
|
+
application?: string;
|
|
5
5
|
scopeId: string;
|
|
6
6
|
token?: string;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
|
-
* The registry,
|
|
9
|
+
* The registry, application, and token a developer is working against, resolved
|
|
10
10
|
* the way the CLI resolves them: env var, then `~/.appshell/config`, then a
|
|
11
11
|
* default. This lets the webpack plugin defer to `appshell config set` and
|
|
12
12
|
* `appshell login` instead of requiring per-project configuration.
|
|
@@ -18,6 +18,6 @@ export declare const resolveContext: () => AppshellContext;
|
|
|
18
18
|
*/
|
|
19
19
|
export declare const persistedContext: () => {
|
|
20
20
|
registry?: string;
|
|
21
|
-
|
|
21
|
+
application?: string;
|
|
22
22
|
};
|
|
23
23
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -12,5 +12,4 @@ export declare const clearCredential: (registry: string) => void;
|
|
|
12
12
|
* Expired tokens are treated as absent; refresh is the caller's concern.
|
|
13
13
|
*/
|
|
14
14
|
export declare const resolveToken: (registry: string) => string | undefined;
|
|
15
|
-
export declare const requireToken: (registry: string) => string;
|
|
16
15
|
//# sourceMappingURL=credentials.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../../../config/src/credentials.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,UAAU,GAAG;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAKF,eAAO,MAAM,eAAe,cAC6D,CAAC;AAqB1F,eAAO,MAAM,cAAc,aAAc,MAAM,cAAc,UAAU,SAEtE,CAAC;AAEF,eAAO,MAAM,eAAe,aAAc,MAAM,SAI/C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,aAAc,MAAM,KAAG,MAAM,GAAG,SAexD,CAAC
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../../../config/src/credentials.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,UAAU,GAAG;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAKF,eAAO,MAAM,eAAe,cAC6D,CAAC;AAqB1F,eAAO,MAAM,cAAc,aAAc,MAAM,cAAc,UAAU,SAEtE,CAAC;AAEF,eAAO,MAAM,eAAe,aAAc,MAAM,SAI/C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,aAAc,MAAM,KAAG,MAAM,GAAG,SAexD,CAAC"}
|
|
@@ -4,18 +4,14 @@
|
|
|
4
4
|
export { default as configmap } from './configmap';
|
|
5
5
|
export { persistedContext, resolveContext } from './context';
|
|
6
6
|
export type { AppshellContext } from './context';
|
|
7
|
-
export { clearCredential, credentialsPath,
|
|
7
|
+
export { clearCredential, credentialsPath, resolveToken, saveCredential, } from './credentials';
|
|
8
8
|
export type { Credential } from './credentials';
|
|
9
|
-
export { default as deregister } from './deregister';
|
|
10
|
-
export { default as generateEnv } from './generate.env';
|
|
11
|
-
export { default as generateGlobalConfig } from './generate.global-config';
|
|
12
9
|
export { default as generateManifest } from './generate.manifest';
|
|
13
10
|
export { default as outdated } from './outdated';
|
|
14
11
|
export { activate, publish } from './publish';
|
|
15
12
|
export type { PublishOptions, PublishResult } from './publish';
|
|
16
|
-
export { default as register } from './register';
|
|
17
13
|
export { default as sync } from './sync';
|
|
18
|
-
export type { AppshellComposition, AppshellConfig, AppshellConfigRemote,
|
|
14
|
+
export type { AppshellComposition, AppshellConfig, AppshellConfigRemote, AppshellIndex, AppshellManifest, AppshellRemote, AppshellTemplate, ComparisonResult, ComparisonResults, ComparisonTarget, Metadata, ModuleFederationPluginOptions, PackageSpec, ResolvedRemote, Schema, SharedConfig, SharedModuleSpec, } from './types';
|
|
19
15
|
export * as utils from './utils';
|
|
20
16
|
export * as validators from './validators';
|
|
21
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../config/src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC7D,YAAY,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EACL,eAAe,EACf,eAAe,EACf,YAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../config/src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC7D,YAAY,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EACL,eAAe,EACf,eAAe,EACf,YAAY,EACZ,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC9C,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,YAAY,EACV,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,QAAQ,EACR,6BAA6B,EAC7B,WAAW,EACX,cAAc,EACd,MAAM,EACN,YAAY,EACZ,gBAAgB,GACjB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC"}
|
|
@@ -22,8 +22,8 @@ export type PublishResult = {
|
|
|
22
22
|
*/
|
|
23
23
|
export declare const publish: ({ registry, token, name, version, manifest, visibility, metadata, force, }: PublishOptions) => Promise<PublishResult>;
|
|
24
24
|
/**
|
|
25
|
-
* Activating a newer version of an already active
|
|
26
|
-
* @param
|
|
25
|
+
* Activating a newer version of an already active package upgrades it in place.
|
|
26
|
+
* @param application `scope/name`
|
|
27
27
|
*/
|
|
28
|
-
export declare const activate: (registry: string,
|
|
28
|
+
export declare const activate: (registry: string, application: string, packageId: string, token?: string) => Promise<void>;
|
|
29
29
|
//# sourceMappingURL=publish.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../../../../config/src/publish.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAErD,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,UAAU,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,+EAA+E;IAC/E,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,4EAA4E;IAC5E,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;
|
|
1
|
+
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../../../../config/src/publish.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAErD,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,UAAU,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,+EAA+E;IAC/E,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,4EAA4E;IAC5E,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAqBF;;;;GAIG;AACH,eAAO,MAAM,OAAO,+EASjB,cAAc,KAAG,OAAO,CAAC,aAAa,CAYxC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,aACT,MAAM,eACH,MAAM,aACR,MAAM,UACT,MAAM,KACb,OAAO,CAAC,IAAI,CAgBd,CAAC"}
|
|
@@ -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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../config/src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEpE,MAAM,MAAM,MAAM,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,CAAC;AAE7D,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE/C,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACzC,eAAe,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,YAAY,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,g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AAM,GAAG,YAAY,CAAC;CACxC;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE5B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,aAAa,GAAG,MAAM,EAAE,CAAC;CACpD;AAED,MAAM,WAAW,6BAA6B;IAC5C;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,MAAM,GAAG,aAAa,CAAC,EAAE,GAAG,aAAa,CAAC;IAErD;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC;IAEzB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,UAAU,CAAC,EACP,QAAQ,GACR,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,UAAU,GACV,WAAW,GACX,iBAAiB,GACjB,iBAAiB,GACjB,KAAK,GACL,aAAa,GACb,KAAK,GACL,MAAM,GACN,OAAO,GACP,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,eAAe,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,MAAM,GAAG,aAAa,CAAC,EAAE,GAAG,aAAa,CAAC;IAErD;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAEzB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,MAAM,GAAG,YAAY,CAAC,EAAE,GAAG,YAAY,CAAC;CACnD"}
|
|
@@ -2,9 +2,6 @@ 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
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../config/src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB,EACzB,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,GACb,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../config/src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB,EACzB,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,GACb,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
export { default as AppshellGlobalConfigValidator } from './AppshellGlobalConfigValidator';
|
|
2
|
-
export { default as AppshellManifestValidator } from './AppshellManifestValidator';
|
|
3
1
|
export { default as AppshellTemplateValidator } from './AppshellTemplateValidator';
|
|
4
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../config/src/validators/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../config/src/validators/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -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,6 @@ 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
15
|
//# sourceMappingURL=remoteLoader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remoteLoader.d.ts","sourceRoot":"","sources":["../../../../../loader/src/remoteLoader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"remoteLoader.d.ts","sourceRoot":"","sources":["../../../../../loader/src/remoteLoader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAG5D,OAAO,EAAoD,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAEpG,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;KAC3C;CACF;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B,CAAC;mCAEuB,mBAAmB,MAQ5B,UAAU,OAAO,MAAM;AARvC,wBA2CE"}
|
|
@@ -1,20 +1,13 @@
|
|
|
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
13
|
//# sourceMappingURL=resolvers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../../../loader/src/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../../../loader/src/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE5E,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,cAAc,CAAC;IACvB,kGAAkG;IAClG,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC;CACnD,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAAC;AAEpF,wFAAwF;AACxF,eAAO,MAAM,cAAc,iBACV,mBAAmB,KAAG,cASpC,CAAC;AAEJ,4EAA4E;AAC5E,eAAO,MAAM,gBAAgB,iBACZ,mBAAmB,sBAAgB,cAcjD,CAAC;AAEJ,eAAO,MAAM,cAAc,iBACV,cAAc,EAAE,KAAG,cAUjC,CAAC"}
|
|
@@ -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,11 @@ 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;
|
|
29
|
+
//# sourceMappingURL=RemoteSlot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RemoteSlot.d.ts","sourceRoot":"","sources":["../../../../../src/components/RemoteSlot.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAiB,YAAY,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;AAI3F,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAGpD,MAAM,MAAM,eAAe,CAAC,MAAM,SAAS,aAAa,GAAG,aAAa,IAAI;IAC1E,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,GAAG,MAAM,CAAC;AAEX;;;;;;;;;;;;;;GAcG;AACH,QAAA,MAAM,UAAU;KAAI,MAAM,SAAS,aAAa,iCAI7C,eAAe,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC;;;;CAwChD,CAAC;AAMF,eAAe,UAAU,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
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
5
|
//# sourceMappingURL=useRemote.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRemote.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useRemote.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAKlD,
|
|
1
|
+
{"version":3,"file":"useRemote.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useRemote.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAKlD,kFAAkF;8BAC/D,cAAc,GAAG,SAAS;AAA7C,wBAAiF"}
|
|
@@ -1,12 +1,5 @@
|
|
|
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
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
}
|
|
26
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../../runtime/src/errors.ts"],"names":[],"mappings":"AACA;;;;;;;;GAQG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;gBAEX,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;CAc3C;AAED;;;;;;;GAOG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;gBAEX,KAAK,EAAE,MAAM;CAS1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../runtime/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAChE,YAAY,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
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;
|
|
26
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../../runtime/src/store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAepC;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,OAAO,UAAW,MAAM,QAAQ,IAAI,KAAG,IAYnD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,KAAK,SAAS,IAAI,gBAAgB,MAAM,KAAG,KAQnE,CAAC;AAEF,4FAA4F;AAC5F,eAAO,MAAM,OAAO,UAAW,MAAM,KAAG,OAA+B,CAAC;AAExE,qEAAqE;AACrE,eAAO,MAAM,SAAS,QAAO,IAE5B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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>;
|
|
10
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../runtime/src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC"}
|
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.16",
|
|
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",
|
|
@@ -27,5 +30,8 @@
|
|
|
27
30
|
"react": "^18.2.0",
|
|
28
31
|
"react-dom": "^18.2.0"
|
|
29
32
|
},
|
|
30
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "68bf9eb95a85e8ea8ab51384e8f050d090b0f5b5",
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@appshell/runtime": "^1.0.0-alpha.16"
|
|
36
|
+
}
|
|
31
37
|
}
|
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
/* eslint-disable react/jsx-props-no-spreading */
|
|
2
|
-
import { AppshellIndex } from '@appshell/config';
|
|
3
2
|
import remoteLoader from '@appshell/loader';
|
|
4
3
|
import React, { ComponentType, ReactElement, ReactNode, useEffect, useState } from 'react';
|
|
5
|
-
import { ManifestProvider } from '../contexts/ManifestContext';
|
|
6
4
|
import { RemoteProvider } from '../contexts/RemoteContext';
|
|
7
|
-
import useGlobalConfig from '../hooks/useGlobalConfig';
|
|
8
5
|
import LoadingError from './LoadingError';
|
|
9
6
|
|
|
10
7
|
export type ExtendedProps = Record<string, unknown>;
|
|
11
8
|
|
|
12
|
-
declare global {
|
|
13
|
-
interface Window {
|
|
14
|
-
__appshell_index__: AppshellIndex;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
9
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-constraint
|
|
18
|
-
export type
|
|
10
|
+
export type RemoteSlotProps<TProps extends ExtendedProps = ExtendedProps> = {
|
|
19
11
|
remote: string;
|
|
20
12
|
fallback?: ReactNode;
|
|
21
13
|
} & TProps;
|
|
@@ -35,32 +27,29 @@ export type AppshellComponentProps<TProps extends ExtendedProps = ExtendedProps>
|
|
|
35
27
|
* client still falls back to a full reload — which is the right place for that decision,
|
|
36
28
|
* because it is the only side that knows whether the update applied.
|
|
37
29
|
*/
|
|
38
|
-
const
|
|
30
|
+
const RemoteSlot = <TProps extends ExtendedProps>({
|
|
39
31
|
remote,
|
|
40
32
|
fallback,
|
|
41
33
|
...rest
|
|
42
|
-
}:
|
|
43
|
-
const config = useGlobalConfig();
|
|
34
|
+
}: RemoteSlotProps<TProps>): ReactElement<TProps> => {
|
|
44
35
|
const [element, setElement] = useState<ReactElement>();
|
|
45
36
|
|
|
46
37
|
useEffect(() => {
|
|
47
38
|
let disposed = false;
|
|
48
|
-
const loadComponent = remoteLoader(
|
|
39
|
+
const loadComponent = remoteLoader();
|
|
49
40
|
|
|
50
41
|
async function load() {
|
|
51
42
|
try {
|
|
52
|
-
const [Component,
|
|
43
|
+
const [Component, resolved] = await loadComponent<ComponentType>(remote);
|
|
53
44
|
|
|
54
45
|
if (disposed || !Component) {
|
|
55
46
|
return;
|
|
56
47
|
}
|
|
57
48
|
|
|
58
49
|
setElement(
|
|
59
|
-
<
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
</RemoteProvider>
|
|
63
|
-
</ManifestProvider>,
|
|
50
|
+
<RemoteProvider remote={resolved}>
|
|
51
|
+
<Component {...rest} />
|
|
52
|
+
</RemoteProvider>,
|
|
64
53
|
);
|
|
65
54
|
} catch (err) {
|
|
66
55
|
if (!disposed) {
|
|
@@ -76,22 +65,16 @@ const AppshellComponent = <TProps extends ExtendedProps>({
|
|
|
76
65
|
disposed = true;
|
|
77
66
|
};
|
|
78
67
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
79
|
-
}, [remote,
|
|
68
|
+
}, [remote, ...Object.values(rest)]);
|
|
80
69
|
|
|
81
70
|
// eslint-disable-next-line no-console
|
|
82
|
-
console.debug(`rendering
|
|
71
|
+
console.debug(`rendering RemoteSlot[${remote}], loading=${!element}`);
|
|
83
72
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
84
73
|
return <>{element || fallback}</>;
|
|
85
74
|
};
|
|
86
75
|
|
|
87
|
-
|
|
76
|
+
RemoteSlot.defaultProps = {
|
|
88
77
|
fallback: undefined,
|
|
89
78
|
};
|
|
90
79
|
|
|
91
|
-
export default
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* @deprecated This component is deprecated and will be removed in future versions.
|
|
95
|
-
* Please use AppshellComponent instead.
|
|
96
|
-
*/
|
|
97
|
-
export const FederatedComponent = AppshellComponent;
|
|
80
|
+
export default RemoteSlot;
|
package/src/hooks/useRemote.ts
CHANGED
|
@@ -3,5 +3,5 @@ import React from 'react';
|
|
|
3
3
|
// eslint-disable-next-line import/no-named-as-default
|
|
4
4
|
import RemoteContext from '../contexts/RemoteContext';
|
|
5
5
|
|
|
6
|
-
/** The remote backing the nearest `
|
|
6
|
+
/** The remote backing the nearest `RemoteSlot` — it already knows its own key. */
|
|
7
7
|
export default (): AppshellRemote | undefined => React.useContext(RemoteContext);
|
package/src/index.ts
CHANGED
|
@@ -1,11 +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';
|
package/webpack.config.js
CHANGED
|
@@ -34,7 +34,10 @@ module.exports = (env, { mode }) => {
|
|
|
34
34
|
],
|
|
35
35
|
},
|
|
36
36
|
// plugins: [isDevelopment && new Visualizer()].filter(Boolean),
|
|
37
|
+
// Externalised, not bundled: `@appshell/runtime` is a shared singleton, and a copy
|
|
38
|
+
// inlined here would be a second store that no package ever reads from.
|
|
37
39
|
externals: {
|
|
40
|
+
'@appshell/runtime': '@appshell/runtime',
|
|
38
41
|
react: 'react',
|
|
39
42
|
'react-dom': 'reactDOM',
|
|
40
43
|
},
|