Repository navigation
Commit 442ff1e
committed
refactor(angular): consolidate HMR into lib/hmr and strip it from release builds
All HMR support now lives in packages/angular/src/lib/hmr (hmr, route, dialog,
modal-host, cache). Every entry point outside that folder is guarded by
`typeof ngDevMode === 'undefined' || ngDevMode`, so release builds (which define
ngDevMode=false) drop it entirely; verified against iOS and Android release
bundles of a Vite app.
- Features register beforeDispose/afterBootstrap hooks with the reboot instead of
application.ts importing the router and NativeDialog subscribing to bootstrap
events; removes the eager-instantiator registry and the ReplaySubject change.
- Route restore captures router.url at dispose and feeds the start path through
provideLocationStrategy instead of overriding START_PATH, so an app-provided
START_PATH is no longer clobbered. Route configs are no longer cloned at
bootstrap; router caches are cleared at dispose instead.
- Dialog restore tracks preserveOnHmr dialogs, drops the destroyed
viewContainerRef/injector, and waits for app stability so an edited dialog
inside a lazy route reopens with its fresh class.
- The modal ContentView wrapper and host-prop mirroring apply only in live HMR
sessions; release and plain dev builds present modals exactly as before.
- Drops the console.warn NG0912 filter, Angular-core namespace holder,
diagnostics counters, redundant boot-complete globals and the
import.meta.hot wiring in HmrCacheService (import.meta.hot is always
undefined inside the package).
- Reverts formatting-only zone-js changes, the NativeDialogModule provider
removal, the element registration changes and the NSLocationStrategy and
NSRouteReuseStrategy ngOnDestroy changes.1 parent f64e423 commit 442ff1e
41 files changed
Lines changed: 1179 additions & 3088 deletions
File tree
- packages
- angular/src/lib
- cdk/dialog
- element-registry
- hmr
- legacy/router
- zone-js/dist
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Large diffs are not rendered by default.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | 5 | | |
31 | 6 | | |
32 | 7 | | |
| 8 | + | |
33 | 9 | | |
34 | 10 | | |
0 commit comments