@genesislcap/foundation-utils 14.496.1 → 14.496.2-alpha-da9ccbd.0

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.
@@ -250,59 +250,6 @@
250
250
  }
251
251
  ]
252
252
  },
253
- {
254
- "kind": "javascript-module",
255
- "path": "src/decorators/index.ts",
256
- "declarations": [],
257
- "exports": [
258
- {
259
- "kind": "js",
260
- "name": "*",
261
- "declaration": {
262
- "name": "*",
263
- "package": "./renderOnChange"
264
- }
265
- }
266
- ]
267
- },
268
- {
269
- "kind": "javascript-module",
270
- "path": "src/decorators/renderOnChange.ts",
271
- "declarations": [
272
- {
273
- "kind": "function",
274
- "name": "renderOnChange",
275
- "parameters": [
276
- {
277
- "name": "target",
278
- "type": {
279
- "text": "FASTElement & { render(): void }"
280
- },
281
- "description": "The target to define the property change handler on."
282
- },
283
- {
284
- "name": "name",
285
- "type": {
286
- "text": "string"
287
- },
288
- "description": "The property name."
289
- }
290
- ],
291
- "description": "Defines a property changed handler that calls a render() method on the target as an internal observation enhancement.",
292
- "privacy": "public"
293
- }
294
- ],
295
- "exports": [
296
- {
297
- "kind": "js",
298
- "name": "renderOnChange",
299
- "declaration": {
300
- "name": "renderOnChange",
301
- "module": "src/decorators/renderOnChange.ts"
302
- }
303
- }
304
- ]
305
- },
306
253
  {
307
254
  "kind": "javascript-module",
308
255
  "path": "src/data/inMemoryDatabase.ts",
@@ -501,6 +448,29 @@
501
448
  }
502
449
  ]
503
450
  },
451
+ {
452
+ "kind": "javascript-module",
453
+ "path": "src/directives/index.ts",
454
+ "declarations": [],
455
+ "exports": [
456
+ {
457
+ "kind": "js",
458
+ "name": "*",
459
+ "declaration": {
460
+ "name": "*",
461
+ "package": "./sync"
462
+ }
463
+ },
464
+ {
465
+ "kind": "js",
466
+ "name": "*",
467
+ "declaration": {
468
+ "name": "*",
469
+ "package": "./when-else"
470
+ }
471
+ }
472
+ ]
473
+ },
504
474
  {
505
475
  "kind": "javascript-module",
506
476
  "path": "src/design-system/design-system.ts",
@@ -703,29 +673,6 @@
703
673
  }
704
674
  ]
705
675
  },
706
- {
707
- "kind": "javascript-module",
708
- "path": "src/directives/index.ts",
709
- "declarations": [],
710
- "exports": [
711
- {
712
- "kind": "js",
713
- "name": "*",
714
- "declaration": {
715
- "name": "*",
716
- "package": "./sync"
717
- }
718
- },
719
- {
720
- "kind": "js",
721
- "name": "*",
722
- "declaration": {
723
- "name": "*",
724
- "package": "./when-else"
725
- }
726
- }
727
- ]
728
- },
729
676
  {
730
677
  "kind": "javascript-module",
731
678
  "path": "src/encoding/index.ts",
@@ -1216,6 +1163,59 @@
1216
1163
  }
1217
1164
  ]
1218
1165
  },
