You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(core registry): replace option to override an already registered pattern
The first registration of a pattern name wins, so an add-on bundle
could not override a core pattern under its own name — it had to
blacklist the original and register a replacement under a different
name with the original trigger, and then bridge the original's
options by hand.
``registry.register(pattern, name, { replace: true })`` now replaces an
existing registration; ``Base.extend`` accepts ``replace: true`` as
pattern property. Together with the registry waiting for Module
Federation remotes before the initial scan, the replacement is in
place for the initial scan no matter whether the remote or the core
bundle registered first. Replacing after the registry was initialized
logs a warning: already initialized elements keep the previous
pattern, only new elements get the replacement. The blacklist still
wins over a replacement.
Also documents the new Module Federation globals in the README.
Copy file name to clipboardExpand all lines: README.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -135,6 +135,9 @@ global settings or access otherwise hidden objects.
135
135
| window.\_\_patternslib_patterns_blacklist | A list of patterns that should not be loaded. |[]|
136
136
| window.\_\_patternslib_registry | Global access to the Patternslib registry object. | - |
137
137
| window.\_\_patternslib_registry_initialized | True, if the registry has been initialized. | false |
138
+
| window.\_\_patternslib_registry_initializing | True, while the registry waits for Module Federation remotes before the initial scan. | undefined |
139
+
| window.\_\_patternslib_mf_initialized | Promise provided by the Module Federation helper of `@patternslib/dev`, resolved once all remote bundles are initialized. The registry waits for it before the initial scan. | undefined |
140
+
| window.\_\_patternslib_mf_init_timeout | Maximum time in milliseconds the registry waits for Module Federation remotes before scanning anyway. | 5000 |
138
141
| window.\_\_patternslib_disable_modernizr (Deprecated) | Disable modernizr, but still write the js/no-js classes to the body. | undefined |
0 commit comments