@pushwoosh/frontend-builder-engine 4.0.0 → 4.1.0
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 +16 -19
- package/lib/eslint.config.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@ its own `knip.json` in the project root and a plain `knip` call — the shared c
|
|
|
42
42
|
### Output format
|
|
43
43
|
|
|
44
44
|
Since v4 an application builds as a native ES module: `dist/index.mjs` with `import … from "react"`
|
|
45
|
-
for every external
|
|
45
|
+
for every external. Externals resolve through the root-config `importmap`,
|
|
46
46
|
chunks and assets resolve against `import.meta.url` (`publicPath: 'auto'`). The browser floor is
|
|
47
47
|
Chrome/Edge 94, Firefox 108 (import maps), Safari/iOS 16.4. To see it from a project:
|
|
48
48
|
|
|
@@ -52,8 +52,10 @@ npx browserslist "$(node -p "require('@pushwoosh/frontend-builder-engine/lib/bro
|
|
|
52
52
|
|
|
53
53
|
## Migration from v3
|
|
54
54
|
|
|
55
|
-
v3
|
|
56
|
-
|
|
55
|
+
v3 is deprecated: its `dist/index.js` is not an ES module, and the platform loads native ES modules
|
|
56
|
+
only since root-config dropped its module loader (DEV-992), so a v3 build no longer starts there —
|
|
57
|
+
its `import()` fails with `ReferenceError: System is not defined` and the app slot stays empty.
|
|
58
|
+
Hotfixes for v3 go to the `v3` branch only. Moving a micro-frontend to v4:
|
|
57
59
|
|
|
58
60
|
1. Bump `@pushwoosh/frontend-builder-engine` to `^4.0.0` in `devDependencies`.
|
|
59
61
|
2. Replace `module.hot` with `import.meta.webpackHot` (same API):
|
|
@@ -65,21 +67,14 @@ micro-frontend moves to v4 on its own schedule. Moving one:
|
|
|
65
67
|
```
|
|
66
68
|
|
|
67
69
|
3. The build output is `dist/index.mjs` instead of `dist/index.js`. Nothing to change in CI: the
|
|
68
|
-
shared `frontend/microfrontend-release.yml` registers `index.mjs` in the import map
|
|
69
|
-
|
|
70
|
-
replace it with `index.mjs` by hand.
|
|
70
|
+
shared `frontend/microfrontend-release.yml` registers `index.mjs` in the import map, and
|
|
71
|
+
`microfrontend-dev.yml` prints the `index.mjs` override, both whenever `dist` has it.
|
|
71
72
|
4. `pushwoosh.config.js` (`applicationExternals`, `applicationWebpack`) needs no changes, unless
|
|
72
|
-
`applicationWebpack` sets `output.libraryTarget`/`output.library` or adds
|
|
73
|
-
|
|
73
|
+
`applicationWebpack` sets `output.libraryTarget`/`output.library` or adds a public-path plugin of
|
|
74
|
+
its own — drop those.
|
|
74
75
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
- root-config ships the SystemJS ↔ ESM bridge (DEV-984) — without it the first `index.mjs` in the map
|
|
79
|
-
breaks every v3 micro-frontend;
|
|
80
|
-
- `@pushwoosh/http-client`, `@pushwoosh/session-store`, `@pushwoosh/rpc-gateway-*` and
|
|
81
|
-
`@pushwoosh/rpc-v2-http-api-data` are in the map as `.mjs` (DEV-987, DEV-988) — while they are
|
|
82
|
-
`.js` (System bundles), a v4 app that imports them fails to load.
|
|
76
|
+
Every name in `defaultExternals` resolves through the root-config import map and must point at an
|
|
77
|
+
ES module (`.mjs`) there; all of them do since DEV-987/DEV-988.
|
|
83
78
|
|
|
84
79
|
### Library commands (reusable packages)
|
|
85
80
|
|
|
@@ -101,6 +96,8 @@ cd examples/library && npm install && npm start
|
|
|
101
96
|
### Release
|
|
102
97
|
|
|
103
98
|
Releases are triggered by Git tags in CI. Tag with `v*` for stable, include `beta` for beta channel.
|
|
104
|
-
v4 is released from `master`, v3
|
|
105
|
-
npm `latest`, so after a v3.x patch move `latest` back:
|
|
106
|
-
`npm dist-tag add @pushwoosh/frontend-builder-engine@<newest 4.x> latest
|
|
99
|
+
v4 is released from `master`, hotfixes for the deprecated v3 from the `v3` branch. CI publishes
|
|
100
|
+
every non-beta tag as npm `latest`, so after a v3.x patch move `latest` back:
|
|
101
|
+
`npm dist-tag add @pushwoosh/frontend-builder-engine@<newest 4.x> latest`, and re-run
|
|
102
|
+
`npm deprecate @pushwoosh/frontend-builder-engine@3.x "…"`: a deprecation covers only the versions
|
|
103
|
+
published before it.
|
package/lib/eslint.config.mjs
CHANGED
|
@@ -36,7 +36,7 @@ export default tseslint.config(
|
|
|
36
36
|
},
|
|
37
37
|
rules: {
|
|
38
38
|
...hooksPlugin.configs.recommended.rules,
|
|
39
|
-
'react-hooks/set-state-in-effect': '
|
|
39
|
+
'react-hooks/set-state-in-effect': 'error',
|
|
40
40
|
'react-hooks/refs': 'off',
|
|
41
41
|
'react-hooks/incompatible-library': 'error',
|
|
42
42
|
'react/display-name': 'off',
|