1166
+ {
1167
+ "kind": "javascript-module",
1168
+ "path": "src/decorators/index.ts",
1169
+ "declarations": [],
1170
+ "exports": [
1171
+ {
1172
+ "kind": "js",
1173
+ "name": "*",
1174
+ "declaration": {
1175
+ "name": "*",
1176
+ "package": "./renderOnChange"
1177
+ }
1178
+ }
1179
+ ]
1180
+ },
1181
+ {
1182
+ "kind": "javascript-module",
1183
+ "path": "src/decorators/renderOnChange.ts",
1184
+ "declarations": [
1185
+ {
1186
+ "kind": "function",
1187
+ "name": "renderOnChange",
1188
+ "parameters": [
1189
+ {
1190
+ "name": "target",
1191
+ "type": {
1192
+ "text": "FASTElement & { render(): void }"
1193
+ },
1194
+ "description": "The target to define the property change handler on."
1195
+ },
1196
+ {
1197
+ "name": "name",
1198
+ "type": {
1199
+ "text": "string"
1200
+ },
1201
+ "description": "The property name."
1202
+ }
1203
+ ],
1204
+ "description": "Defines a property changed handler that calls a render() method on the target as an internal observation enhancement.",
1205
+ "privacy": "public"
1206
+ }
1207
+ ],
1208
+ "exports": [
1209
+ {
1210
+ "kind": "js",
1211
+ "name": "renderOnChange",
1212
+ "declaration": {
1213
+ "name": "renderOnChange",
1214
+ "module": "src/decorators/renderOnChange.ts"
1215
+ }
1216
+ }
1217
+ ]
1218
+ },
1219
1219
  {
1220
1220
  "kind": "javascript-module",
1221
1221
  "path": "src/error/errorMap.ts",
@@ -70,6 +70,17 @@ export declare const LifecycleMixin: <T extends ConstructableLifecycleHandler>(B
70
70
  * @internal
71
71
  **/
72
72
  #_shouldForceLifecycle: boolean;
73
+ /**
74
+ * Set once a short grace period has elapsed since a blocked ('reflow') disconnect. Some
75
+ * consumers run defensive cleanup shortly after despite the block - and don't necessarily use
76
+ * a plain microtask to do it (e.g. FAST's `DOM.queueUpdate` scheduler, which a consumer's own
77
+ * reconnect logic may also be deferred through, can resolve after our microtask has already
78
+ * fired, making a same-microtask check unreliable). A macrotask-scale grace period via
79
+ * `setTimeout` is cheap here and outlasts any such scheduler, so once it has passed the paired
80
+ * reconnect must not stay blocked, or the consumer never re-initializes.
81
+ * @internal
82
+ **/
83
+ #_blockedDisconnectSurvivedGracePeriod: boolean;
73
84
  /**
74
85
  * @privateRemarks
75
86
  * Rather than using the basic implementation of cloning we run a copy constructor (deepClone)
@@ -1 +1 @@
1
- {"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../../src/mixins/lifecycle/lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG,aAAa,CAAC,WAAW,GAAG,WAAW,CAAC,CAAC;AAErF;;;;GAIG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;IACxB,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,IAAI,EAAE,mBAAmB,CAAC;CAC3B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,yBAAyB,CAAC;CACjC,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,KAAK,CAAC;CACb,CAAC;AAE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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAM1B,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,mBAAmB,eAAkC,CAAC"}
@@ -11,7 +11,7 @@ const CLEANUP_TIMEOUT_MS = 10000;
11
11
  * #_ syntax is used for a javascript private method/variable
12
12
  * we can't use private/protected from typescript in an anonymous class like this
13
13
  */
14
- export const LifecycleMixin = (Base) => { var _instances, __container, __latestTokenCode, __hasFirstLoaded, __cleanupTimeout, __shouldForceLifecycle, __blockLifecycleDueToTokenChange, __tryFindContainingLayout, _a; return _a = class extends Base {
14
+ export const LifecycleMixin = (Base) => { var _instances, __container, __latestTokenCode, __hasFirstLoaded, __cleanupTimeout, __shouldForceLifecycle, __blockedDisconnectSurvivedGracePeriod, __blockLifecycleDueToTokenChange, __tryFindContainingLayout, _a; return _a = class extends Base {
15
15
  constructor(...args) {
16
16
  super(args);
17
17
  _instances.add(this);
@@ -42,6 +42,17 @@ export const LifecycleMixin = (Base) => { var _instances, __container, __latestT
42
42
  * @internal
43
43
  **/
44
44
  __shouldForceLifecycle.set(this, false);
45
+ /**
46
+ * Set once a short grace period has elapsed since a blocked ('reflow') disconnect. Some
47
+ * consumers run defensive cleanup shortly after despite the block - and don't necessarily use
48
+ * a plain microtask to do it (e.g. FAST's `DOM.queueUpdate` scheduler, which a consumer's own
49
+ * reconnect logic may also be deferred through, can resolve after our microtask has already
50
+ * fired, making a same-microtask check unreliable). A macrotask-scale grace period via
51
+ * `setTimeout` is cheap here and outlasts any such scheduler, so once it has passed the paired
52
+ * reconnect must not stay blocked, or the consumer never re-initializes.
53
+ * @internal
54
+ **/
55
+ __blockedDisconnectSurvivedGracePeriod.set(this, false);
45
56
  }
46
57
  /**
47
58
  * @privateRemarks
@@ -127,6 +138,7 @@ export const LifecycleMixin = (Base) => { var _instances, __container, __latestT
127
138
  __hasFirstLoaded = new WeakMap(),
128
139
  __cleanupTimeout = new WeakMap(),
129
140
  __shouldForceLifecycle = new WeakMap(),
141
+ __blockedDisconnectSurvivedGracePeriod = new WeakMap(),
130
142
  _instances = new WeakSet(),
131
143
  __blockLifecycleDueToTokenChange = function __blockLifecycleDueToTokenChange(lifecycleType) {
132
144
  var _b, _c;
@@ -146,6 +158,14 @@ export const LifecycleMixin = (Base) => { var _instances, __container, __latestT
146
158
  // 'reconnect' - otherwise unrelated layout changes while disconnected can block it forever.
147
159
  __classPrivateFieldSet(this, __hasFirstLoaded, false, "f");
148
160
  }
161
+ else {
162
+ // Blocked disconnect: track whether a grace period elapses before the paired reconnect
163
+ // arrives. See `#_blockedDisconnectSurvivedGracePeriod` for why this matters.
164
+ __classPrivateFieldSet(this, __blockedDisconnectSurvivedGracePeriod, false, "f");
165
+ setTimeout(() => {
166
+ __classPrivateFieldSet(this, __blockedDisconnectSurvivedGracePeriod, true, "f");
167
+ }, 0);
168
+ }
149
169
  __classPrivateFieldSet(this, __cleanupTimeout, setTimeout(() => {
150
170
  __classPrivateFieldSet(this, __shouldForceLifecycle, result, "f");
151
171
  if (__classPrivateFieldGet(this, __shouldForceLifecycle, "f")) {
@@ -154,7 +174,7 @@ export const LifecycleMixin = (Base) => { var _instances, __container, __latestT
154
174
  }, CLEANUP_TIMEOUT_MS), "f");
155
175
  }
156
176
  else if (lifecycleType === 'reconnect') {
157
- result = tokensDifferent;
177
+ result = tokensDifferent && !__classPrivateFieldGet(this, __blockedDisconnectSurvivedGracePeriod, "f");
158
178
  __classPrivateFieldSet(this, __latestTokenCode, (_c = __classPrivateFieldGet(this, __container, "f").lifecycleUpdateToken) !== null && _c !== void 0 ? _c : '', "f");
159
179
  clearTimeout(__classPrivateFieldGet(this, __cleanupTimeout, "f"));
160
180
  }
@@ -9094,7 +9094,7 @@
9094
9094
  },
9095
9095
  {
9096
9096
  "kind": "Content",
9097
- "text": ";\n #_shouldForceLifecycle: boolean;\n cloneNode(deep?: boolean): "
9097
+ "text": ";\n #_shouldForceLifecycle: boolean;\n #_blockedDisconnectSurvivedGracePeriod: boolean;\n cloneNode(deep?: boolean): "
9098
9098
  },
9099
9099
  {
9100
9100
  "kind": "Reference",
@@ -1018,6 +1018,17 @@ export declare const LifecycleMixin: <T extends ConstructableLifecycleHandler>(B
1018
1018
  * @internal
1019
1019
  **/
1020
1020
  #_shouldForceLifecycle: boolean;
1021
+ /**
1022
+ * Set once a short grace period has elapsed since a blocked ('reflow') disconnect. Some
1023
+ * consumers run defensive cleanup shortly after despite the block - and don't necessarily use
1024
+ * a plain microtask to do it (e.g. FAST's `DOM.queueUpdate` scheduler, which a consumer's own
1025
+ * reconnect logic may also be deferred through, can resolve after our microtask has already
1026
+ * fired, making a same-microtask check unreliable). A macrotask-scale grace period via
1027
+ * `setTimeout` is cheap here and outlasts any such scheduler, so once it has passed the paired
1028
+ * reconnect must not stay blocked, or the consumer never re-initializes.
1029
+ * @internal
1030
+ **/
1031
+ #_blockedDisconnectSurvivedGracePeriod: boolean;
1021
1032
  /**
1022
1033
  * @privateRemarks
1023
1034
  * Rather than using the basic implementation of cloning we run a copy constructor (deepClone)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-utils",
3
3
  "description": "Genesis Foundation Utils",
4
- "version": "14.496.1",
4
+ "version": "14.496.2-alpha-da9ccbd.0",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -29,18 +29,18 @@
29
29
  }
30
30
  },
31
31
  "devDependencies": {
32
- "@genesislcap/foundation-testing": "14.496.1",
33
- "@genesislcap/genx": "14.496.1",
34
- "@genesislcap/rollup-builder": "14.496.1",
35
- "@genesislcap/ts-builder": "14.496.1",
36
- "@genesislcap/uvu-playwright-builder": "14.496.1",
37
- "@genesislcap/vite-builder": "14.496.1",
38
- "@genesislcap/webpack-builder": "14.496.1",
32
+ "@genesislcap/foundation-testing": "14.496.2-alpha-da9ccbd.0",
33
+ "@genesislcap/genx": "14.496.2-alpha-da9ccbd.0",
34
+ "@genesislcap/rollup-builder": "14.496.2-alpha-da9ccbd.0",
35
+ "@genesislcap/ts-builder": "14.496.2-alpha-da9ccbd.0",
36
+ "@genesislcap/uvu-playwright-builder": "14.496.2-alpha-da9ccbd.0",
37
+ "@genesislcap/vite-builder": "14.496.2-alpha-da9ccbd.0",
38
+ "@genesislcap/webpack-builder": "14.496.2-alpha-da9ccbd.0",
39
39
  "@types/json-schema": "^7.0.11"
40
40
  },
41
41
  "dependencies": {
42
- "@genesislcap/expression-builder": "14.496.1",
43
- "@genesislcap/foundation-logger": "14.496.1",
42
+ "@genesislcap/expression-builder": "14.496.2-alpha-da9ccbd.0",
43
+ "@genesislcap/foundation-logger": "14.496.2-alpha-da9ccbd.0",
44
44
  "@microsoft/fast-components": "2.30.6",
45
45
  "@microsoft/fast-element": "1.14.0",
46
46
  "@microsoft/fast-foundation": "2.50.0",
@@ -58,5 +58,5 @@
58
58
  "access": "public"
59
59
  },
60
60
  "customElements": "dist/custom-elements.json",
61
- "gitHead": "e67ef49c0ef1f81ceeecb9725b06f4b43cda9a95"
61
+ "gitHead": "daac29f621ee844cc6e269c0b8bd52c56bff8cf0"
62
62
  }