@absolutejs/absolute 0.19.0-beta.874 → 0.19.0-beta.875

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.
@@ -14,20 +14,24 @@ import type {} from '../../../types/globals';
14
14
  * so it participates in the parent's view tree instead of being a
15
15
  * detached root.
16
16
  *
17
- * Caveats baked into this approach:
18
- * Old @Input bindings from the parent are NOT re-applied. The
19
- * parent's template flow runs at parent-CD time and wires inputs
20
- * then; until then the new instance sees default values. In
21
- * practice this matches Tier 1 rebootstrap behavior — no worse.
22
- * Old projection content (ng-content) doesn't transfer. If the
23
- * parent injected a child via ng-content, the new instance has an
24
- * empty projection slot until parent re-renders.
25
- * Components with explicit constructor parameters (DI args
26
- * declared as `constructor(private foo: Foo)`) need the live
27
- * factory's parameter passing, which the surgical module's
28
- * `_Fresh.ɵfac = () => new _Fresh()` doesn't yet replicate. Use
29
- * modern field-initializer DI (`private foo = inject(Foo)`)
30
- * instead, or escalate such components to Tier 1b rebootstrap. */
17
+ * Lifecycle of one remount:
18
+ * 1. `applyMetadata` runs, returning `_Fresh` a class with the
19
+ * full new body (fields + ctor + methods) and a `ɵfac` that
20
+ * delegates to the LIVE class's factory with `_Fresh` as the
21
+ * type override. The delegation preserves the bundle's resolved
22
+ * DI for explicit constructor params.
23
+ * 2. For each live instance: `createComponent(_Fresh, hostElement)`
24
+ * builds a fresh `ComponentRef` at the same host. Angular runs
25
+ * the new constructor (firing field initializers + lifecycle
26
+ * hooks) and renders the new template.
27
+ * 3. Splice the new LView into the parent's slot via vendored slot
28
+ * ops, replacing the old one in the parent's view tree.
29
+ * 4. Tear down the old LView (`executeOnDestroys` +
30
+ * `processCleanups`) so RxJS subscriptions, DOM event listeners,
31
+ * and `inject(DestroyRef).onDestroy(...)` callbacks all fire.
32
+ * 5. `ApplicationRef.tick()` so the parent's template re-runs
33
+ * against the new slot — re-applies `@Input` bindings and
34
+ * re-projects `<ng-content>` into the fresh child. */
31
35
 
32
36
  import {
33
37
  CONTEXT,
@@ -262,5 +266,28 @@ export const remountComponentClass = async (
262
266
  }
263
267
  }
264
268
 
269
+ if (remounted > 0) {
270
+ // Trigger an app-wide CD pass so the parent's template re-runs
271
+ // against the new child LView's slot. This is what re-applies
272
+ // `@Input` bindings (`<app-hero [foo]="bar">`) and re-projects
273
+ // `<ng-content>` content into the new instance — both are
274
+ // PARENT-template artifacts that Angular only re-evaluates
275
+ // during the parent's update pass, not during the child's
276
+ // fresh creation. Without this tick, a remounted component
277
+ // shows default field values until the user interacts and
278
+ // triggers a stray CD elsewhere.
279
+ const w = window as unknown as {
280
+ __ANGULAR_APP__?: { tick?: () => void };
281
+ };
282
+ try {
283
+ w.__ANGULAR_APP__?.tick?.();
284
+ } catch (err) {
285
+ console.error(
286
+ '[absolutejs] post-remount tick threw — partial state',
287
+ err
288
+ );
289
+ }
290
+ }
291
+
265
292
  return { className, remounted, skipped };
266
293
  };
package/dist/index.js CHANGED
@@ -19208,16 +19208,20 @@ ${block}
19208
19208
  if (methodsBlock) {
19209
19209
  const tail = `
19210
19210
  if (typeof _Fresh !== 'undefined') {
19211
+ var __abs_liveFac = ${className}.\u0275fac;
19212
+ var __abs_freshFac = typeof __abs_liveFac === 'function'
19213
+ ? function(t) { return __abs_liveFac(t || _Fresh); }
19214
+ : function() { return new _Fresh(); };
19211
19215
  _Fresh.\u0275cmp = Object.assign(
19212
19216
  Object.create(Object.getPrototypeOf(${className}.\u0275cmp)),
19213
19217
  ${className}.\u0275cmp,
19214
19218
  {
19215
19219
  type: _Fresh,
19216
- factory: function() { return new _Fresh(); },
19220
+ factory: __abs_freshFac,
19217
19221
  tView: null
19218
19222
  }
19219
19223
  );
19220
- _Fresh.\u0275fac = function() { return new _Fresh(); };
19224
+ _Fresh.\u0275fac = __abs_freshFac;
19221
19225
  return _Fresh;
19222
19226
  }
19223
19227
  `;
@@ -30462,5 +30466,5 @@ export {
30462
30466
  ANGULAR_INIT_TIMEOUT_MS
30463
30467
  };
30464
30468
 
30465
- //# debugId=BE7265BEB28B7BC164756E2164756E21
30469
+ //# debugId=A56696228D787EEA64756E2164756E21
30466
30470
  //# sourceMappingURL=index.js.map