@absolutejs/absolute 0.19.0-beta.878 → 0.19.0-beta.879

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.
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-Mb7iXC/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-wj25fP/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-Mb7iXC/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-wj25fP/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -48,7 +48,7 @@ var warnMissingStreamingSlotCollector = (primitiveName) => {
48
48
  getWarningController()?.maybeWarn(primitiveName);
49
49
  };
50
50
 
51
- // .angular-partial-tmp-Mb7iXC/src/core/streamingSlotRegistry.ts
51
+ // .angular-partial-tmp-wj25fP/src/core/streamingSlotRegistry.ts
52
52
  var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
53
53
  var isObjectRecord2 = (value) => Boolean(value) && typeof value === "object";
54
54
  var isAsyncLocalStorage = (value) => isObjectRecord2(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
@@ -203,6 +203,47 @@ const teardownOldLView = (oldLView: LView): void => {
203
203
  markLViewDestroyed(oldLView);
204
204
  };
205
205
 
206
+ /* Copy `@Input` field values from the OLD instance to the NEW one.
207
+ *
208
+ * This is needed because Angular's parent template emits binding ops
209
+ * like `ɵɵproperty('priority', true)` that compare against a cached
210
+ * binding slot in the parent's LView before writing. After our
211
+ * splice the CACHED value is unchanged (the parent's LView wasn't
212
+ * re-rendered), so the next parent CD sees `true === true (cached)`
213
+ * and SKIPS the write. The new instance's `priority` would stay at
214
+ * its default until the parent's binding expression result changes.
215
+ *
216
+ * Pre-seeding the new instance with the old value sidesteps this:
217
+ * by the time the parent's binding op might run, the new instance
218
+ * already has the correct value, and any future change will fire
219
+ * normally because the binding-cache invariant is preserved.
220
+ *
221
+ * `def.inputs` metadata format (modern Angular):
222
+ * - `{ propName: 'classFieldName' }` (simple alias)
223
+ * - `{ propName: ['publicName', 'classFieldName', transformFn?] }` */
224
+ const copyInputsFromOldToNew = (
225
+ oldInstance: unknown,
226
+ newInstance: unknown
227
+ ): void => {
228
+ if (!oldInstance || !newInstance) return;
229
+ const def = (newInstance as { constructor?: { ɵcmp?: unknown } }).constructor
230
+ ?.ɵcmp as { inputs?: Record<string, unknown> } | undefined;
231
+ const inputs = def?.inputs;
232
+ if (!inputs) return;
233
+
234
+ // Modern Angular inputs format (since v17ish): the OBJECT KEY is
235
+ // the class property name; the value is either a string (binding
236
+ // name) or `[bindingName, flags, transformFn?]`. So the class
237
+ // field name is just `Object.keys(inputs)`.
238
+ for (const classField of Object.keys(inputs)) {
239
+ const oldRec = oldInstance as Record<string, unknown>;
240
+ const newRec = newInstance as Record<string, unknown>;
241
+ if (classField in oldRec) {
242
+ newRec[classField] = oldRec[classField];
243
+ }
244
+ }
245
+ };
246
+
206
247
  export type RemountResult = {
207
248
  className: string;
208
249
  remounted: number;
@@ -276,6 +317,7 @@ export const remountComponentClass = async (
276
317
  continue;
277
318
  }
278
319
 
320
+ copyInputsFromOldToNew(target.oldLView[CONTEXT], fresh.instance);
279
321
  spliceLViewIntoParent(target, fresh.newLView, fresh.instance);
280
322
  teardownOldLView(target.oldLView);
281
323
 
package/package.json CHANGED
@@ -385,5 +385,5 @@
385
385
  ]
386
386
  }
387
387
  },
388
- "version": "0.19.0-beta.878"
388
+ "version": "0.19.0-beta.879"
389
389
  }