@appshell/react-shell 1.0.0-alpha.8 → 1.0.0-alpha.80
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 +33 -26
- package/dist/144.js +1 -1
- package/dist/466.js +2 -0
- package/dist/466.js.LICENSE.txt +9 -0
- package/dist/58.js +1 -0
- package/dist/630.js +1 -0
- package/dist/677.js +1 -0
- package/dist/85.js +2 -0
- package/dist/85.js.LICENSE.txt +9 -0
- package/dist/941.js +1 -0
- package/dist/dev/favicon.ico +0 -0
- package/dist/dev/logo192.png +0 -0
- package/dist/dev/logo512.png +0 -0
- package/dist/dev/main.js +8160 -0
- package/dist/dev/main.js.map +1 -0
- package/dist/dev/manifest.json +25 -0
- package/dist/dev/mf-manifest.json +130 -0
- package/dist/dev/mf-stats.json +150 -0
- package/dist/dev/react_src_index_ts.js +554 -0
- package/dist/dev/react_src_index_ts.js.map +1 -0
- package/dist/dev/runtime_src_index_ts.js +231 -0
- package/dist/dev/runtime_src_index_ts.js.map +1 -0
- package/dist/dev/src_bootstrap_tsx.js +768 -0
- package/dist/dev/src_bootstrap_tsx.js.map +1 -0
- package/dist/dev/vendors-node_modules_react-dom_index_js.js +30577 -0
- package/dist/dev/vendors-node_modules_react-dom_index_js.js.map +1 -0
- package/dist/dev/vendors-node_modules_react_index_js.js +2771 -0
- package/dist/dev/vendors-node_modules_react_index_js.js.map +1 -0
- package/dist/dev/vendors-node_modules_react_jsx-runtime_js.js +1345 -0
- package/dist/dev/vendors-node_modules_react_jsx-runtime_js.js.map +1 -0
- package/dist/main.js +1 -1
- package/dist/mf-manifest.json +132 -0
- package/dist/mf-stats.json +152 -0
- package/package.json +16 -8
- package/dist/190.js +0 -1
- package/dist/320.js +0 -1
- package/dist/48.js +0 -1
- package/dist/939.js +0 -1
package/README.md
CHANGED
|
@@ -17,19 +17,19 @@ Working examples can be found [here](https://github.com/appshell-org/appshell/tr
|
|
|
17
17
|
|
|
18
18
|
`@appshell/react-shell` is the browser bundle that mounts your micro-frontends. It is not a server —
|
|
19
19
|
the Appshell registry renders the shell document, inlines the resolved composition, and serves this
|
|
20
|
-
bundle at the URL an
|
|
20
|
+
bundle at the URL an application's `shellBundleUrl` points at.
|
|
21
21
|
|
|
22
22
|
**Building a micro-frontend? You do not need this package.** Run your own dev server and publish to
|
|
23
|
-
an
|
|
24
|
-
an
|
|
23
|
+
an application; the registry loads the shell bundle for you. This README is for pinning which bundle
|
|
24
|
+
an application uses, and for working on the bundle itself.
|
|
25
25
|
|
|
26
26
|
## Choosing a bundle
|
|
27
27
|
|
|
28
|
-
Every
|
|
28
|
+
Every application resolves a shell bundle. By default that is the one the registry image ships, so
|
|
29
29
|
there is nothing to configure. Point `shellBundleUrl` elsewhere to pin a version or serve from a CDN:
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
|
-
appshell
|
|
32
|
+
appshell app create my-env --shell-bundle-url https://cdn.example.com/appshell/1.2.3/main.js
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
The package publishes `dist/` and nothing else, so a registry image can serve it under a versioned
|
|
@@ -48,36 +48,43 @@ resolved by the browser, so a shared registry can point at your machine.
|
|
|
48
48
|
|
|
49
49
|
```bash
|
|
50
50
|
npm start
|
|
51
|
-
appshell
|
|
51
|
+
appshell app create shell-dev --ephemeral --shell-bundle-url http://localhost:3030/main.js
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
> **Note**
|
|
55
55
|
> Chrome and Firefox treat `localhost` as a trustworthy origin, so an `https` registry may load an
|
|
56
56
|
> `http` bundle from it. Safari is stricter — run the registry locally, or serve `main.js` over TLS.
|
|
57
57
|
|
|
58
|
-
##
|
|
58
|
+
## Application configuration
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
and
|
|
62
|
-
|
|
60
|
+
The registry supplies the root remote, its props, and the page's title, colours,
|
|
61
|
+
favicon and stylesheet, inlining them into the document it serves. None of it comes
|
|
62
|
+
from this package's environment any more.
|
|
63
|
+
|
|
64
|
+
What remains here is dev-server and CLI configuration:
|
|
63
65
|
|
|
64
66
|
```sh
|
|
65
|
-
# Public url. Defaults to localhost
|
|
66
|
-
APPSHELL_PUBLIC_URL=
|
|
67
67
|
# Port the bundle's development server listens on
|
|
68
68
|
APPSHELL_PORT=3030
|
|
69
|
-
#
|
|
70
|
-
|
|
71
|
-
#
|
|
72
|
-
|
|
73
|
-
# File to setup the environment. Defaults to .env
|
|
74
|
-
APPSHELL_ENV=.env
|
|
75
|
-
# Prefix used to specify which env vars to include when generating appshell.env.js. Leaving this empty will include ALL variables in the .env
|
|
76
|
-
APPSHELL_ENV_PREFIX=APPSHELL_
|
|
77
|
-
# Name of global variable used in the generated appshell.env.js. Defaults to window.__appshell_env__
|
|
78
|
-
APPSHELL_ENV_GLOBAL_VAR=__appshell_env__
|
|
79
|
-
# Background color of splash screen
|
|
80
|
-
APPSHELL_THEME_COLOR=
|
|
81
|
-
# Color of splash screen loading
|
|
82
|
-
APPSHELL_PRIMARY_COLOR=
|
|
69
|
+
# Registry to publish and activate against
|
|
70
|
+
APPSHELL_REGISTRY=
|
|
71
|
+
# Credential for that registry
|
|
72
|
+
APPSHELL_API_KEY=
|
|
83
73
|
```
|
|
74
|
+
|
|
75
|
+
## What fills the page before the root remote mounts
|
|
76
|
+
|
|
77
|
+
Nothing, currently. The shell renders no fallback: what covers the gap while the root
|
|
78
|
+
remote is fetched is the application's business, and it cannot come from the root
|
|
79
|
+
package itself — that package is the thing being waited for. It has to come from the
|
|
80
|
+
document the registry renders.
|
|
81
|
+
|
|
82
|
+
The shell used to ship a `Splash` component for this, configured through two env vars
|
|
83
|
+
that stopped reaching the browser when the registry took over page rendering, so it had
|
|
84
|
+
been rendering its hardcoded fallback colours for some time. It was removed rather than
|
|
85
|
+
rewired: a document-level splash paints on the document's first paint rather than after
|
|
86
|
+
the shell bundle downloads, parses and mounts React, and it can be styled by the
|
|
87
|
+
application instead of by this package.
|
|
88
|
+
|
|
89
|
+
Inner remotes are unaffected — `RemoteSlot` takes a `fallback` prop, and that has always
|
|
90
|
+
been the consumer's to supply.
|