@module-federation/utilities 1.7.6 → 1.8.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/CHANGELOG.md +2 -193
- package/package.json +1 -1
- package/src/Logger.js +10 -8
- package/src/Logger.js.map +1 -1
- package/src/components/ErrorBoundary.js +16 -13
- package/src/components/ErrorBoundary.js.map +1 -1
- package/src/components/FederationBoundary.js +15 -13
- package/src/components/FederationBoundary.js.map +1 -1
- package/src/index.d.ts +0 -1
- package/src/index.js +1 -4
- package/src/index.js.map +1 -1
- package/src/types/index.d.ts +1 -3
- package/src/utils/common.d.ts +1 -4
- package/src/utils/common.js +190 -192
- package/src/utils/common.js.map +1 -1
- package/src/utils/correctImportPath.js +5 -5
- package/src/utils/correctImportPath.js.map +1 -1
- package/src/utils/importRemote.js +101 -66
- package/src/utils/importRemote.js.map +1 -1
- package/src/utils/isEmpty.js +2 -2
- package/src/utils/isEmpty.js.map +1 -1
- package/src/plugins/DelegateModulesPlugin.d.ts +0 -26
- package/src/plugins/DelegateModulesPlugin.js +0 -88
- package/src/plugins/DelegateModulesPlugin.js.map +0 -1
- package/src/utils/getRuntimeRemotes.d.ts +0 -2
- package/src/utils/getRuntimeRemotes.js +0 -50
- package/src/utils/getRuntimeRemotes.js.map +0 -1
- package/src/utils/importDelegatedModule.d.ts +0 -2
- package/src/utils/importDelegatedModule.js +0 -77
- package/src/utils/importDelegatedModule.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,52 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## [1.7.6-beta.4](https://github.com/module-federation/nextjs-mf/compare/utils-1.7.6-beta.3...utils-1.7.6-beta.4) (2023-05-16)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
## [1.7.6-beta.3](https://github.com/module-federation/nextjs-mf/compare/utils-1.7.6-beta.2...utils-1.7.6-beta.3) (2023-05-16)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
## [1.7.6-beta.2](https://github.com/module-federation/nextjs-mf/compare/utils-1.7.6-beta.1...utils-1.7.6-beta.2) (2023-05-16)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
## [1.7.6-beta.1](https://github.com/module-federation/nextjs-mf/compare/utils-1.7.6-beta.0...utils-1.7.6-beta.1) (2023-05-16)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
## [1.7.6-beta.0](https://github.com/module-federation/nextjs-mf/compare/utils-1.7.5...utils-1.7.6-beta.0) (2023-05-16)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
## [1.7.5](https://github.com/module-federation/nextjs-mf/compare/utils-1.7.5-beta.0...utils-1.7.5) (2023-05-16)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
## [1.7.5-beta.0](https://github.com/module-federation/nextjs-mf/compare/utils-1.7.4...utils-1.7.5-beta.0) (2023-05-16)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
### Bug Fixes
|
|
37
|
-
|
|
38
|
-
* Improved Share Scope Properties and Fixed Production Build Issues ([#884](https://github.com/module-federation/nextjs-mf/issues/884)) ([de7b2ce](https://github.com/module-federation/nextjs-mf/commit/de7b2cec7518f6b069818a511275e359c616bb73))
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
## [1.7.4](https://github.com/module-federation/nextjs-mf/compare/utils-1.7.3...utils-1.7.4) (2023-05-16)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
## [1.7.3](https://github.com/module-federation/nextjs-mf/compare/utils-1.7.3-beta.0...utils-1.7.3) (2023-05-13)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
## [1.7.3-beta.0](https://github.com/module-federation/nextjs-mf/compare/utils-1.7.2...utils-1.7.3-beta.0) (2023-05-13)
|
|
5
|
+
# [1.8.0](https://github.com/module-federation/nextjs-mf/compare/utils-1.7.0...utils-1.8.0) (2023-05-22)
|
|
51
6
|
|
|
52
7
|
|
|
53
8
|
### Bug Fixes
|
|
@@ -57,113 +12,7 @@ This file was generated using [@jscutlery/semver](https://github.com/jscutlery/s
|
|
|
57
12
|
|
|
58
13
|
### Features
|
|
59
14
|
|
|
60
|
-
*
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
### BREAKING CHANGES
|
|
64
|
-
|
|
65
|
-
* automaticAsyncBoundary option has been removed
|
|
66
|
-
|
|
67
|
-
* fix: exclude specific pages from page map automatically
|
|
68
|
-
|
|
69
|
-
* refactor: conslidate codebase
|
|
70
|
-
|
|
71
|
-
* fix: improve hot reload share recovery
|
|
72
|
-
|
|
73
|
-
* refactor: remove server jsonp template
|
|
74
|
-
|
|
75
|
-
* chore: remove dead code from runtime modules
|
|
76
|
-
|
|
77
|
-
* fix: clean up jsonp getCustomJsonpCode
|
|
78
|
-
|
|
79
|
-
getting chunk loading global from compiler output options
|
|
80
|
-
|
|
81
|
-
* feat: adding cleanInitArrays runtime helper
|
|
82
|
-
|
|
83
|
-
* chore: remove share scope hoist and module hoisting system
|
|
84
|
-
|
|
85
|
-
* chore: cleanup code
|
|
86
|
-
|
|
87
|
-
* chore: remove dead code from add module runtime plugin
|
|
88
|
-
|
|
89
|
-
likely can remove whole plugin in future
|
|
90
|
-
|
|
91
|
-
* chore: remove logs from delegate modules
|
|
92
|
-
|
|
93
|
-
* chore: remove old utils
|
|
94
|
-
|
|
95
|
-
* fix: add warning on auto page stitch
|
|
96
|
-
|
|
97
|
-
* fix: remove commented out code from InvertedContainerPlugin.ts
|
|
98
|
-
|
|
99
|
-
* chore: improve logging to see if its local load or remote load
|
|
100
|
-
|
|
101
|
-
* chore: clean up old custom promises factories
|
|
102
|
-
|
|
103
|
-
* fix: remove container proxy code
|
|
104
|
-
|
|
105
|
-
* fix: remove container proxy code
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
## [1.7.2](https://github.com/module-federation/nextjs-mf/compare/utils-1.7.2-beta.0...utils-1.7.2) (2023-05-03)
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
## [1.7.2-beta.0](https://github.com/module-federation/nextjs-mf/compare/utils-1.7.1...utils-1.7.2-beta.0) (2023-05-03)
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
## [1.7.1](https://github.com/module-federation/nextjs-mf/compare/utils-1.7.1-beta.0...utils-1.7.1) (2023-04-28)
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
## [1.7.1-beta.0](https://github.com/module-federation/nextjs-mf/compare/utils-1.7.0...utils-1.7.1-beta.0) (2023-04-28)
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
### Features
|
|
125
|
-
|
|
126
|
-
* Improve module chunk connections ([#802](https://github.com/module-federation/nextjs-mf/issues/802)) ([ce0bd7b](https://github.com/module-federation/nextjs-mf/commit/ce0bd7b16e080f712e6db0bdcd3955a8167c274f)), closes [#803](https://github.com/module-federation/nextjs-mf/issues/803) [#808](https://github.com/module-federation/nextjs-mf/issues/808) [#811](https://github.com/module-federation/nextjs-mf/issues/811)
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
## [1.5.1](https://github.com/module-federation/nextjs-mf/compare/utils-1.5.1-beta.0...utils-1.5.1) (2023-04-19)
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
## [1.5.1-beta.0](https://github.com/module-federation/nextjs-mf/compare/utils-1.5.0...utils-1.5.1-beta.0) (2023-04-19)
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
### Bug Fixes
|
|
138
|
-
|
|
139
|
-
* use container proxy on script VM instead of host resolver point ([2929d0f](https://github.com/module-federation/nextjs-mf/commit/2929d0f64d4b8edf268af5ca83f807a02b121861))
|
|
140
|
-
* cache busting and async quirks when mixing delegates ([1fc6e67](https://github.com/module-federation/nextjs-mf/commit/1fc6e67ee33a3efb53ff59d2b3ac333f1d42a158))
|
|
141
|
-
* get delegates working ([#527](https://github.com/module-federation/nextjs-mf/issues/527)) ([7655568](https://github.com/module-federation/nextjs-mf/commit/7655568fcef8dbfda40573deb5d3d029c101074c))
|
|
142
|
-
* improved asset pipeline ([63928b2](https://github.com/module-federation/nextjs-mf/commit/63928b28150c2c4e3adb9e14fb7aa54f5cf1578d))
|
|
143
|
-
* peer dependencies metadata ([d3a2ed0](https://github.com/module-federation/nextjs-mf/commit/d3a2ed0e378b59afdeb632d1e2e0290f05cbca19))
|
|
144
|
-
* put error triggers if delegates are passed non-primitives ([2469383](https://github.com/module-federation/nextjs-mf/commit/2469383de68a8b6ffb7375ad335a2039e563fd71))
|
|
145
|
-
* use EntryPlugin for injection of remotes ([e522c5a](https://github.com/module-federation/nextjs-mf/commit/e522c5ad2b7adcbd6c39f9c5fdb7a3e418277b7a))
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
### Features
|
|
149
|
-
|
|
150
|
-
* chunk flushing in delegates ([07aebc4](https://github.com/module-federation/nextjs-mf/commit/07aebc428166b3f19bb49071fa6745ed705413b8))
|
|
151
|
-
* chunk flushing in delegates ([f8b8af6](https://github.com/module-federation/nextjs-mf/commit/f8b8af6e9e748605dd55d19ae50b0d60b1b0a83f))
|
|
152
|
-
* chunk flushing in delegates ([5e2375f](https://github.com/module-federation/nextjs-mf/commit/5e2375f598437803105ac4bc2237f6b652554d00))
|
|
153
|
-
* delegate module support ([18c9491](https://github.com/module-federation/nextjs-mf/commit/18c94914e5429584e66be49d92781b781adddb38))
|
|
154
|
-
* delegate module support ([8dd154c](https://github.com/module-federation/nextjs-mf/commit/8dd154c261b34183b12250ce204904cd3e085658))
|
|
155
|
-
* delegates part two ([1be2686](https://github.com/module-federation/nextjs-mf/commit/1be2686624798a7df9f447b48279294985b3f592))
|
|
156
|
-
* implement basic single runtime ([2432c3e](https://github.com/module-federation/nextjs-mf/commit/2432c3ec553759ca24d17a46b696c1123a86ec5a))
|
|
157
|
-
* improve chunk correlation ([22d8afc](https://github.com/module-federation/nextjs-mf/commit/22d8afccff101044fcdeba390656950dbc6eafed))
|
|
158
|
-
* new chunk flushing system for exposed modules ([97a75d8](https://github.com/module-federation/nextjs-mf/commit/97a75d8702f2ddc5e12cff2ac4d24aca1df6f990))
|
|
159
|
-
* prepare for v7 ([7bc4b3b](https://github.com/module-federation/nextjs-mf/commit/7bc4b3bd44e0926a52d6a9cbe56f0c4d7bb700ae))
|
|
160
|
-
* support dynamic containers on server ([a2a81dd](https://github.com/module-federation/nextjs-mf/commit/a2a81dd4d54da55dfc132583d9e0d7c75771fb4c))
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
### BREAKING CHANGES
|
|
164
|
-
|
|
165
|
-
* safety breaking change note
|
|
166
|
-
BREAKING_CHANGE: safety breaking change note
|
|
15
|
+
* **website:** initial version of module federation website ([#751](https://github.com/module-federation/nextjs-mf/issues/751)) ([9b4ec04](https://github.com/module-federation/nextjs-mf/commit/9b4ec048652f0d2237e9401912ead7c5bbe060c4))
|
|
167
16
|
|
|
168
17
|
|
|
169
18
|
|
|
@@ -185,46 +34,6 @@ BREAKING_CHANGE: safety breaking change note
|
|
|
185
34
|
|
|
186
35
|
|
|
187
36
|
|
|
188
|
-
## [1.5.1](https://github.com/module-federation/nextjs-mf/compare/utils-1.5.1-beta.0...utils-1.5.1) (2023-04-19)
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
## [1.5.1-beta.0](https://github.com/module-federation/nextjs-mf/compare/utils-1.5.0...utils-1.5.1-beta.0) (2023-04-19)
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
### Bug Fixes
|
|
196
|
-
|
|
197
|
-
* use container proxy on script VM instead of host resolver point ([2929d0f](https://github.com/module-federation/nextjs-mf/commit/2929d0f64d4b8edf268af5ca83f807a02b121861))
|
|
198
|
-
* cache busting and async quirks when mixing delegates ([1fc6e67](https://github.com/module-federation/nextjs-mf/commit/1fc6e67ee33a3efb53ff59d2b3ac333f1d42a158))
|
|
199
|
-
* get delegates working ([#527](https://github.com/module-federation/nextjs-mf/issues/527)) ([7655568](https://github.com/module-federation/nextjs-mf/commit/7655568fcef8dbfda40573deb5d3d029c101074c))
|
|
200
|
-
* improved asset pipeline ([63928b2](https://github.com/module-federation/nextjs-mf/commit/63928b28150c2c4e3adb9e14fb7aa54f5cf1578d))
|
|
201
|
-
* peer dependencies metadata ([d3a2ed0](https://github.com/module-federation/nextjs-mf/commit/d3a2ed0e378b59afdeb632d1e2e0290f05cbca19))
|
|
202
|
-
* put error triggers if delegates are passed non-primitives ([2469383](https://github.com/module-federation/nextjs-mf/commit/2469383de68a8b6ffb7375ad335a2039e563fd71))
|
|
203
|
-
* use EntryPlugin for injection of remotes ([e522c5a](https://github.com/module-federation/nextjs-mf/commit/e522c5ad2b7adcbd6c39f9c5fdb7a3e418277b7a))
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
### Features
|
|
207
|
-
|
|
208
|
-
* chunk flushing in delegates ([07aebc4](https://github.com/module-federation/nextjs-mf/commit/07aebc428166b3f19bb49071fa6745ed705413b8))
|
|
209
|
-
* chunk flushing in delegates ([f8b8af6](https://github.com/module-federation/nextjs-mf/commit/f8b8af6e9e748605dd55d19ae50b0d60b1b0a83f))
|
|
210
|
-
* chunk flushing in delegates ([5e2375f](https://github.com/module-federation/nextjs-mf/commit/5e2375f598437803105ac4bc2237f6b652554d00))
|
|
211
|
-
* delegate module support ([18c9491](https://github.com/module-federation/nextjs-mf/commit/18c94914e5429584e66be49d92781b781adddb38))
|
|
212
|
-
* delegate module support ([8dd154c](https://github.com/module-federation/nextjs-mf/commit/8dd154c261b34183b12250ce204904cd3e085658))
|
|
213
|
-
* delegates part two ([1be2686](https://github.com/module-federation/nextjs-mf/commit/1be2686624798a7df9f447b48279294985b3f592))
|
|
214
|
-
* implement basic single runtime ([2432c3e](https://github.com/module-federation/nextjs-mf/commit/2432c3ec553759ca24d17a46b696c1123a86ec5a))
|
|
215
|
-
* improve chunk correlation ([22d8afc](https://github.com/module-federation/nextjs-mf/commit/22d8afccff101044fcdeba390656950dbc6eafed))
|
|
216
|
-
* new chunk flushing system for exposed modules ([97a75d8](https://github.com/module-federation/nextjs-mf/commit/97a75d8702f2ddc5e12cff2ac4d24aca1df6f990))
|
|
217
|
-
* prepare for v7 ([7bc4b3b](https://github.com/module-federation/nextjs-mf/commit/7bc4b3bd44e0926a52d6a9cbe56f0c4d7bb700ae))
|
|
218
|
-
* support dynamic containers on server ([a2a81dd](https://github.com/module-federation/nextjs-mf/commit/a2a81dd4d54da55dfc132583d9e0d7c75771fb4c))
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
### BREAKING CHANGES
|
|
222
|
-
|
|
223
|
-
* safety breaking change note
|
|
224
|
-
BREAKING_CHANGE: safety breaking change note
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
37
|
# [1.5.0](https://github.com/module-federation/nextjs-mf/compare/utils-1.4.1...utils-1.5.0) (2023-04-09)
|
|
229
38
|
|
|
230
39
|
|
package/package.json
CHANGED
package/src/Logger.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Logger = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return this.loggerInstance;
|
|
4
|
+
var Logger = exports.Logger = /** @class */ (function () {
|
|
5
|
+
function Logger() {
|
|
7
6
|
}
|
|
8
|
-
|
|
7
|
+
Logger.getLogger = function () {
|
|
8
|
+
return this.loggerInstance;
|
|
9
|
+
};
|
|
10
|
+
Logger.setLogger = function (logger) {
|
|
9
11
|
this.loggerInstance = logger || console;
|
|
10
12
|
return logger;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
Logger
|
|
14
|
-
|
|
13
|
+
};
|
|
14
|
+
Logger.loggerInstance = console;
|
|
15
|
+
return Logger;
|
|
16
|
+
}());
|
|
15
17
|
//# sourceMappingURL=Logger.js.map
|
package/src/Logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logger.js","sourceRoot":"","sources":["../../../../packages/utilities/src/Logger.ts"],"names":[],"mappings":";;;AAIA,
|
|
1
|
+
{"version":3,"file":"Logger.js","sourceRoot":"","sources":["../../../../packages/utilities/src/Logger.ts"],"names":[],"mappings":";;;AAIA;IAAA;IAWA,CAAC;IARQ,gBAAS,GAAhB;QACE,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAEM,gBAAS,GAAhB,UAAiB,MAA6B;QAC5C,IAAI,CAAC,cAAc,GAAG,MAAM,IAAI,OAAO,CAAC;QACxC,OAAO,MAAM,CAAC;IAChB,CAAC;IATc,qBAAc,GAAmB,OAAO,CAAC;IAU1D,aAAC;CAAA,AAXD,IAWC"}
|
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var react_1 = tslib_1.__importDefault(require("react"));
|
|
5
5
|
/**
|
|
6
6
|
* Generic error boundary component.
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
var ErrorBoundary = /** @class */ (function (_super) {
|
|
9
|
+
tslib_1.__extends(ErrorBoundary, _super);
|
|
10
|
+
function ErrorBoundary(props) {
|
|
11
|
+
var _this = _super.call(this, props) || this;
|
|
12
|
+
_this.state = {
|
|
12
13
|
hasError: false,
|
|
13
14
|
};
|
|
15
|
+
return _this;
|
|
14
16
|
}
|
|
15
|
-
|
|
17
|
+
ErrorBoundary.getDerivedStateFromError = function ( /*error: Error*/) {
|
|
16
18
|
return {
|
|
17
19
|
hasError: true,
|
|
18
20
|
};
|
|
19
|
-
}
|
|
20
|
-
componentDidCatch(error, errorInfo) {
|
|
21
|
+
};
|
|
22
|
+
ErrorBoundary.prototype.componentDidCatch = function (error, errorInfo) {
|
|
21
23
|
console.error(error, errorInfo);
|
|
22
|
-
}
|
|
23
|
-
render() {
|
|
24
|
+
};
|
|
25
|
+
ErrorBoundary.prototype.render = function () {
|
|
24
26
|
if (this.state.hasError) {
|
|
25
27
|
return 'An error has occurred.';
|
|
26
28
|
}
|
|
27
29
|
return this.props.children;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
+
};
|
|
31
|
+
return ErrorBoundary;
|
|
32
|
+
}(react_1.default.Component));
|
|
30
33
|
exports.default = ErrorBoundary;
|
|
31
34
|
//# sourceMappingURL=ErrorBoundary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../../../../packages/utilities/src/components/ErrorBoundary.tsx"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../../../../packages/utilities/src/components/ErrorBoundary.tsx"],"names":[],"mappings":";;;AAAA,wDAA8C;AAU9C;;GAEG;AACH;IAA4B,yCAG3B;IACC,uBAAY,KAAyB;QAArC,YACE,kBAAM,KAAK,CAAC,SAIb;QAHC,KAAI,CAAC,KAAK,GAAG;YACX,QAAQ,EAAE,KAAK;SAChB,CAAC;;IACJ,CAAC;IAEM,sCAAwB,GAA/B,WAAgC,gBAAgB;QAC9C,OAAO;YACL,QAAQ,EAAE,IAAI;SACf,CAAC;IACJ,CAAC;IAEQ,yCAAiB,GAA1B,UAA2B,KAAY,EAAE,SAAoB;QAC3D,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAClC,CAAC;IAEQ,8BAAM,GAAf;QACE,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;YACvB,OAAO,wBAAwB,CAAC;SACjC;QAED,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC7B,CAAC;IACH,oBAAC;AAAD,CAAC,AA5BD,CAA4B,eAAK,CAAC,SAAS,GA4B1C;AAED,kBAAe,aAAa,CAAC"}
|
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var react_1 = tslib_1.__importStar(require("react"));
|
|
5
|
+
var dynamic_1 = tslib_1.__importDefault(require("next/dynamic"));
|
|
6
|
+
var ErrorBoundary_1 = tslib_1.__importDefault(require("./ErrorBoundary"));
|
|
7
7
|
/**
|
|
8
8
|
* A fallback component that renders nothing.
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
var FallbackComponent = function () {
|
|
11
11
|
return null;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
14
|
* Wrapper around dynamic import.
|
|
15
15
|
* Adds error boundaries and fallback options.
|
|
16
16
|
*/
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
return (0, dynamic_1.default)(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
var FederationBoundary = function (_a) {
|
|
18
|
+
var dynamicImporter = _a.dynamicImporter, _b = _a.fallback, fallback = _b === void 0 ? function () { return Promise.resolve(FallbackComponent); } : _b, _c = _a.customBoundary, CustomBoundary = _c === void 0 ? ErrorBoundary_1.default : _c, rest = tslib_1.__rest(_a, ["dynamicImporter", "fallback", "customBoundary"]);
|
|
19
|
+
var ImportResult = (0, react_1.useMemo)(function () {
|
|
20
|
+
return (0, dynamic_1.default)(function () {
|
|
21
|
+
return dynamicImporter().catch(function (e) {
|
|
22
|
+
console.error(e);
|
|
23
|
+
return fallback();
|
|
24
|
+
});
|
|
25
|
+
}, {
|
|
24
26
|
ssr: false,
|
|
25
27
|
});
|
|
26
28
|
}, [dynamicImporter, fallback]);
|
|
27
29
|
return (react_1.default.createElement(CustomBoundary, null,
|
|
28
|
-
react_1.default.createElement(ImportResult,
|
|
30
|
+
react_1.default.createElement(ImportResult, tslib_1.__assign({}, rest))));
|
|
29
31
|
};
|
|
30
32
|
exports.default = FederationBoundary;
|
|
31
33
|
//# sourceMappingURL=FederationBoundary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FederationBoundary.js","sourceRoot":"","sources":["../../../../../packages/utilities/src/components/FederationBoundary.tsx"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"FederationBoundary.js","sourceRoot":"","sources":["../../../../../packages/utilities/src/components/FederationBoundary.tsx"],"names":[],"mappings":";;;AAAA,qDAAuC;AAEvC,iEAAmC;AACnC,0EAA4C;AAE5C;;GAEG;AACH,IAAM,iBAAiB,GAAa;IAClC,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAaF;;;GAGG;AACH,IAAM,kBAAkB,GAAsC,UAAC,EAK9D;IAJC,IAAA,eAAe,qBAAA,EACf,gBAAmD,EAAnD,QAAQ,mBAAG,cAAM,OAAA,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAlC,CAAkC,KAAA,EACnD,sBAA8C,EAA9B,cAAc,mBAAG,uBAAa,KAAA,EAC3C,IAAI,sBAJsD,iDAK9D,CADQ;IAEP,IAAM,YAAY,GAAG,IAAA,eAAO,EAAC;QAC3B,OAAO,IAAA,iBAAO,EACZ;YACE,OAAA,eAAe,EAAE,CAAC,KAAK,CAAC,UAAC,CAAQ;gBAC/B,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBACjB,OAAO,QAAQ,EAAE,CAAC;YACpB,CAAC,CAAC;QAHF,CAGE,EACJ;YACE,GAAG,EAAE,KAAK;SACX,CACF,CAAC;IACJ,CAAC,EAAE,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC;IAEhC,OAAO,CACL,8BAAC,cAAc;QACb,8BAAC,YAAY,uBAAK,IAAI,EAAI,CACX,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,kBAAkB,CAAC"}
|
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
5
4
|
tslib_1.__exportStar(require("./types"), exports);
|
|
6
5
|
tslib_1.__exportStar(require("./utils/common"), exports);
|
|
7
6
|
tslib_1.__exportStar(require("./utils/isEmpty"), exports);
|
|
8
7
|
tslib_1.__exportStar(require("./utils/importRemote"), exports);
|
|
9
8
|
tslib_1.__exportStar(require("./utils/correctImportPath"), exports);
|
|
10
9
|
tslib_1.__exportStar(require("./Logger"), exports);
|
|
11
|
-
var getRuntimeRemotes_1 = require("./utils/getRuntimeRemotes");
|
|
12
|
-
Object.defineProperty(exports, "getRuntimeRemotes", { enumerable: true, get: function () { return getRuntimeRemotes_1.getRuntimeRemotes; } });
|
|
13
10
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/utilities/src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/utilities/src/index.ts"],"names":[],"mappings":";;;AAAA,kDAAwB;AACxB,yDAA+B;AAC/B,0DAAgC;AAChC,+DAAqC;AACrC,oEAA0C;AAC1C,mDAAyB"}
|
package/src/types/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export interface NextFederationPluginExtraOptions {
|
|
|
19
19
|
exposePages?: boolean;
|
|
20
20
|
skipSharingNextInternals?: boolean;
|
|
21
21
|
automaticPageStitching?: boolean;
|
|
22
|
+
automaticAsyncBoundary?: boolean;
|
|
22
23
|
}
|
|
23
24
|
export interface NextFederationPluginOptions extends ModuleFederationPluginOptions {
|
|
24
25
|
extraOptions: NextFederationPluginExtraOptions;
|
|
@@ -44,8 +45,6 @@ export type RemoteData = {
|
|
|
44
45
|
};
|
|
45
46
|
export type RuntimeRemote = Partial<RemoteData> & {
|
|
46
47
|
asyncContainer?: AsyncContainer;
|
|
47
|
-
global?: string;
|
|
48
|
-
url?: string;
|
|
49
48
|
};
|
|
50
49
|
export type RuntimeRemotesMap = Record<string, RuntimeRemote>;
|
|
51
50
|
type Module = WebpackOptionsNormalized['module'];
|
|
@@ -65,5 +64,4 @@ export type GetModuleOptions = {
|
|
|
65
64
|
exportName?: string;
|
|
66
65
|
remoteContainer: string | RemoteData;
|
|
67
66
|
};
|
|
68
|
-
export type RemoteVars = Record<string, Promise<WebpackRemoteContainer> | string | (() => Promise<WebpackRemoteContainer>)>;
|
|
69
67
|
export {};
|
package/src/utils/common.d.ts
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { RemoteVars } from '../types';
|
|
3
|
-
export declare const remoteVars: RemoteVars;
|
|
1
|
+
import type { Remotes, RuntimeRemote, WebpackRemoteContainer, RemoteData, GetModuleOptions } from '../types';
|
|
4
2
|
export declare const extractUrlAndGlobal: (urlAndGlobal: string) => [string, string];
|
|
5
3
|
export declare const importDelegatedModule: (keyOrRuntimeRemoteItem: string | RuntimeRemote) => Promise<any>;
|
|
6
4
|
export declare const createDelegatedModule: (delegate: string, params: {
|
|
7
5
|
[key: string]: any;
|
|
8
6
|
}) => string;
|
|
9
|
-
export declare const loadScript: (keyOrRuntimeRemoteItem: string | RuntimeRemote) => any;
|
|
10
7
|
/**
|
|
11
8
|
* Return initialized remote container by remote's key or its runtime remote item data.
|
|
12
9
|
*
|