@absolutejs/absolute 0.19.0-beta.853 → 0.19.0-beta.855

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.
@@ -13,7 +13,6 @@ import {
13
13
  } from './constants';
14
14
  import { detectCurrentFramework } from './frameworkDetect';
15
15
  import { hideErrorOverlay, showErrorOverlay } from './errorOverlay';
16
- import { handleAngularUpdate } from './handlers/angular';
17
16
  import { dispatchAngularComponentUpdate } from './handlers/angularHmrShim';
18
17
  import { handleReactUpdate } from './handlers/react';
19
18
  import { handleHTMLUpdate, handleScriptUpdate } from './handlers/html';
@@ -69,7 +68,8 @@ window.addEventListener('unhandledrejection', (evt) => {
69
68
  });
70
69
 
71
70
  const hmrUpdateTypes = new Set([
72
- 'angular-update',
71
+ 'angular:component-update',
72
+ 'angular:rebootstrap',
73
73
  'react-update',
74
74
  'html-update',
75
75
  'htmx-update',
@@ -149,10 +149,6 @@ const handleHMRMessage = (message: HMRMessage) => {
149
149
  hideErrorOverlay();
150
150
  handleVueUpdate(message);
151
151
  break;
152
- case 'angular-update':
153
- hideErrorOverlay();
154
- handleAngularUpdate(message);
155
- break;
156
152
  case 'angular:component-update': {
157
153
  // Surgical-HMR fast path. Server resolved the changed
158
154
  // file → owning component classes and emitted one
@@ -173,6 +169,39 @@ const handleHMRMessage = (message: HMRMessage) => {
173
169
  }
174
170
  break;
175
171
  }
172
+ case 'angular:rebootstrap': {
173
+ // Tier 1 fallback. The user's edit changed structure
174
+ // the surgical path can't safely apply
175
+ // (constructor/decorator/imports change, service edit,
176
+ // etc.). The bundle has already been rebuilt server-side
177
+ // and the manifest is updated. Call the chunk's baked-in
178
+ // hook (set by the hydration template in compileAngular.ts)
179
+ // to dynamic-import the fresh bundle URL — re-importing
180
+ // re-runs the destroy + bootstrapApplication block.
181
+ const data = message.data as
182
+ | { manifest?: Record<string, string>; reason?: string }
183
+ | undefined;
184
+ if (data?.manifest) {
185
+ window.__HMR_MANIFEST__ = data.manifest;
186
+ }
187
+ const w = window as Window & {
188
+ __ABS_ANGULAR_REBOOTSTRAP__?: () => Promise<void>;
189
+ };
190
+ if (typeof w.__ABS_ANGULAR_REBOOTSTRAP__ === 'function') {
191
+ w.__ABS_ANGULAR_REBOOTSTRAP__().catch((err) => {
192
+ console.error(
193
+ '[absolutejs] angular:rebootstrap failed',
194
+ err
195
+ );
196
+ });
197
+ } else {
198
+ // No hook = no Angular page loaded, or the hook
199
+ // hasn't run yet. Falling back to a full reload is
200
+ // safe and correct.
201
+ window.location.reload();
202
+ }
203
+ break;
204
+ }
176
205
  case 'rebuild-error':
177
206
  handleRebuildError(message);
178
207
  break;