@patternslib/dev 4.0.1 → 4.1.0-alpha.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/CHANGES.md CHANGED
@@ -2,824 +2,103 @@
2
2
 
3
3
 
4
4
 
5
- ## [4.0.1](https://github.com/Patternslib/dev/compare/4.0.0...4.0.1) (2026-09-05)
6
-
7
- ### Bug Fixes
8
-
9
-
10
- * Fix problems with recent releases. ([ece3ae5](https://github.com/Patternslib/dev/commit/ece3ae5342157097f35b9bba0829c685661b5456))
11
-
12
- The following problems are now fixed:
13
-
14
- - Whole history included in new changelog entries.
15
- - No dist/ published due to silent failures.
16
- - No GitHub release page updates.
17
- - No GutHub bundle zip upload.
18
-
19
-
20
- ### Maintenance
21
-
22
-
23
- * **release-it:** Allow to release from version-branches (e.g. 2.0.x or 2.x). ([c4cd074](https://github.com/Patternslib/dev/commit/c4cd074b6e2b689fec3e28b0c0855b7503c7a06f))
24
-
25
- ## [4.0.0](https://github.com/Patternslib/dev/compare/3.9.0-alpha.1...4.0.0) (2026-04-23)
26
-
27
- ### Features
28
-
29
-
30
- * Makefile: Release npm and github in one go, avoiding many of the quirks like double builds and double changelog generation. ([8f01836](https://github.com/Patternslib/dev/commit/8f018368819be86bc9c4e703f7d9574a16fc3322))
31
-
32
-
33
- * Makefile: Update browserslist database before bundling. ([8e3da59](https://github.com/Patternslib/dev/commit/8e3da5993cc657bf8aee3fef40fcc414f0ed3cff))
34
-
35
- Makefiles extending from this Makefile need to switch to a double-colon
36
- target (``bundle-pre::``), so that the base target is also run.
37
-
38
-
39
- ### Bug Fixes
40
-
41
-
42
- * Makefile‌: checkout changes before running release-it which would break if it is modified. ([db0e89e](https://github.com/Patternslib/dev/commit/db0e89ec0fb918cd64accdd2c285e09202936396))
43
-
44
-
45
- * Remove version pin for conventional-changelog-conventionalcommits. This is finally fixed upstream in conventional-changelog/commitlint. ([333c802](https://github.com/Patternslib/dev/commit/333c802d9913e18fe8673b2263a24776bba9bc34))
46
-
47
-
48
- ### Maintenance
49
-
50
-
51
- * Add missing @eslint/js dependency. ([02eb557](https://github.com/Patternslib/dev/commit/02eb5573591d13f114f7fce0b9e81b8ad07fd986))
52
-
53
-
54
- * eslint latest ECMA script and drop @babel/eslint-parser. ([efdc5f1](https://github.com/Patternslib/dev/commit/efdc5f145b1a3bb32c4c2469e8aeeec8b0d29e44))
55
-
56
- The current @babel/eslint-parser version 7 is not compatible with
57
- eslint 10. Also eslint supports with the latest ECMA script version
58
- configuration recent enough JavaScript, so that we can drop the
59
- dependency on @babel/eslint-parser.
60
-
61
-
62
- * Upgrade dependencies. ([4ae9820](https://github.com/Patternslib/dev/commit/4ae98209d0ff5a2e3db882996c4b462cb94ca6a6))
63
-
64
- NOTE: you might need to update your tests for Jest 30.3.0 support.
65
- E.g. expect.toThrowError has changed to expect.toThrow.
66
- See: https://jestjs.io/docs/upgrading-to-jest30
67
-
68
- ## 3.9.0-alpha.1 (2025-12-17)
69
-
70
- ### Bug Fixes
71
-
72
-
73
- * Fix GLOB for JS in .editorconfig config. ([f1de9ba](https://github.com/Patternslib/dev/commit/f1de9baf27740f6f694cdc6940faaadeea0dad3f))
74
-
75
-
76
- ### Maintenance
77
-
78
-
79
- * Pin conventional-changelog-conventionalcommits. ([369e6a6](https://github.com/Patternslib/dev/commit/369e6a6e8b309d6c07c69173a06f9900ba65256b))
80
-
81
- This should solve the conventional changelog upgrade problem related to:
82
- https://github.com/release-it/conventional-changelog/issues/110.
83
-
84
-
85
- * Upgrade commitlint and conventional-changelog. ([987206d](https://github.com/Patternslib/dev/commit/987206d0305739e309108a421d87e7d401cfd4e6))
86
-
87
-
88
- * Upgrade dependencies. ([666d225](https://github.com/Patternslib/dev/commit/666d225c1c8a601fe39fceb65cb739460e4fc449))
89
-
90
- ## 3.9.0-alpha.0 (2025-09-20)
91
-
92
- ### Features
93
-
94
-
95
- * Add prettier Makefile target to format files. ([c84e312](https://github.com/Patternslib/dev/commit/c84e31255f914982c45e0025625951556df27f9e))
96
-
97
-
98
- ### Maintenance
99
-
100
-
101
- * Install caniuse-lite and maintain it at it's latest version. ([43ebf53](https://github.com/Patternslib/dev/commit/43ebf535b1b1fc6cd43bd38ad3080f3a1ce6ef7b))
102
-
103
- Explicitly install caniuse-lite, which is used by browserslist, webpack,
104
- babel etc.
105
- This allows us to maintain it ourselves at the latest version and prevent build
106
- messages to update the browserslist database.
107
-
108
-
109
- * Update the compatible node version to the current LTS version. ([9bdc66e](https://github.com/Patternslib/dev/commit/9bdc66e9b04d44c6fbb68c6ae3ab1a3165f235f6))
110
-
111
-
112
- * Upgrade dependencies. ([137063d](https://github.com/Patternslib/dev/commit/137063d0c697c500847b315dfc89ef5799ad791d))
113
-
114
- ## 3.8.1 (2025-05-08)
115
-
116
- ### Maintenance
117
-
118
-
119
- * Downgrade @release-it/conventional-changelog to < 9 again. ([f02e92b](https://github.com/Patternslib/dev/commit/f02e92bfe414f60a213f6cc2dac4c660f2686c56))
120
-
121
- The resolutions are not passed to client packages, so we still end up
122
- installing conventtional-changelog-conventionalcommits 7 and 8, where we
123
- need only 8. Staying on @release-it/conventional-changelog version 8
124
- until this is fixed upstream.
125
-
126
- See: https://github.com/release-it/conventional-changelog/issues/110.
127
-
128
- ## 3.8.0 (2025-05-08)
5
+ ## [4.1.0-alpha.0](https://github.com/Patternslib/dev/compare/4.0.2...4.1.0-alpha.0) (2026-09-11)
129
6
 
130
7
  ### Features
131
8
 
132
9
 
133
- * Add new changelog category "tech" for technical changes which are not user-visible features. ([a3785df](https://github.com/Patternslib/dev/commit/a3785df8e992e61bf7fbe5214d066b6cec03e069))
134
-
135
-
136
- ### Maintenance
137
-
138
-
139
- * Upgrade dependencies. ([96b7bcd](https://github.com/Patternslib/dev/commit/96b7bcd2f83214ac83faf041afbcb7331d9b6f7b))
140
-
141
- ## 3.7.4 (2025-05-06)
142
-
143
- ### Bug Fixes
144
-
145
-
146
- * Pin conventional-changelog-conventionalcommits to ^8.0.0 for support of @release-it/conventional-changelog > 9. ([428f974](https://github.com/Patternslib/dev/commit/428f9744dc9f0f16d0298024f40f9b0ab295aef4))
147
-
148
- See: https://github.com/release-it/conventional-changelog/issues/110.
149
-
150
-
151
- ### Maintenance
152
-
153
-
154
- * Upgrade dependencies. ([12e7f38](https://github.com/Patternslib/dev/commit/12e7f388d28fd07f4cc49401ab6eb3edce177f8f))
155
-
156
- ## 3.7.3 (2025-04-04)
157
-
158
- ### Maintenance
159
-
10
+ * **module federation:** resolve a promise once all remote bundles are initialized ([e2f0f22](https://github.com/Patternslib/dev/commit/e2f0f22d6433960ddd297fd15e53f752a30a9486))
160
11
 
161
- * Upgrade dependencies. ([2a61f15](https://github.com/Patternslib/dev/commit/2a61f1507eb082ab4839d093642709ad41745c58))
12
+ The document-ready handler started the initialization of all Module
13
+ Federation remote bundles but did not wait for them: the
14
+ ``patternslib__mf--loaded`` event fired before any remote had actually
15
+ loaded and run its main module. Consumers had no way to know when the
16
+ remotes' patterns and components were registered.
162
17
 
18
+ The helper now initializes all remotes in parallel, waits for all of
19
+ them to settle (a failing remote is logged and does not block the
20
+ others), and only then dispatches the event. The new promise
21
+ ``window.__patternslib_mf_initialized`` is created at module load time,
22
+ so it can be awaited by code running before or after document ready —
23
+ the Patternslib registry uses it to defer the initial DOM scan.
163
24
 
164
- * Upgrade dependencies. ([c6fca14](https://github.com/Patternslib/dev/commit/c6fca142f6f55efe1633e9eba361f4fb7f17f7f3))
25
+ A remote's main module usually only does ``import("./bundle")`` — the
26
+ async boundary needed to consume shared modules — and the registrations
27
+ happen in that chunk. If the main module exports that promise as its
28
+ default export (``export default import("./bundle")``), the helper
29
+ waits for it as well. Remotes without the export keep working as
30
+ before.
165
31
 
166
- ## 3.7.2 (2025-02-14)
167
32
 
168
33
  ### Bug Fixes
169
34
 
170
35
 
171
- * Fix postinstall when no make upgrade is available. ([616be80](https://github.com/Patternslib/dev/commit/616be8076c60fa2e4753d2d0f0fab66de94caecb))
172
-
173
- ## 3.7.1 (2025-02-14)
174
-
175
- ### Maintenance
176
-
177
-
178
- * Downgrade conventional-changelog to not break our Changelog templates. ([18aa235](https://github.com/Patternslib/dev/commit/18aa235ff66d732014ce8ba2423c52d859d794d3))
179
-
180
- ## 3.7.0 (2025-02-13)
181
-
182
- ### Maintenance
183
-
184
-
185
- * Add postinstall script to upgrade dev. ([16b900d](https://github.com/Patternslib/dev/commit/16b900d554591c4c6511b2cbd3f503dc882b14d1))
186
-
187
- Note: the "make upgrade" target is run in the directory where npm
188
- install is invoked. If you install "@patternslib/dev" as a dependency in
189
- "@pattersnlib/patternslib", the Patternslib project is upgraded.
190
-
191
-
192
- * Add upgrade to remove husky. ([6e3629c](https://github.com/Patternslib/dev/commit/6e3629c08c349224b48863d9e922cce303c4e2c4))
36
+ * Cleanup changelog entries. ([c311b84](https://github.com/Patternslib/dev/commit/c311b84d22c3c10721525d3c56423d7a200d4450))
193
37
 
194
-
195
- * Directly use git's commit hooks and remove dependency on husky. ([ae05dd3](https://github.com/Patternslib/dev/commit/ae05dd37bc3df6261db4a5eecbaed3d789812300))
196
-
197
-
198
- * Makefile: Define targets as phony, if they are. ([d4c63b7](https://github.com/Patternslib/dev/commit/d4c63b71909c07dc1915f755c5f54da0dd3e5737))
199
-
200
-
201
- * Makefile: Let the install target depend on yarn.lock file to allow reinstalls when yarn.lock changes. ([9de2d28](https://github.com/Patternslib/dev/commit/9de2d28d15601ec8c81527753ba480eac7bc720d))
202
-
203
-
204
- * Upgrade dependencies. ([74027e8](https://github.com/Patternslib/dev/commit/74027e89abe08a511a8d6f9c82a2e852c36584d6))
205
-
206
-
207
- * Upgrade to eslint v9. ([1279e70](https://github.com/Patternslib/dev/commit/1279e70f4f276a46eb0459cd0b6dd1ab628c4c44))
208
-
209
- ## 3.6.1 (2024-08-14)
38
+ ## [4.0.2](https://github.com/Patternslib/dev/compare/4.0.1...4.0.2) (2026-09-05)
210
39
 
211
40
  ### Bug Fixes
212
41
 
42
+ - Fix repeated changelog entries. ([1a1095d](https://github.com/Patternslib/dev/commit/1a1095d500fbc9a9148142d7a1181b1479743a8d))
213
43
 
214
- * Webpack style loader. ([ecec3cf](https://github.com/Patternslib/dev/commit/ecec3cf5654050c8ec96a924fcaa8bad618d526c))
215
-
216
- Webpack style loader's insert option needs a different way to reference functions.
217
- Also deprecate webpack-helpers module.
218
-
219
- ## 3.6.0 (2024-08-14)
220
-
221
- ### Features
222
-
223
-
224
- * Add husky commitlint also to this package. ([1bdcf63](https://github.com/Patternslib/dev/commit/1bdcf636324a0a05946754af84faa78c4c7f71f4))
44
+ When releasing the changelog file got messed up by repeating already
45
+ included changelog entries. That was due to a setting, which should have
46
+ combined all pre-release changes into a final release.
225
47
 
48
+ This was given up in favor of a clean changelog entry list. The final
49
+ release will not combine all pre-release changes. This is what most
50
+ projects do anyways, so this change is fine, IMO.
226
51
 
227
- * Add WebP as asset/resource along to the other formats for the Webpack loader. ([58f369c](https://github.com/Patternslib/dev/commit/58f369c256eadd3f631f0ea79ed509a93fdfd3d1))
228
-
229
-
230
- ### Bug Fixes
231
-
232
-
233
- * Do not upgrade husky and keep at pre 9.x. ([fe89852](https://github.com/Patternslib/dev/commit/fe8985223c11cc4258e44e475aeebaa1926ed327))
234
-
235
- Husky has some breaking changes which we should only upgrade with the next major release of @patternslib/dev.
236
-
237
-
238
- * Require minimum node v18.18. ([807147a](https://github.com/Patternslib/dev/commit/807147a98527520b7455061629a04ebac6941740))
239
-
240
- This is Webpack's minimum required version.
241
- Note: As time of this commit, versions below 18 are unmaintained.
242
-
243
-
244
- ### Maintenance
245
-
246
-
247
- * Remove plugin-transform-optional-chaining from babel. ([9facee8](https://github.com/Patternslib/dev/commit/9facee8b35a9f09c24c6e466228503d0a257445b))
248
-
249
- The optional chaining feature is already included in preset-env ES2020.
250
-
251
-
252
- * Upgrade dependencies. ([c3d64fd](https://github.com/Patternslib/dev/commit/c3d64fdd0c543e199e04088fc661c7bd9315bbe3))
253
-
254
- Upgrade all except eslint, which needs to migrate from `.eslintrc.js` to
255
- `eslint.config.js`. This will be done in an upcoming major release.
256
-
257
-
258
- * Upgrade GitHub Actions node version. ([4c96faa](https://github.com/Patternslib/dev/commit/4c96faa2e34b4fdf50d2d38b6a230704f7d9c7ed))
259
-
260
-
261
- * Upgrade GitHub Actions. ([f687bee](https://github.com/Patternslib/dev/commit/f687bee3dcd94b50b14fd5df3370aa9ecf245943))
262
-
263
- ## 3.5.3 (2023-11-23)
264
-
265
- ### Maintenance
266
-
267
-
268
- * Upgrade dependencies. ([8c20da1](https://github.com/Patternslib/dev/commit/8c20da1249a793c6deac64f4cddcb46932e8efa4))
269
-
270
- ## 3.5.2 (2023-10-16)
271
-
272
- ### Maintenance
273
-
274
-
275
- * Upgrade dependencies. ([e5fb5b8](https://github.com/Patternslib/dev/commit/e5fb5b8bb004eb5990d6326fe93d8ed02cbbf362))
276
-
277
- ## 3.5.1 (2023-09-23)
278
-
279
- ### Maintenance
280
-
281
-
282
- * Upgrade dependencies. ([b1ffc64](https://github.com/Patternslib/dev/commit/b1ffc6453551b7312e4643f4f6aa679286baa379))
283
-
284
- ## 3.5.0 (2023-08-30)
285
-
286
- ### Features
287
-
288
-
289
- * **Tests:** Add helper for conditional test skipping and node version parsing. ([611b77b](https://github.com/Patternslib/dev/commit/611b77b2b4469226ebcf942e5b68851e7927c630))
290
-
291
-
292
- ### Maintenance
293
-
294
-
295
- * Upgrade dependencies. ([1e146a9](https://github.com/Patternslib/dev/commit/1e146a99047786ffbf69cc0da97763885af3736f))
296
-
297
- ## 3.4.1 (2023-08-11)
298
-
299
- ### Bug Fixes
300
-
301
-
302
- * Correct comment in Makefile. ([5fb33c6](https://github.com/Patternslib/dev/commit/5fb33c6f94464c8df5678556197bac4692d6b878))
303
-
304
-
305
- ### Maintenance
306
-
307
-
308
- * Upgrade dependencies. ([4fcf179](https://github.com/Patternslib/dev/commit/4fcf1791317ad8bc6b06cc1406eeb5672c3e2a4d))
309
-
310
- ## 3.4.0 (2023-07-27)
311
-
312
- ### Maintenance
313
-
314
-
315
- * Depend on the minimum actively maintained Node.js version >= 16. ([603a024](https://github.com/Patternslib/dev/commit/603a024f1962d7731d8aa09457c90c48c73f2302))
316
-
317
-
318
- * Upgrade dependencies. ([b3bb92f](https://github.com/Patternslib/dev/commit/b3bb92f0e78c723fb20950e0a47404d9fd2f47af))
319
-
320
- ## 3.3.5 (2023-05-29)
321
-
322
- ### Bug Fixes
323
-
324
-
325
- * Fix hook config from 3.3.4. ([b4f02f6](https://github.com/Patternslib/dev/commit/b4f02f69fda38b8c6a0ef8402511fc8cd87eff9d))
326
-
327
- ## 3.3.4 (2023-05-29)
328
-
329
- ### Bug Fixes
330
-
331
-
332
- * Include the correct bundle version in entry file header comment. ([ea32b4d](https://github.com/Patternslib/dev/commit/ea32b4dd9e6bc02fcbc4011798174eb0e057dd82))
333
-
334
- In order to have the correct version specifier in the bundle's entry
335
- script header comment the bundle must be built after the version bump.
336
- Use release-it hooks to do that.
337
-
338
-
339
- ### Maintenance
340
-
341
-
342
- * Upgrade dependencies. ([56eda65](https://github.com/Patternslib/dev/commit/56eda655d463fa8c0e3fb36a4b35d258a22bf815))
343
-
344
- ## 3.3.3 (2023-05-28)
345
-
346
- ### Bug Fixes
347
-
348
-
349
- * Add pre-built bundles to the npm distribution again. ([c85dbdc](https://github.com/Patternslib/dev/commit/c85dbdc22cf3a29017677020fcd8e2acc65803b7))
350
-
351
- This was lost in a previous Makefile update.
352
- Now you can again reference jsdelivr and and unpkg to include bundles.
353
-
354
-
355
- * Change optional chaining babel plugin name. ([e57793a](https://github.com/Patternslib/dev/commit/e57793a4abf59d3859aaa8ba757cbd0d41871396))
356
-
357
-
358
- ### Maintenance
359
-
360
-
361
- * Remove dependency on semver which is not needed since the recent Makefile improvements. ([1dd1c3a](https://github.com/Patternslib/dev/commit/1dd1c3afc1494634f5a8f72f30c4ba5a138376b8))
362
-
363
-
364
- * Upgrade dependencies. ([6d052b7](https://github.com/Patternslib/dev/commit/6d052b7d6d7cbc52812d8483dd713d336c11aa54))
365
-
366
- ## 3.3.2 (2023-05-11)
367
-
368
- ### Maintenance
369
-
370
-
371
- * Upgrade dependencies. ([0075b94](https://github.com/Patternslib/dev/commit/0075b947c5f3490627b2a20fea46c6acac71dd52))
372
-
373
- ## 3.3.1 (2023-04-21)
374
-
375
- ## 3.3.0 (2023-04-17)
376
-
377
- ### Bug Fixes
378
-
379
-
380
- * Simplify release make commands. ([49077d2](https://github.com/Patternslib/dev/commit/49077d2c6d79d7b98898c6576d0aaa01e003a0d6))
381
-
382
- Change the prerelease commands back to pre-3.2.0 names.
383
- This was necessary because the previous change did create for each
384
- command a new increment, which was not what we wanted.
385
- Instead the Makefile is now restructured:
386
- - First the npm release is done and the package.json written with the
387
- correct version. If no increment is given (in case of the prerelease
388
- targets) an interactive prompt asks the user to define one.
389
- - Second the GitHub release is done. It's no more necessary to guess the
390
- next version before the npm version was done. Instead we now rely on
391
- release-it choosing it for us.
392
- Now we do have again the "prerelease-alpha" and "prerelease-beta"
393
- Makefile targets.
394
-
395
- ## 3.2.0 (2023-04-17)
396
-
397
- ### Features
398
-
399
-
400
- * Change prerelease commands to prerelease-INCREMENT-PREID ([6b488e1](https://github.com/Patternslib/dev/commit/6b488e120761951ba01eae524563bdd490a9b739))
401
-
402
- Change the prerelease commands to define the increment level.
403
- Instead of "prerelease-alpha" there are now "prerelease-major-alpha",
404
- "prerelease-minor-alpha" and "prerelease-patch-alpha".
405
- Instead of "prerelease-beta" there are now "prerelease-major-beta",
406
- "prerelease-minor-beta" and "prerelease-patch-beta".
407
- This fixes a problem where the first prerelease for major or minor
408
- increments got only a patch-level increment.
409
-
410
-
411
- ### Maintenance
412
-
413
-
414
- * Upgrade dependencies. ([68f4ca8](https://github.com/Patternslib/dev/commit/68f4ca8b4d243f1b1b25ffacb404be71103b86aa))
415
-
416
- ## 3.1.13 (2023-04-17)
417
-
418
- ### Bug Fixes
419
-
420
-
421
- * Improve the release-it commit template to include a newline between each commit and add any commit references to the end. ([1603d0b](https://github.com/Patternslib/dev/commit/1603d0b1a08aab290f021b20562c92dab45f75c1))
422
-
423
-
424
- * Improve the release-it commit template to include a newline between header and body text. ([14ace2b](https://github.com/Patternslib/dev/commit/14ace2b2c2c2dd2bc77c4cd0cf9b47744d5ca1c1))
425
-
426
-
427
- * Include all changes since last regular release only in GitHub releases. ([ec86755](https://github.com/Patternslib/dev/commit/ec8675589217f5c66ffcfab273942c11b845a79c))
428
-
429
- When doing regular releases include all the changes since the last
430
- regular release - including changes from pre-releases in the release
431
- notes on GitHub, but not in the CHANGES.md file. In the CHANGES.md file
432
- every change can be seen at once. Including all the changes since the
433
- previous regular release is useful for the GitHub release page only.
434
-
435
-
436
- ### Maintenance
437
-
438
-
439
- * Update dependencies. ([b02c37b](https://github.com/Patternslib/dev/commit/b02c37b0a41a347f955a7a7a8fb47d8e1f4c4f11))
440
-
441
- ## 3.1.12 (2023-04-03)
442
-
443
- ### Maintenance
444
-
445
-
446
- * Upgrade dependencies. ([b3930ef](https://github.com/Patternslib/dev/commit/b3930efa5b2d5aebe5182d15e07e75f65ea7fed1))
447
-
448
- ## 3.1.11 (2023-03-09)
449
-
450
- ### Maintenance
451
-
452
-
453
- * Upgrade dependencies. ([cc4a9be](https://github.com/Patternslib/dev/commit/cc4a9be73406070bd9e057f395a7baaf991a4120))
454
-
455
- ## 3.1.10 (2023-02-14)
456
-
457
- ### Maintenance
458
-
459
-
460
- * Upgrade dependencies. ([4aad9c8](https://github.com/Patternslib/dev/commit/4aad9c8fc76df2d098f0d5abbac6c271cbe8edbe))
461
-
462
-
463
- * When doing a final release, set tagExclude to ignore pre-releases when finding the last release. This should include all changelog entrief from the pre-releases. ([4abf750](https://github.com/Patternslib/dev/commit/4abf750b95b2c3d106feccb19c7f0c27d7bfc8c4))
464
-
465
- ## 3.1.9 (2023-01-25)
466
-
467
- ### Maintenance
468
-
469
-
470
- * enable source maps for development again. ([fdf8a86](https://github.com/Patternslib/dev/commit/fdf8a86086053f8021f74514810fdccb5d7b7724))
471
-
472
-
473
- * Upgrade dependencies. ([feb26ce](https://github.com/Patternslib/dev/commit/feb26cee1a2cb805c6b13407f37f6d9e85b817d6))
474
-
475
- ## 3.1.8 (2022-12-19)
476
-
477
- ### Maintenance
478
-
479
-
480
- * For non-minified development builds, do not generate source maps. ([babf289](https://github.com/Patternslib/dev/commit/babf2893638b17f84e651a79c3e67fbbd81d1914))
481
-
482
-
483
- * Upgrade dependencies. ([20f7b31](https://github.com/Patternslib/dev/commit/20f7b315e1b0f6fa110c96ddc7c97ae206203676))
484
-
485
- ## 3.1.7 (2022-12-11)
486
-
487
- ### Maintenance
488
-
489
-
490
- * Include changelog from pre-releases in final. ([b053a10](https://github.com/Patternslib/dev/commit/b053a103ae859b1c33904d48fd80076cbec040eb))
491
-
492
- When doing a final release after a series of pre-releases, include all
493
- the pre-releases changelog items in the final release.
494
- See: https://github.com/release-it/release-it/blob/master/docs/pre-releases.md
495
-
496
-
497
- * Upgrade dependencies. ([98d81a3](https://github.com/Patternslib/dev/commit/98d81a3682ba68058bdc3e263300c0a131f5a4c5))
498
-
499
- ## 3.1.6 (2022-12-07)
500
-
501
- ### Maintenance
502
-
503
-
504
- * Remove core-js. ([2abfe2b](https://github.com/Patternslib/dev/commit/2abfe2b1904aec7a61c498f83b69f44f4b2161ba))
505
-
506
-
507
- * Upgrade dependencies. ([0a1b506](https://github.com/Patternslib/dev/commit/0a1b5068e724c049acc4dc9caca0c4ce420f5178))
508
-
509
- ## 3.1.5 (2022-11-18)
510
-
511
- ### Bug Fixes
512
-
513
-
514
- * **Build:** Get the correct version increment for prereleases. ([8947884](https://github.com/Patternslib/dev/commit/8947884e2a91fd39305ea9499d112c2dd8c845ae))
515
-
516
- ## 3.1.4 (2022-11-18)
517
-
518
- ### Bug Fixes
519
-
520
-
521
- * **Makefile:** Change the 'check' target to not be a double-colon rule, which cannot be overwritten. See: https://www.gnu.org/software/make/manual/html_node/Double_002dColon.html ([5f0f08c](https://github.com/Patternslib/dev/commit/5f0f08cd8266f5c2cf5689f3b95a6294990e3dd6))
522
-
523
- ## 3.1.3 (2022-11-18)
524
-
525
- ### Bug Fixes
526
-
527
-
528
- * **Webpack:** Add the version banner only to the entry point files. ([6f82df1](https://github.com/Patternslib/dev/commit/6f82df1d3215c07d4ff4cc00d3d6fc56f9f1fdca))
529
-
530
- This fixes a problem where each chunk file was changed with a new release, even if nothing else than the version has changed.
531
- Adding the version banner only to the entry points still allows to check the version while keeping the changeset for releases small.
532
-
533
-
534
- ### Maintenance
535
-
536
-
537
- * Upgrade dependencies. ([b2167b4](https://github.com/Patternslib/dev/commit/b2167b458711f73480797505e18e75cf3ef8ce33))
538
-
539
- ## 3.1.2 (2022-11-15)
540
-
541
- ### Bug Fixes
542
-
543
-
544
- * Fix Makefile to not emit an error when no compiled bundle is found. ([15363a7](https://github.com/Patternslib/dev/commit/15363a7e50bc290a7b394f7d3aeeac1634e8ab1d))
545
-
546
- ## 3.1.1 (2022-11-15)
547
-
548
- ### Bug Fixes
549
-
550
-
551
- * Fix Makefile error with GitHub release. ([7df20db](https://github.com/Patternslib/dev/commit/7df20db4ef54c820b07e49db9123823b23ee1161))
552
-
553
- ## 3.1.0 (2022-11-15)
554
-
555
- ### Features
556
-
557
-
558
- * Allow to add the compiled bundles to npm packages. ([84bdefd](https://github.com/Patternslib/dev/commit/84bdefd339b9aa553ef78e9448e4cdd998178d40))
559
-
560
- Creating a npm release with the Makefile prepares now a bundle build
561
- with the correct package version added as a comment to the bundle files.
562
- The compiled bundle can then be uploaded to npm if it is part of the git
563
- repository (included by .gitignore) or part of the npm release
564
- (preferred, included by .npmignore).
565
-
566
- Adding the compiled bundle to npm allows to directly include it via a
567
- CDN like so:
568
-
569
- https://cdn.jsdelivr.net/npm/@patternslib/patternslib@9.7.0-alpha.2/dist/bundle.min.js
570
- or
571
- https://unpkg.com/@patternslib/patternslib@9.7.0-alpha.2/dist/bundle.min.js
572
-
573
- We have to compile the bundle with the correct version BEFORE the npm
574
- package is created with release-it. The next version is queried using
575
- the LEVEL parameter (set by the different release targets) and the
576
- "semver" tool.
577
-
578
-
579
- ### Maintenance
580
-
581
-
582
- * Upgrade dependencies. ([e687405](https://github.com/Patternslib/dev/commit/e6874052cf9ae2cd359996659c091de532b6f5cb))
583
-
584
- ## 3.0.0 (2022-10-15)
585
-
586
- ### Breaking Changes
587
-
588
-
589
- * **Build:** Remove the showdown-prettify loading config and the now unused imports-loader. ([27ba90f](https://github.com/Patternslib/dev/commit/27ba90fc9e615c57b4be0ae20b84c2f16a918759))
590
-
591
-
592
- * **Tests:** Remove dependency on jQuery. ([259d801](https://github.com/Patternslib/dev/commit/259d801ab0a203ea64073e3cc0366976a38f1e0c))
593
-
594
- Use the following in your test setup to provide jQuery to external
595
- libraries if they depend on a global jQuery object or extend from the
596
- jest config from @patternslib/patternslib:
597
-
598
- ```js
599
- import jquery from "jquery";
600
- global.$ = global.jQuery = jquery;
601
- ```
602
-
603
-
604
- * **Tests:** Remove the Dependency on @patternslib/patternslib. ([afe8fee](https://github.com/Patternslib/dev/commit/afe8feec6304d2ce184afd587d429f3ae5bd533c))
605
-
606
- If you need Patternslib specific test setup, extend from Patternslib.
607
-
608
-
609
- ### Features
610
-
611
-
612
- * **Build:** Add Module Federation configuration for webpack. ([b84c2fb](https://github.com/Patternslib/dev/commit/b84c2fb8053837206c044e3148522d9a54afa300))
613
-
614
-
615
- ### Maintenance
616
-
617
-
618
- * Upgrade dependencies. ([f868454](https://github.com/Patternslib/dev/commit/f868454982447190e968ab9eab4988bfee01c43a))
619
-
620
- ## 2.7.2 (2022-09-28)
621
-
622
- ### Maintenance
623
-
624
-
625
- * Upgrade dependencies. ([1edd750](https://github.com/Patternslib/dev/commit/1edd7508ff8571110c00939f29843ab9a99986d5))
626
-
627
- ## 2.7.1 (2022-09-20)
628
-
629
- ### Maintenance
630
-
631
-
632
- * Upgrade dependencies. ([2fa0672](https://github.com/Patternslib/dev/commit/2fa067203c73524e95c3e1a5f70b198a8b8d56da))
633
-
634
- ## 2.7.0 (2022-09-15)
635
-
636
- ### Features
637
-
638
-
639
- * Define the close, show and showModal methods in dialog elements. ([3b59aed](https://github.com/Patternslib/dev/commit/3b59aed8556c5103ada9efa175896f83e0fac6c0))
640
-
641
-
642
- ### Maintenance
643
-
644
-
645
- * Upgrade dependencies. ([087dca5](https://github.com/Patternslib/dev/commit/087dca5d9de49423f80ce670e342bef9629dab1c))
646
-
647
- ## 2.6.0 (2022-09-05)
52
+ ## [4.0.1](https://github.com/Patternslib/dev/compare/4.0.0...4.0.1) (2026-09-05)
648
53
 
649
54
  ### Bug Fixes
650
55
 
56
+ - Fix problems with recent releases. ([ece3ae5](https://github.com/Patternslib/dev/commit/ece3ae5342157097f35b9bba0829c685661b5456))
651
57
 
652
- * Fix GitHub Actions branch name. ([e59126a](https://github.com/Patternslib/dev/commit/e59126ab8ba9cc1b284c7b964dabe905de9f9fd1))
653
-
654
-
655
- ### Maintenance
656
-
657
-
658
- * Upgrade dependencies. ([0720aad](https://github.com/Patternslib/dev/commit/0720aadc0d8f8064996b8ec5568ee8d30c84a70c))
659
-
660
- ## 2.5.0 (2022-08-19)
661
-
662
- ### Features
663
-
664
-
665
- * **Makefile:** Add empty bundle-pre target for customization. ([0290e61](https://github.com/Patternslib/dev/commit/0290e61fac9230e24428dd0b846c5bace145f56d))
666
-
667
- The empty bundle-pre target is run before the bundle target and can be
668
- overwritten in extending projects to add some tasks before bundle generation.
669
- This can be used to unlink and reinstall any dependencies before bundle generation.
670
-
671
-
672
- ### Maintenance
673
-
674
-
675
- * Upgrade dependencies. ([64094da](https://github.com/Patternslib/dev/commit/64094da766b42c245dad7640216009b1d0c2701e))
676
-
677
- ## 2.4.0 (2022-08-11)
678
-
679
- ### Features
680
-
681
-
682
- * **Webpack:** Add bundle name and version to the banner. ([1058b6d](https://github.com/Patternslib/dev/commit/1058b6d58b6e05c0c841a02a753a7fd823688595))
683
-
684
- For this, you have to pass your project's package.json as argument to the webpack config factory.
685
- Both values - name and version - are taken from the package.json data.
686
-
687
-
688
- * **Webpack:** Add config export with named parameters. ([f7b2471](https://github.com/Patternslib/dev/commit/f7b24711ce223eaa51e0ea819643a656cae846f3))
689
-
690
- Add config export along with the default export to support named parameters via parameter destructuring.
58
+ The following problems are now fixed:
691
59
 
60
+ * Whole history included in new changelog entries.
61
+ * No dist/ published due to silent failures.
62
+ * No GitHub release page updates.
63
+ * No GutHub bundle zip upload.
692
64
 
693
65
  ### Maintenance
694
66
 
67
+ - **release-it:** Allow to release from version-branches (e.g. 2.0.x or 2.x). ([c4cd074](https://github.com/Patternslib/dev/commit/c4cd074b6e2b689fec3e28b0c0855b7503c7a06f))
695
68
 
696
- * Upgrade dependencies. ([9039642](https://github.com/Patternslib/dev/commit/90396428d8b00dc6d60137387280e26f335d6128))
697
-
698
-
699
- * **Webpack:** Correct API doc for shared_from_dependencies. ([f2b0031](https://github.com/Patternslib/dev/commit/f2b003193312a332a100b8e1f6939dedcdc0e23d))
700
-
701
- ## 2.3.0 (2022-07-07)
69
+ ## [4.0.0](https://github.com/Patternslib/dev/compare/3.9.0-alpha.1...4.0.0) (2026-04-23)
702
70
 
703
71
  ### Features
704
72
 
73
+ - Makefile: Release npm and github in one go, avoiding many of the quirks like double builds and double changelog generation. ([8f01836](https://github.com/Patternslib/dev/commit/8f018368819be86bc9c4e703f7d9574a16fc3322))
705
74
 
706
- * **Module Federation:** Add a shared parameter for MF config factory. ([22e4b5e](https://github.com/Patternslib/dev/commit/22e4b5e0a4d933a61008c5f203c90ad94d6b084f))
707
-
708
- The shared parameter allows to directly provide the shared object for the Webpack Module Federation Plugin.
709
- It extends generated shared definitions from the dependencies object and will overwrite existing entries.
710
-
711
- ## 2.2.1 (2022-07-06)
712
-
713
- ### Maintenance
714
-
715
-
716
- * Upgrade dependencies. ([41adefd](https://github.com/Patternslib/dev/commit/41adefd711a2ba68ba7327236a365889b4f76205))
717
-
718
- ## 2.2.0 (2022-06-27)
719
-
720
- ### Breaking Changes
721
-
722
-
723
- * **webpack module federation:** Make wepack module federation config factory more explicit. ([efd266c](https://github.com/Patternslib/dev/commit/efd266cfc82372c467eb6a8b470360b72647b9bd))
724
-
725
- Change signature of the webpack mf config factory to make it simpler, more flexible and more explicit at the cost of having to pass more options.
726
-
727
- - Remove parameters ``package_json`` and ``shared`` in favor of ``dependencies``.
728
- - Explicitly pass all dependencies via ``dependencies``, also the base ones from @patternslib/patternslib if wanted.
729
- - Always explicitly pass the module federation name (e.g. the package.json's package name).
730
-
731
- This makes the MF config factory simpler although you probably have to pass more options.
732
- You now can easily just add the dependencies you want instead of having
733
- always @patternslib/patternslib dependencies added.
75
+ - Makefile: Update browserslist database before bundling. ([8e3da59](https://github.com/Patternslib/dev/commit/8e3da5993cc657bf8aee3fef40fcc414f0ed3cff))
734
76
 
77
+ Makefiles extending from this Makefile need to switch to a double-colon
78
+ target (`bundle-pre::`), so that the base target is also run.
735
79
 
736
80
  ### Bug Fixes
737
81
 
82
+ - Makefile‌: checkout changes before running release-it which would break if it is modified. ([db0e89e](https://github.com/Patternslib/dev/commit/db0e89ec0fb918cd64accdd2c285e09202936396))
738
83
 
739
- * Fix missing parentheses in release-zip. ([72d435d](https://github.com/Patternslib/dev/commit/72d435d500cbf9ec460bf4f5961027025e554221))
740
-
84
+ - Remove version pin for conventional-changelog-conventionalcommits. This is finally fixed upstream in conventional-changelog/commitlint. ([333c802](https://github.com/Patternslib/dev/commit/333c802d9913e18fe8673b2263a24776bba9bc34))
741
85
 
742
86
  ### Maintenance
743
87
 
88
+ - Add missing @eslint/js dependency. ([02eb557](https://github.com/Patternslib/dev/commit/02eb5573591d13f114f7fce0b9e81b8ad07fd986))
744
89
 
745
- * Add [@plone](https://github.com/plone) to jest and webpack transform ignores. ([678bf09](https://github.com/Patternslib/dev/commit/678bf090be043c90c462075980db5ac1a9470d39))
746
-
747
-
748
- * Remove unnecessary import from webpack.config.js. ([6658497](https://github.com/Patternslib/dev/commit/6658497746e9fd948dbbacd5ad6cfa42b98168af))
749
-
750
-
751
- * Upgrade dependencies. ([e1e423e](https://github.com/Patternslib/dev/commit/e1e423eb3371f5c4792ad246e9df8ed2d3d434d9))
752
-
753
- ## 2.1.0 (2022-06-25)
754
-
755
- ### Features
756
-
757
-
758
- * Do not build a bundle and a release-zip for @patternslib/dev. ([085a019](https://github.com/Patternslib/dev/commit/085a019c16a8494a2d6fa0203d880325c996aba6))
759
-
760
- Still, we have the Makefile targets ``bundle`` and ``release-zip``
761
- defined in the Makefile, making it possible to let other packages
762
- include this Makefile and extend from it while it is fully functioning
763
- for @patternslib/dev too.
764
-
765
-
766
- ### Maintenance
767
-
768
-
769
- * Add jquery and @patternslib/patternslib to devDependencies, so that setup_tests.js does not fail when testing this package. ([edae3f7](https://github.com/Patternslib/dev/commit/edae3f771ac71f0a26e87c2e78d16e0b2aaaf122))
770
-
771
-
772
- * Also remove eventual @plone/ from bundle name. ([7696d7d](https://github.com/Patternslib/dev/commit/7696d7d2ec8dd1600dc8f2e0cdb85b8aabc44930))
773
-
774
-
775
- * Ignore .git directory when watching for changes. ([14ff7e9](https://github.com/Patternslib/dev/commit/14ff7e905794a340ce23f8afe1c77a2e20b987ca))
776
-
777
-
778
- * Make @patternslib/patternslib a peer dependency which must be installed if e.g. the webpack.mf.js Webpack config is used. ([987b421](https://github.com/Patternslib/dev/commit/987b42175acbf3fc4d2df5416dd3329b610c8116))
779
-
780
-
781
- * Upgrade dependencies. ([7fac8d7](https://github.com/Patternslib/dev/commit/7fac8d79b4ce0e3acd62861bd7bcbe3866f32adc))
782
-
783
-
784
- * Upgrade dependencies. ([c632f09](https://github.com/Patternslib/dev/commit/c632f099f0ba3b542af136feba89b28aeb457385))
785
-
786
- ## 2.0.0 (2022-06-15)
787
-
788
- ### Maintenance
789
-
790
-
791
- * Add test script to package.json. ([55e8a8b](https://github.com/Patternslib/dev/commit/55e8a8b00a645b9c3ff1d2f395ee2170c9f64bfb))
792
-
793
-
794
- * Allow releases from master and from main branches. ([f4f9528](https://github.com/Patternslib/dev/commit/f4f952893a67c790bd1d14a151e62e9c84aff4ea))
795
-
796
-
797
- * Configure commitlint for extendability. ([6488bba](https://github.com/Patternslib/dev/commit/6488bbac33e82d713a7d14cf7c94e6206f957983))
798
-
799
-
800
- * Configure dependencies. ([4db723d](https://github.com/Patternslib/dev/commit/4db723dedd245f2c71fe9367b7f82bec1179c024))
801
-
802
- Use dependencies field in package.json to install all development dependencies.
803
- This way, when another package depends on it via ``devDependencies``,
804
- all dependencies will be installed.
805
-
806
-
807
- * Configure jest for extendability. ([f4eeb3c](https://github.com/Patternslib/dev/commit/f4eeb3cdbe63e63c3d7f9a79dd6f66759837a417))
808
-
809
-
810
- * Configure prettier for extendability. ([0f27162](https://github.com/Patternslib/dev/commit/0f2716286fff157b66a7d6e16b1048d35e00b6f2))
811
-
812
-
813
- * Configure release-it for extendability. ([4aedd68](https://github.com/Patternslib/dev/commit/4aedd68faea2a6b7a56850ce07e28e03af367b6a))
814
-
815
-
816
- * Configure webpack for extendability. ([f805856](https://github.com/Patternslib/dev/commit/f805856274ccae9f3cad17186dbf5029f8524b9c))
817
-
90
+ - eslint latest ECMA script and drop @babel/eslint-parser. ([efdc5f1](https://github.com/Patternslib/dev/commit/efdc5f145b1a3bb32c4c2469e8aeeec8b0d29e44))
818
91
 
819
- * Initial dev setup, based on @patternslib/patternslib. ([12968fb](https://github.com/Patternslib/dev/commit/12968fb0c9ee8d0b858acc88d8d3077a70cfa6d2))
92
+ The current @babel/eslint-parser version 7 is not compatible with
93
+ eslint 10. Also eslint supports with the latest ECMA script version
94
+ configuration recent enough JavaScript, so that we can drop the
95
+ dependency on @babel/eslint-parser.
820
96
 
97
+ - Upgrade dependencies. ([4ae9820](https://github.com/Patternslib/dev/commit/4ae98209d0ff5a2e3db882996c4b462cb94ca6a6))
821
98
 
822
- * Upgrade dependencies. ([134295d](https://github.com/Patternslib/dev/commit/134295d67fe7c479c73c7878fd1d3ef0a07e5a83))
99
+ NOTE: you might need to update your tests for Jest 30.3.0 support.
100
+ E.g. expect.toThrowError has changed to expect.toThrow.
101
+ See: https://jestjs.io/docs/upgrading-to-jest30
823
102
 
824
103
  ## [3.9.0-alpha.1](https://github.com/Patternslib/dev/compare/3.9.0-alpha.0...3.9.0-alpha.1) (2025-12-17)
825
104
 
package/Makefile CHANGED
@@ -94,24 +94,15 @@ endif
94
94
  # Prepare some necessary variables.
95
95
  .PHONY: prepare-release
96
96
  prepare-release:
97
+ $(eval RELEASE_IT_GITHUB_OPTIONS :=)
97
98
  ifeq ($(LEVEL),$(filter $(LEVEL), alpha beta))
98
99
  @# case alpha or beta pre-release
99
100
 
100
- @# Changelog for the GitHub release when doing prereleases:
101
- @# Include all the changes since the previous pre- or regular release.
102
- $(eval RELEASE_IT_GITHUB_OPTIONS :=)
103
-
104
101
  @# Set level argument for release-it.
105
102
  $(eval RELEASE_IT_LEVEL := "--preRelease=$(LEVEL)")
106
103
  else
107
104
  @# case normal major/minor/patch release
108
105
 
109
- @# Changelog for the GitHub release when doing regular releases:
110
- @# Include all changes since the previous regular release, also including
111
- @# changes from pre-releases.
112
- @# See: https://github.com/release-it/release-it/blob/master/docs/pre-releases.md
113
- $(eval RELEASE_IT_GITHUB_OPTIONS := --git.tagExclude='*[-]*')
114
-
115
106
  @# Set level argument for release-it.
116
107
  $(eval RELEASE_IT_LEVEL := $(LEVEL))
117
108
  endif
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternslib/dev",
3
- "version": "4.0.1",
3
+ "version": "4.1.0-alpha.0",
4
4
  "description": "Development base files for working with Patternslib and add-ons.",
5
5
  "license": "MIT",
6
6
  "dependencies": {
@@ -0,0 +1,116 @@
1
+ jest.mock("../webpack/module_federation--dynamic-federation", () => ({
2
+ __esModule: true,
3
+ default: jest.fn(async (remote) => globalThis[remote]),
4
+ }));
5
+
6
+ describe("webpack/module_federation", () => {
7
+ const FAKE = "__patternslib_mf__fake";
8
+ const BROKEN = "__patternslib_mf__broken";
9
+ let events;
10
+ const on_loaded = () => events.push("loaded");
11
+
12
+ beforeEach(() => {
13
+ jest.resetModules();
14
+ events = [];
15
+ document.addEventListener("patternslib__mf--loaded", on_loaded);
16
+ });
17
+
18
+ afterEach(() => {
19
+ document.removeEventListener("patternslib__mf--loaded", on_loaded);
20
+ delete window[FAKE];
21
+ delete window[BROKEN];
22
+ delete window.__patternslib_mf_initialized;
23
+ delete window.__patternslib_container_map;
24
+ jest.restoreAllMocks();
25
+ });
26
+
27
+ it("resolves the initialization promise only after all remotes are initialized", async () => {
28
+ let release;
29
+ const factory = jest.fn(() => ({}));
30
+ window[FAKE] = {
31
+ get: jest.fn(
32
+ () => new Promise((resolve) => (release = () => resolve(factory))),
33
+ ),
34
+ };
35
+
36
+ require("../webpack/module_federation");
37
+
38
+ const promise = window.__patternslib_mf_initialized;
39
+ expect(promise).toBeInstanceOf(Promise);
40
+
41
+ let settled = false;
42
+ promise.then(() => (settled = true));
43
+
44
+ // document ready has fired, the remote is being loaded but not done yet.
45
+ await new Promise((resolve) => setTimeout(resolve, 10));
46
+ expect(window[FAKE].get).toHaveBeenCalledWith("./main");
47
+ expect(settled).toBe(false);
48
+ expect(events).toEqual([]);
49
+
50
+ release();
51
+ const bundles = await promise;
52
+
53
+ expect(bundles).toEqual([FAKE]);
54
+ expect(factory).toHaveBeenCalled();
55
+ expect(window.__patternslib_container_map[`${FAKE}-./main`]).toBe(true);
56
+ // The event is dispatched after the promise resolved.
57
+ expect(events).toEqual(["loaded"]);
58
+ });
59
+
60
+ it("resolves even when a remote fails to initialize", async () => {
61
+ const error_spy = jest.spyOn(console, "error").mockImplementation(() => {});
62
+ window[BROKEN] = {
63
+ get: jest.fn(async () => {
64
+ throw new Error("boom");
65
+ }),
66
+ };
67
+ window[FAKE] = { get: jest.fn(async () => () => ({})) };
68
+
69
+ require("../webpack/module_federation");
70
+ const bundles = await window.__patternslib_mf_initialized;
71
+
72
+ expect(bundles.sort()).toEqual([BROKEN, FAKE].sort());
73
+ expect(error_spy).toHaveBeenCalledWith(
74
+ expect.stringContaining(BROKEN),
75
+ expect.any(Error),
76
+ );
77
+ expect(window.__patternslib_container_map[`${FAKE}-./main`]).toBe(true);
78
+ expect(window.__patternslib_container_map[`${BROKEN}-./main`]).toBeUndefined();
79
+ expect(events).toEqual(["loaded"]);
80
+ });
81
+
82
+ it("waits for the promise a remote's main module exports as default", async () => {
83
+ let release;
84
+ const bundle_code = jest.fn();
85
+ // The main module only starts the dynamic import of the bundle code and
86
+ // exports that promise.
87
+ const main_module = {
88
+ default: new Promise((resolve) => (release = () => resolve(bundle_code()))),
89
+ };
90
+ window[FAKE] = { get: jest.fn(async () => () => main_module) };
91
+
92
+ require("../webpack/module_federation");
93
+
94
+ let settled = false;
95
+ window.__patternslib_mf_initialized.then(() => (settled = true));
96
+ await new Promise((resolve) => setTimeout(resolve, 10));
97
+
98
+ // main has run, but the bundle code has not — still waiting.
99
+ expect(window[FAKE].get).toHaveBeenCalled();
100
+ expect(settled).toBe(false);
101
+ expect(events).toEqual([]);
102
+
103
+ release();
104
+ await window.__patternslib_mf_initialized;
105
+
106
+ expect(bundle_code).toHaveBeenCalled();
107
+ expect(events).toEqual(["loaded"]);
108
+ });
109
+
110
+ it("resolves immediately when no remotes are registered", async () => {
111
+ require("../webpack/module_federation");
112
+ const bundles = await window.__patternslib_mf_initialized;
113
+ expect(bundles).toEqual([]);
114
+ expect(events).toEqual(["loaded"]);
115
+ });
116
+ });
@@ -22,10 +22,23 @@ export async function initialize_remote({ remote_name, exposed_module = "./main"
22
22
  const factory = await container.get(exposed_module);
23
23
  const module = factory();
24
24
 
25
+ // A remote's main module usually only does a dynamic import of the
26
+ // actual bundle code (``import("./bundle")``) — the async boundary
27
+ // webpack needs to consume shared modules. The patterns and components
28
+ // are only registered once that chunk has run. If the main module
29
+ // exports that import promise as its default export
30
+ // (``export default import("./bundle")``), wait for it, so that
31
+ // ``__patternslib_mf_initialized`` really resolves after the remote's
32
+ // registrations are done. Remotes without such an export keep working
33
+ // as before.
34
+ if (typeof module?.default?.then === "function") {
35
+ await module.default;
36
+ }
37
+
25
38
  container_map[`${remote_name}-${exposed_module}`] = true;
26
39
 
27
40
  console.debug(
28
- `Patternslib Module Federation: Loaded and initialized bundle "${remote_name}".`
41
+ `Patternslib Module Federation: Loaded and initialized bundle "${remote_name}".`,
29
42
  );
30
43
 
31
44
  return module;
@@ -41,17 +54,41 @@ function document_ready(fn) {
41
54
  }
42
55
  }
43
56
 
44
- document_ready(function () {
57
+ // A promise which resolves once all Module Federation enabled bundles have
58
+ // been loaded and initialized (or failed to do so). It is created right at
59
+ // module load time, so consumers like the Patternslib registry can wait for
60
+ // it no matter whether they run before or after document ready.
61
+ // The Patternslib registry uses this to defer the initial DOM scan until all
62
+ // remote bundles had the chance to register their patterns and components.
63
+ let resolve_initialized;
64
+ window.__patternslib_mf_initialized = new Promise((resolve) => {
65
+ resolve_initialized = resolve;
66
+ });
67
+
68
+ document_ready(async function () {
45
69
  // Automatically initialize all Module Federation enabled Patternslib based
46
70
  // bundles by filtering for the prefix ``__patternslib_mf__``.
47
71
  // Do this on document ready, as this is the time where all MF bundles have
48
72
  // been registered in the global namespace.
49
73
  const bundles = Object.keys(window).filter((it) => it.indexOf(MF_NAME_PREFIX) === 0);
50
- for (const bundle_name of bundles) {
51
- // Now load + initialize each bundle.
52
- initialize_remote({ remote_name: bundle_name });
74
+
75
+ // Load + initialize all bundles in parallel and wait for all of them to
76
+ // settle. A failing bundle must not block the others, nor the
77
+ // initialization of the page.
78
+ const results = await Promise.allSettled(
79
+ bundles.map((bundle_name) => initialize_remote({ remote_name: bundle_name })),
80
+ );
81
+ for (const [index, result] of results.entries()) {
82
+ if (result.status === "rejected") {
83
+ console.error(
84
+ `Patternslib Module Federation: Failed to initialize bundle "${bundles[index]}".`,
85
+ result.reason,
86
+ );
87
+ }
53
88
  }
89
+
90
+ resolve_initialized(bundles);
54
91
  document.dispatchEvent(
55
- new Event("patternslib__mf--loaded", { bubbles: true, cancelable: false })
92
+ new Event("patternslib__mf--loaded", { bubbles: true, cancelable: false }),
56
93
  );
57
94
  });