@absolutejs/absolute 0.19.0-beta.873 → 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.
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/build.js +15 -3
- package/dist/build.js.map +3 -3
- package/dist/dev/client/handlers/angularRemount.ts +41 -17
- package/dist/index.js +15 -3
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
|
@@ -14,23 +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
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
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. */
|
|
34
35
|
|
|
35
36
|
import {
|
|
36
37
|
CONTEXT,
|
|
@@ -265,5 +266,28 @@ export const remountComponentClass = async (
|
|
|
265
266
|
}
|
|
266
267
|
}
|
|
267
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
|
+
|
|
268
292
|
return { className, remounted, skipped };
|
|
269
293
|
};
|
package/dist/index.js
CHANGED
|
@@ -19208,8 +19208,20 @@ ${block}
|
|
|
19208
19208
|
if (methodsBlock) {
|
|
19209
19209
|
const tail = `
|
|
19210
19210
|
if (typeof _Fresh !== 'undefined') {
|
|
19211
|
-
|
|
19212
|
-
|
|
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(); };
|
|
19215
|
+
_Fresh.\u0275cmp = Object.assign(
|
|
19216
|
+
Object.create(Object.getPrototypeOf(${className}.\u0275cmp)),
|
|
19217
|
+
${className}.\u0275cmp,
|
|
19218
|
+
{
|
|
19219
|
+
type: _Fresh,
|
|
19220
|
+
factory: __abs_freshFac,
|
|
19221
|
+
tView: null
|
|
19222
|
+
}
|
|
19223
|
+
);
|
|
19224
|
+
_Fresh.\u0275fac = __abs_freshFac;
|
|
19213
19225
|
return _Fresh;
|
|
19214
19226
|
}
|
|
19215
19227
|
`;
|
|
@@ -30454,5 +30466,5 @@ export {
|
|
|
30454
30466
|
ANGULAR_INIT_TIMEOUT_MS
|
|
30455
30467
|
};
|
|
30456
30468
|
|
|
30457
|
-
//# debugId=
|
|
30469
|
+
//# debugId=A56696228D787EEA64756E2164756E21
|
|
30458
30470
|
//# sourceMappingURL=index.js.map
|