@genesislcap/foundation-utils 14.496.2-alpha-438fb6e.0 → 14.496.2-alpha-2c4a633.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.
- package/dist/custom-elements.json +53 -53
- package/dist/dts/mixins/lifecycle/lifecycle.d.ts +6 -8
- package/dist/dts/mixins/lifecycle/lifecycle.d.ts.map +1 -1
- package/dist/esm/mixins/lifecycle/lifecycle.js +15 -17
- package/dist/foundation-utils.api.json +1 -1
- package/dist/foundation-utils.d.ts +6 -8
- package/package.json +11 -11
|
@@ -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",
|
|
@@ -726,6 +673,59 @@
|
|
|
726
673
|
}
|
|
727
674
|
]
|
|
728
675
|
},
|
|
676
|
+
{
|
|
677
|
+
"kind": "javascript-module",
|
|
678
|
+
"path": "src/decorators/index.ts",
|
|
679
|
+
"declarations": [],
|
|
680
|
+
"exports": [
|
|
681
|
+
{
|
|
682
|
+
"kind": "js",
|
|
683
|
+
"name": "*",
|
|
684
|
+
"declaration": {
|
|
685
|
+
"name": "*",
|
|
686
|
+
"package": "./renderOnChange"
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
]
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
"kind": "javascript-module",
|
|
693
|
+
"path": "src/decorators/renderOnChange.ts",
|
|
694
|
+
"declarations": [
|
|
695
|
+
{
|
|
696
|
+
"kind": "function",
|
|
697
|
+
"name": "renderOnChange",
|
|
698
|
+
"parameters": [
|
|
699
|
+
{
|
|
700
|
+
"name": "target",
|
|
701
|
+
"type": {
|
|
702
|
+
"text": "FASTElement & { render(): void }"
|
|
703
|
+
},
|
|
704
|
+
"description": "The target to define the property change handler on."
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
"name": "name",
|
|
708
|
+
"type": {
|
|
709
|
+
"text": "string"
|
|
710
|
+
},
|
|
711
|
+
"description": "The property name."
|
|
712
|
+
}
|
|
713
|
+
],
|
|
714
|
+
"description": "Defines a property changed handler that calls a render() method on the target as an internal observation enhancement.",
|
|
715
|
+
"privacy": "public"
|
|
716
|
+
}
|
|
717
|
+
],
|
|
718
|
+
"exports": [
|
|
719
|
+
{
|
|
720
|
+
"kind": "js",
|
|
721
|
+
"name": "renderOnChange",
|
|
722
|
+
"declaration": {
|
|
723
|
+
"name": "renderOnChange",
|
|
724
|
+
"module": "src/decorators/renderOnChange.ts"
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
]
|
|
728
|
+
},
|
|
729
729
|
{
|
|
730
730
|
"kind": "javascript-module",
|
|
731
731
|
"path": "src/encoding/index.ts",
|
|
@@ -71,16 +71,14 @@ export declare const LifecycleMixin: <T extends ConstructableLifecycleHandler>(B
|
|
|
71
71
|
**/
|
|
72
72
|
#_shouldForceLifecycle: boolean;
|
|
73
73
|
/**
|
|
74
|
-
* Set once a
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* paired reconnect must not stay blocked either, or the consumer never gets a chance to
|
|
80
|
-
* re-initialize what it already destroyed.
|
|
74
|
+
* Set once a short grace period (`setTimeout`) has elapsed since a blocked ('reflow')
|
|
75
|
+
* disconnect. Some consumers run defensive cleanup after the block via schedulers that can
|
|
76
|
+
* outlast a microtask (e.g. FAST's `DOM.queueUpdate`), so a macrotask-scale grace period is
|
|
77
|
+
* needed - once it has passed, the paired reconnect must not stay blocked, or the consumer
|
|
78
|
+
* never re-initializes.
|
|
81
79
|
* @internal
|
|
82
80
|
**/
|
|
83
|
-
#
|
|
81
|
+
#_blockedDisconnectSurvivedGracePeriod: boolean;
|
|
84
82
|
/**
|
|
85
83
|
* @privateRemarks
|
|
86
84
|
* 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,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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,
|
|
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);
|
|
@@ -43,16 +43,14 @@ export const LifecycleMixin = (Base) => { var _instances, __container, __latestT
|
|
|
43
43
|
**/
|
|
44
44
|
__shouldForceLifecycle.set(this, false);
|
|
45
45
|
/**
|
|
46
|
-
* Set once a
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* paired reconnect must not stay blocked either, or the consumer never gets a chance to
|
|
52
|
-
* re-initialize what it already destroyed.
|
|
46
|
+
* Set once a short grace period (`setTimeout`) has elapsed since a blocked ('reflow')
|
|
47
|
+
* disconnect. Some consumers run defensive cleanup after the block via schedulers that can
|
|
48
|
+
* outlast a microtask (e.g. FAST's `DOM.queueUpdate`), so a macrotask-scale grace period is
|
|
49
|
+
* needed - once it has passed, the paired reconnect must not stay blocked, or the consumer
|
|
50
|
+
* never re-initializes.
|
|
53
51
|
* @internal
|
|
54
52
|
**/
|
|
55
|
-
|
|
53
|
+
__blockedDisconnectSurvivedGracePeriod.set(this, false);
|
|
56
54
|
}
|
|
57
55
|
/**
|
|
58
56
|
* @privateRemarks
|
|
@@ -138,7 +136,7 @@ export const LifecycleMixin = (Base) => { var _instances, __container, __latestT
|
|
|
138
136
|
__hasFirstLoaded = new WeakMap(),
|
|
139
137
|
__cleanupTimeout = new WeakMap(),
|
|
140
138
|
__shouldForceLifecycle = new WeakMap(),
|
|
141
|
-
|
|
139
|
+
__blockedDisconnectSurvivedGracePeriod = new WeakMap(),
|
|
142
140
|
_instances = new WeakSet(),
|
|
143
141
|
__blockLifecycleDueToTokenChange = function __blockLifecycleDueToTokenChange(lifecycleType) {
|
|
144
142
|
var _b, _c;
|
|
@@ -159,12 +157,12 @@ export const LifecycleMixin = (Base) => { var _instances, __container, __latestT
|
|
|
159
157
|
__classPrivateFieldSet(this, __hasFirstLoaded, false, "f");
|
|
160
158
|
}
|
|
161
159
|
else {
|
|
162
|
-
// Blocked disconnect: track whether a
|
|
163
|
-
// arrives. See `#
|
|
164
|
-
__classPrivateFieldSet(this,
|
|
165
|
-
|
|
166
|
-
__classPrivateFieldSet(this,
|
|
167
|
-
});
|
|
160
|
+
// Blocked disconnect: track whether a grace period elapses before the paired reconnect
|
|
161
|
+
// arrives. See `#_blockedDisconnectSurvivedGracePeriod` for why this matters.
|
|
162
|
+
__classPrivateFieldSet(this, __blockedDisconnectSurvivedGracePeriod, false, "f");
|
|
163
|
+
setTimeout(() => {
|
|
164
|
+
__classPrivateFieldSet(this, __blockedDisconnectSurvivedGracePeriod, true, "f");
|
|
165
|
+
}, 0);
|
|
168
166
|
}
|
|
169
167
|
__classPrivateFieldSet(this, __cleanupTimeout, setTimeout(() => {
|
|
170
168
|
__classPrivateFieldSet(this, __shouldForceLifecycle, result, "f");
|
|
@@ -174,7 +172,7 @@ export const LifecycleMixin = (Base) => { var _instances, __container, __latestT
|
|
|
174
172
|
}, CLEANUP_TIMEOUT_MS), "f");
|
|
175
173
|
}
|
|
176
174
|
else if (lifecycleType === 'reconnect') {
|
|
177
|
-
result = tokensDifferent && !__classPrivateFieldGet(this,
|
|
175
|
+
result = tokensDifferent && !__classPrivateFieldGet(this, __blockedDisconnectSurvivedGracePeriod, "f");
|
|
178
176
|
__classPrivateFieldSet(this, __latestTokenCode, (_c = __classPrivateFieldGet(this, __container, "f").lifecycleUpdateToken) !== null && _c !== void 0 ? _c : '', "f");
|
|
179
177
|
clearTimeout(__classPrivateFieldGet(this, __cleanupTimeout, "f"));
|
|
180
178
|
}
|
|
@@ -9094,7 +9094,7 @@
|
|
|
9094
9094
|
},
|
|
9095
9095
|
{
|
|
9096
9096
|
"kind": "Content",
|
|
9097
|
-
"text": ";\n #_shouldForceLifecycle: boolean;\n #
|
|
9097
|
+
"text": ";\n #_shouldForceLifecycle: boolean;\n #_blockedDisconnectSurvivedGracePeriod: boolean;\n cloneNode(deep?: boolean): "
|
|
9098
9098
|
},
|
|
9099
9099
|
{
|
|
9100
9100
|
"kind": "Reference",
|
|
@@ -1019,16 +1019,14 @@ export declare const LifecycleMixin: <T extends ConstructableLifecycleHandler>(B
|
|
|
1019
1019
|
**/
|
|
1020
1020
|
#_shouldForceLifecycle: boolean;
|
|
1021
1021
|
/**
|
|
1022
|
-
* Set once a
|
|
1023
|
-
*
|
|
1024
|
-
*
|
|
1025
|
-
*
|
|
1026
|
-
*
|
|
1027
|
-
* paired reconnect must not stay blocked either, or the consumer never gets a chance to
|
|
1028
|
-
* re-initialize what it already destroyed.
|
|
1022
|
+
* Set once a short grace period (`setTimeout`) has elapsed since a blocked ('reflow')
|
|
1023
|
+
* disconnect. Some consumers run defensive cleanup after the block via schedulers that can
|
|
1024
|
+
* outlast a microtask (e.g. FAST's `DOM.queueUpdate`), so a macrotask-scale grace period is
|
|
1025
|
+
* needed - once it has passed, the paired reconnect must not stay blocked, or the consumer
|
|
1026
|
+
* never re-initializes.
|
|
1029
1027
|
* @internal
|
|
1030
1028
|
**/
|
|
1031
|
-
#
|
|
1029
|
+
#_blockedDisconnectSurvivedGracePeriod: boolean;
|
|
1032
1030
|
/**
|
|
1033
1031
|
* @privateRemarks
|
|
1034
1032
|
* 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.2-alpha-
|
|
4
|
+
"version": "14.496.2-alpha-2c4a633.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.2-alpha-
|
|
33
|
-
"@genesislcap/genx": "14.496.2-alpha-
|
|
34
|
-
"@genesislcap/rollup-builder": "14.496.2-alpha-
|
|
35
|
-
"@genesislcap/ts-builder": "14.496.2-alpha-
|
|
36
|
-
"@genesislcap/uvu-playwright-builder": "14.496.2-alpha-
|
|
37
|
-
"@genesislcap/vite-builder": "14.496.2-alpha-
|
|
38
|
-
"@genesislcap/webpack-builder": "14.496.2-alpha-
|
|
32
|
+
"@genesislcap/foundation-testing": "14.496.2-alpha-2c4a633.0",
|
|
33
|
+
"@genesislcap/genx": "14.496.2-alpha-2c4a633.0",
|
|
34
|
+
"@genesislcap/rollup-builder": "14.496.2-alpha-2c4a633.0",
|
|
35
|
+
"@genesislcap/ts-builder": "14.496.2-alpha-2c4a633.0",
|
|
36
|
+
"@genesislcap/uvu-playwright-builder": "14.496.2-alpha-2c4a633.0",
|
|
37
|
+
"@genesislcap/vite-builder": "14.496.2-alpha-2c4a633.0",
|
|
38
|
+
"@genesislcap/webpack-builder": "14.496.2-alpha-2c4a633.0",
|
|
39
39
|
"@types/json-schema": "^7.0.11"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@genesislcap/expression-builder": "14.496.2-alpha-
|
|
43
|
-
"@genesislcap/foundation-logger": "14.496.2-alpha-
|
|
42
|
+
"@genesislcap/expression-builder": "14.496.2-alpha-2c4a633.0",
|
|
43
|
+
"@genesislcap/foundation-logger": "14.496.2-alpha-2c4a633.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": "
|
|
61
|
+
"gitHead": "5df68bd8b1d25f3435e5a8e45da2c79c12579f3f"
|
|
62
62
|
}
|