lwc 2.21.0 → 2.23.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/engine-dom/esm/es2017/engine-dom.js +234 -236
- package/dist/engine-dom/iife/es2017/engine-dom.js +234 -236
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +221 -224
- package/dist/engine-dom/iife/es5/engine-dom.js +282 -265
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +257 -237
- package/dist/engine-dom/umd/es2017/engine-dom.js +234 -236
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +221 -224
- package/dist/engine-dom/umd/es5/engine-dom.js +282 -265
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +257 -237
- package/dist/engine-server/commonjs/es2017/engine-server.js +138 -445
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +138 -445
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +13 -10
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +13 -10
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +13 -10
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +15 -14
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +15 -14
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +13 -10
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +13 -10
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +15 -14
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +15 -14
- package/dist/wire-service/esm/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es5/wire-service.js +2 -2
- package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es5/wire-service.js +2 -2
- package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
- package/package.json +7 -7
|
@@ -415,9 +415,9 @@ function htmlEscape(str, attrMode = false) {
|
|
|
415
415
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
416
416
|
*/
|
|
417
417
|
// Increment whenever the LWC template compiler changes
|
|
418
|
-
const LWC_VERSION = "2.
|
|
418
|
+
const LWC_VERSION = "2.23.0";
|
|
419
419
|
const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
420
|
-
/** version: 2.
|
|
420
|
+
/** version: 2.23.0 */
|
|
421
421
|
|
|
422
422
|
/*
|
|
423
423
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -526,7 +526,7 @@ function setFeatureFlagForTest(name, value) {
|
|
|
526
526
|
setFeatureFlag(name, value);
|
|
527
527
|
}
|
|
528
528
|
}
|
|
529
|
-
/** version: 2.
|
|
529
|
+
/** version: 2.23.0 */
|
|
530
530
|
|
|
531
531
|
/* proxy-compat-disable */
|
|
532
532
|
|
|
@@ -554,40 +554,9 @@ if (process.env.NODE_ENV !== 'production' && typeof __karma__ !== 'undefined') {
|
|
|
554
554
|
}));
|
|
555
555
|
});
|
|
556
556
|
}
|
|
557
|
-
|
|
558
|
-
/*
|
|
559
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
|
560
|
-
* All rights reserved.
|
|
561
|
-
* SPDX-License-Identifier: MIT
|
|
562
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
563
|
-
*/
|
|
564
|
-
let nextTickCallbackQueue = [];
|
|
565
557
|
const SPACE_CHAR = 32;
|
|
566
558
|
const EmptyObject = seal(create(null));
|
|
567
559
|
const EmptyArray = seal([]);
|
|
568
|
-
function flushCallbackQueue() {
|
|
569
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
570
|
-
if (nextTickCallbackQueue.length === 0) {
|
|
571
|
-
throw new Error(`Internal Error: If callbackQueue is scheduled, it is because there must be at least one callback on this pending queue.`);
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
const callbacks = nextTickCallbackQueue;
|
|
575
|
-
nextTickCallbackQueue = []; // reset to a new queue
|
|
576
|
-
for (let i = 0, len = callbacks.length; i < len; i += 1) {
|
|
577
|
-
callbacks[i]();
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
function addCallbackToNextTick(callback) {
|
|
581
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
582
|
-
if (!isFunction$1(callback)) {
|
|
583
|
-
throw new Error(`Internal Error: addCallbackToNextTick() can only accept a function callback`);
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
if (nextTickCallbackQueue.length === 0) {
|
|
587
|
-
Promise.resolve().then(flushCallbackQueue);
|
|
588
|
-
}
|
|
589
|
-
ArrayPush$1.call(nextTickCallbackQueue, callback);
|
|
590
|
-
}
|
|
591
560
|
function guid() {
|
|
592
561
|
function s4() {
|
|
593
562
|
return Math.floor((1 + Math.random()) * 0x10000)
|
|
@@ -616,16 +585,6 @@ function flattenStylesheets(stylesheets) {
|
|
|
616
585
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
617
586
|
*/
|
|
618
587
|
const TargetToReactiveRecordMap = new WeakMap();
|
|
619
|
-
function getReactiveRecord(target) {
|
|
620
|
-
let reactiveRecord = TargetToReactiveRecordMap.get(target);
|
|
621
|
-
if (isUndefined$1(reactiveRecord)) {
|
|
622
|
-
const newRecord = create(null);
|
|
623
|
-
reactiveRecord = newRecord;
|
|
624
|
-
TargetToReactiveRecordMap.set(target, newRecord);
|
|
625
|
-
}
|
|
626
|
-
return reactiveRecord;
|
|
627
|
-
}
|
|
628
|
-
let currentReactiveObserver = null;
|
|
629
588
|
function valueMutated(target, key) {
|
|
630
589
|
const reactiveRecord = TargetToReactiveRecordMap.get(target);
|
|
631
590
|
if (!isUndefined$1(reactiveRecord)) {
|
|
@@ -640,71 +599,9 @@ function valueMutated(target, key) {
|
|
|
640
599
|
}
|
|
641
600
|
function valueObserved(target, key) {
|
|
642
601
|
// We should determine if an active Observing Record is present to track mutations.
|
|
643
|
-
|
|
602
|
+
{
|
|
644
603
|
return;
|
|
645
604
|
}
|
|
646
|
-
const ro = currentReactiveObserver;
|
|
647
|
-
const reactiveRecord = getReactiveRecord(target);
|
|
648
|
-
let reactiveObservers = reactiveRecord[key];
|
|
649
|
-
if (isUndefined$1(reactiveObservers)) {
|
|
650
|
-
reactiveObservers = [];
|
|
651
|
-
reactiveRecord[key] = reactiveObservers;
|
|
652
|
-
}
|
|
653
|
-
else if (reactiveObservers[0] === ro) {
|
|
654
|
-
return; // perf optimization considering that most subscriptions will come from the same record
|
|
655
|
-
}
|
|
656
|
-
if (ArrayIndexOf.call(reactiveObservers, ro) === -1) {
|
|
657
|
-
ro.link(reactiveObservers);
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
class ReactiveObserver {
|
|
661
|
-
constructor(callback) {
|
|
662
|
-
this.listeners = [];
|
|
663
|
-
this.callback = callback;
|
|
664
|
-
}
|
|
665
|
-
observe(job) {
|
|
666
|
-
const inceptionReactiveRecord = currentReactiveObserver;
|
|
667
|
-
currentReactiveObserver = this;
|
|
668
|
-
let error;
|
|
669
|
-
try {
|
|
670
|
-
job();
|
|
671
|
-
}
|
|
672
|
-
catch (e) {
|
|
673
|
-
error = Object(e);
|
|
674
|
-
}
|
|
675
|
-
finally {
|
|
676
|
-
currentReactiveObserver = inceptionReactiveRecord;
|
|
677
|
-
if (error !== undefined) {
|
|
678
|
-
throw error; // eslint-disable-line no-unsafe-finally
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
/**
|
|
683
|
-
* This method is responsible for disconnecting the Reactive Observer
|
|
684
|
-
* from any Reactive Record that has a reference to it, to prevent future
|
|
685
|
-
* notifications about previously recorded access.
|
|
686
|
-
*/
|
|
687
|
-
reset() {
|
|
688
|
-
const { listeners } = this;
|
|
689
|
-
const len = listeners.length;
|
|
690
|
-
if (len > 0) {
|
|
691
|
-
for (let i = 0; i < len; i += 1) {
|
|
692
|
-
const set = listeners[i];
|
|
693
|
-
const pos = ArrayIndexOf.call(listeners[i], this);
|
|
694
|
-
ArraySplice.call(set, pos, 1);
|
|
695
|
-
}
|
|
696
|
-
listeners.length = 0;
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
// friend methods
|
|
700
|
-
notify() {
|
|
701
|
-
this.callback.call(undefined, this);
|
|
702
|
-
}
|
|
703
|
-
link(reactiveObservers) {
|
|
704
|
-
ArrayPush$1.call(reactiveObservers, this);
|
|
705
|
-
// we keep track of observing records where the observing record was added to so we can do some clean up later on
|
|
706
|
-
ArrayPush$1.call(this.listeners, reactiveObservers);
|
|
707
|
-
}
|
|
708
605
|
}
|
|
709
606
|
|
|
710
607
|
/*
|
|
@@ -713,11 +610,16 @@ class ReactiveObserver {
|
|
|
713
610
|
* SPDX-License-Identifier: MIT
|
|
714
611
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
715
612
|
*/
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
613
|
+
const DUMMY_REACTIVE_OBSERVER = {
|
|
614
|
+
observe(job) {
|
|
615
|
+
job();
|
|
616
|
+
},
|
|
617
|
+
reset() { },
|
|
618
|
+
link() { },
|
|
619
|
+
};
|
|
620
|
+
function createReactiveObserver(callback) {
|
|
621
|
+
// On the server side, we don't need mutation tracking. Skipping it improves performance.
|
|
622
|
+
return DUMMY_REACTIVE_OBSERVER;
|
|
721
623
|
}
|
|
722
624
|
|
|
723
625
|
/*
|
|
@@ -1273,6 +1175,13 @@ function patchLightningElementPrototypeWithRestrictions(proto) {
|
|
|
1273
1175
|
defineProperties(proto, getLightningElementPrototypeRestrictionsDescriptors(proto));
|
|
1274
1176
|
}
|
|
1275
1177
|
|
|
1178
|
+
function updateComponentValue(vm, key, newValue) {
|
|
1179
|
+
const { cmpFields } = vm;
|
|
1180
|
+
if (newValue !== cmpFields[key]) {
|
|
1181
|
+
cmpFields[key] = newValue;
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1276
1185
|
/**
|
|
1277
1186
|
* Copyright (C) 2017 salesforce.com, inc.
|
|
1278
1187
|
*/
|
|
@@ -1836,7 +1745,17 @@ const reactiveMembrane = new ObservableMembrane({
|
|
|
1836
1745
|
* change or being removed.
|
|
1837
1746
|
*/
|
|
1838
1747
|
function unwrap(value) {
|
|
1839
|
-
|
|
1748
|
+
// On the server side, we don't need mutation tracking. Skipping it improves performance.
|
|
1749
|
+
return value;
|
|
1750
|
+
}
|
|
1751
|
+
function getReadOnlyProxy(value) {
|
|
1752
|
+
// We must return a frozen wrapper around the value, so that child components cannot mutate properties passed to
|
|
1753
|
+
// them from their parents. This applies to both the client and server.
|
|
1754
|
+
return reactiveMembrane.getReadOnlyProxy(value);
|
|
1755
|
+
}
|
|
1756
|
+
function getReactiveProxy(value) {
|
|
1757
|
+
// On the server side, we don't need mutation tracking. Skipping it improves performance.
|
|
1758
|
+
return value;
|
|
1840
1759
|
}
|
|
1841
1760
|
|
|
1842
1761
|
/*
|
|
@@ -1876,7 +1795,6 @@ function createBridgeToElementDescriptor(propName, descriptor) {
|
|
|
1876
1795
|
}
|
|
1877
1796
|
return;
|
|
1878
1797
|
}
|
|
1879
|
-
componentValueObserved(vm, propName);
|
|
1880
1798
|
return get.call(vm.elm);
|
|
1881
1799
|
},
|
|
1882
1800
|
set(newValue) {
|
|
@@ -1888,10 +1806,7 @@ function createBridgeToElementDescriptor(propName, descriptor) {
|
|
|
1888
1806
|
assert.isFalse(isBeingConstructed(vm), `Failed to construct '${getComponentTag(vm)}': The result must not have attributes.`);
|
|
1889
1807
|
assert.invariant(!isObject(newValue) || isNull(newValue), `Invalid value "${newValue}" for "${propName}" of ${vm}. Value cannot be an object, must be a primitive value.`);
|
|
1890
1808
|
}
|
|
1891
|
-
|
|
1892
|
-
vm.cmpProps[propName] = newValue;
|
|
1893
|
-
componentValueMutated(vm, propName);
|
|
1894
|
-
}
|
|
1809
|
+
updateComponentValue(vm, propName, newValue);
|
|
1895
1810
|
return set.call(vm.elm, newValue);
|
|
1896
1811
|
},
|
|
1897
1812
|
};
|
|
@@ -1926,8 +1841,6 @@ const LightningElement = function () {
|
|
|
1926
1841
|
vm.setHook = setHook;
|
|
1927
1842
|
vm.getHook = getHook;
|
|
1928
1843
|
}
|
|
1929
|
-
// Making the component instance a live value when using Locker to support expandos.
|
|
1930
|
-
this[lockerLivePropertyKey] = undefined;
|
|
1931
1844
|
// Linking elm, shadow root and component with the VM.
|
|
1932
1845
|
associateVM(component, vm);
|
|
1933
1846
|
associateVM(elm, vm);
|
|
@@ -2182,21 +2095,35 @@ function createObservedFieldPropertyDescriptor(key) {
|
|
|
2182
2095
|
return {
|
|
2183
2096
|
get() {
|
|
2184
2097
|
const vm = getAssociatedVM(this);
|
|
2185
|
-
componentValueObserved(vm, key);
|
|
2186
2098
|
return vm.cmpFields[key];
|
|
2187
2099
|
},
|
|
2188
2100
|
set(newValue) {
|
|
2189
2101
|
const vm = getAssociatedVM(this);
|
|
2190
|
-
|
|
2191
|
-
vm.cmpFields[key] = newValue;
|
|
2192
|
-
componentValueMutated(vm, key);
|
|
2193
|
-
}
|
|
2102
|
+
updateComponentValue(vm, key, newValue);
|
|
2194
2103
|
},
|
|
2195
2104
|
enumerable: true,
|
|
2196
2105
|
configurable: true,
|
|
2197
2106
|
};
|
|
2198
2107
|
}
|
|
2199
2108
|
|
|
2109
|
+
/*
|
|
2110
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
2111
|
+
* All rights reserved.
|
|
2112
|
+
* SPDX-License-Identifier: MIT
|
|
2113
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
2114
|
+
*/
|
|
2115
|
+
const DUMMY_ACCESSOR_REACTIVE_OBSERVER = {
|
|
2116
|
+
observe(job) {
|
|
2117
|
+
job();
|
|
2118
|
+
},
|
|
2119
|
+
reset() { },
|
|
2120
|
+
link() { },
|
|
2121
|
+
};
|
|
2122
|
+
function createAccessorReactiveObserver(vm, set) {
|
|
2123
|
+
// On the server side, we don't need mutation tracking. Skipping it improves performance.
|
|
2124
|
+
return DUMMY_ACCESSOR_REACTIVE_OBSERVER;
|
|
2125
|
+
}
|
|
2126
|
+
|
|
2200
2127
|
/*
|
|
2201
2128
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
2202
2129
|
* All rights reserved.
|
|
@@ -2222,8 +2149,6 @@ function createPublicPropertyDescriptor(key) {
|
|
|
2222
2149
|
|
|
2223
2150
|
return;
|
|
2224
2151
|
}
|
|
2225
|
-
|
|
2226
|
-
componentValueObserved(vm, key);
|
|
2227
2152
|
return vm.cmpProps[key];
|
|
2228
2153
|
},
|
|
2229
2154
|
|
|
@@ -2237,57 +2162,12 @@ function createPublicPropertyDescriptor(key) {
|
|
|
2237
2162
|
}
|
|
2238
2163
|
|
|
2239
2164
|
vm.cmpProps[key] = newValue;
|
|
2240
|
-
componentValueMutated(vm, key);
|
|
2241
2165
|
},
|
|
2242
2166
|
|
|
2243
2167
|
enumerable: true,
|
|
2244
2168
|
configurable: true
|
|
2245
2169
|
};
|
|
2246
2170
|
}
|
|
2247
|
-
class AccessorReactiveObserver extends ReactiveObserver {
|
|
2248
|
-
constructor(vm, set) {
|
|
2249
|
-
super(() => {
|
|
2250
|
-
if (isFalse(this.debouncing)) {
|
|
2251
|
-
this.debouncing = true;
|
|
2252
|
-
addCallbackToNextTick(() => {
|
|
2253
|
-
if (isTrue(this.debouncing)) {
|
|
2254
|
-
const {
|
|
2255
|
-
value
|
|
2256
|
-
} = this;
|
|
2257
|
-
const {
|
|
2258
|
-
isDirty: dirtyStateBeforeSetterCall,
|
|
2259
|
-
component,
|
|
2260
|
-
idx
|
|
2261
|
-
} = vm;
|
|
2262
|
-
set.call(component, value); // de-bouncing after the call to the original setter to prevent
|
|
2263
|
-
// infinity loop if the setter itself is mutating things that
|
|
2264
|
-
// were accessed during the previous invocation.
|
|
2265
|
-
|
|
2266
|
-
this.debouncing = false;
|
|
2267
|
-
|
|
2268
|
-
if (isTrue(vm.isDirty) && isFalse(dirtyStateBeforeSetterCall) && idx > 0) {
|
|
2269
|
-
// immediate rehydration due to a setter driven mutation, otherwise
|
|
2270
|
-
// the component will get rendered on the second tick, which it is not
|
|
2271
|
-
// desirable.
|
|
2272
|
-
rerenderVM(vm);
|
|
2273
|
-
}
|
|
2274
|
-
}
|
|
2275
|
-
});
|
|
2276
|
-
}
|
|
2277
|
-
});
|
|
2278
|
-
this.debouncing = false;
|
|
2279
|
-
}
|
|
2280
|
-
|
|
2281
|
-
reset(value) {
|
|
2282
|
-
super.reset();
|
|
2283
|
-
this.debouncing = false;
|
|
2284
|
-
|
|
2285
|
-
if (arguments.length > 0) {
|
|
2286
|
-
this.value = value;
|
|
2287
|
-
}
|
|
2288
|
-
}
|
|
2289
|
-
|
|
2290
|
-
}
|
|
2291
2171
|
function createPublicAccessorDescriptor(key, descriptor) {
|
|
2292
2172
|
const {
|
|
2293
2173
|
get,
|
|
@@ -2328,7 +2208,7 @@ function createPublicAccessorDescriptor(key, descriptor) {
|
|
|
2328
2208
|
let ro = vm.oar[key];
|
|
2329
2209
|
|
|
2330
2210
|
if (isUndefined$1(ro)) {
|
|
2331
|
-
ro = vm.oar[key] =
|
|
2211
|
+
ro = vm.oar[key] = createAccessorReactiveObserver();
|
|
2332
2212
|
} // every time we invoke this setter from outside (through this wrapper setter)
|
|
2333
2213
|
// we should reset the value and then debounce just in case there is a pending
|
|
2334
2214
|
// invocation the next tick that is not longer relevant since the value is changing
|
|
@@ -2360,7 +2240,7 @@ function createPublicAccessorDescriptor(key, descriptor) {
|
|
|
2360
2240
|
*/
|
|
2361
2241
|
function track(target) {
|
|
2362
2242
|
if (arguments.length === 1) {
|
|
2363
|
-
return
|
|
2243
|
+
return getReactiveProxy(target);
|
|
2364
2244
|
}
|
|
2365
2245
|
if (process.env.NODE_ENV !== 'production') {
|
|
2366
2246
|
assert.fail(`@track decorator can only be used with one argument to return a trackable object, or as a decorator function.`);
|
|
@@ -2371,7 +2251,6 @@ function internalTrackDecorator(key) {
|
|
|
2371
2251
|
return {
|
|
2372
2252
|
get() {
|
|
2373
2253
|
const vm = getAssociatedVM(this);
|
|
2374
|
-
componentValueObserved(vm, key);
|
|
2375
2254
|
return vm.cmpFields[key];
|
|
2376
2255
|
},
|
|
2377
2256
|
set(newValue) {
|
|
@@ -2381,11 +2260,8 @@ function internalTrackDecorator(key) {
|
|
|
2381
2260
|
assert.invariant(!isInvokingRender, `${vmBeingRendered}.render() method has side effects on the state of ${vm}.${toString$1(key)}`);
|
|
2382
2261
|
assert.invariant(!isUpdatingTemplate, `Updating the template of ${vmBeingRendered} has side effects on the state of ${vm}.${toString$1(key)}`);
|
|
2383
2262
|
}
|
|
2384
|
-
const reactiveOrAnyValue =
|
|
2385
|
-
|
|
2386
|
-
vm.cmpFields[key] = reactiveOrAnyValue;
|
|
2387
|
-
componentValueMutated(vm, key);
|
|
2388
|
-
}
|
|
2263
|
+
const reactiveOrAnyValue = getReactiveProxy(newValue);
|
|
2264
|
+
updateComponentValue(vm, key, reactiveOrAnyValue);
|
|
2389
2265
|
},
|
|
2390
2266
|
enumerable: true,
|
|
2391
2267
|
configurable: true,
|
|
@@ -2413,7 +2289,6 @@ function internalWireFieldDecorator(key) {
|
|
|
2413
2289
|
return {
|
|
2414
2290
|
get() {
|
|
2415
2291
|
const vm = getAssociatedVM(this);
|
|
2416
|
-
componentValueObserved(vm, key);
|
|
2417
2292
|
return vm.cmpFields[key];
|
|
2418
2293
|
},
|
|
2419
2294
|
set(value) {
|
|
@@ -2424,10 +2299,7 @@ function internalWireFieldDecorator(key) {
|
|
|
2424
2299
|
* letting the author to do the wrong thing, but it will keep our
|
|
2425
2300
|
* system to be backward compatible.
|
|
2426
2301
|
*/
|
|
2427
|
-
|
|
2428
|
-
vm.cmpFields[key] = value;
|
|
2429
|
-
componentValueMutated(vm, key);
|
|
2430
|
-
}
|
|
2302
|
+
updateComponentValue(vm, key, value);
|
|
2431
2303
|
},
|
|
2432
2304
|
enumerable: true,
|
|
2433
2305
|
configurable: true,
|
|
@@ -2773,7 +2645,7 @@ function createSetter(key) {
|
|
|
2773
2645
|
fn = cachedSetterByKey[key] = function (newValue) {
|
|
2774
2646
|
const vm = getAssociatedVM(this);
|
|
2775
2647
|
const { setHook } = vm;
|
|
2776
|
-
newValue =
|
|
2648
|
+
newValue = getReadOnlyProxy(newValue);
|
|
2777
2649
|
setHook(vm.component, key, newValue);
|
|
2778
2650
|
};
|
|
2779
2651
|
}
|
|
@@ -3385,38 +3257,20 @@ function getScopeTokenClass(owner) {
|
|
|
3385
3257
|
const { cmpTemplate, context } = owner;
|
|
3386
3258
|
return (context.hasScopedStyles && (cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken)) || null;
|
|
3387
3259
|
}
|
|
3388
|
-
function getNearestNativeShadowComponent(vm) {
|
|
3389
|
-
const owner = getNearestShadowComponent(vm);
|
|
3390
|
-
if (!isNull(owner) && owner.shadowMode === 1 /* ShadowMode.Synthetic */) {
|
|
3391
|
-
// Synthetic-within-native is impossible. So if the nearest shadow component is
|
|
3392
|
-
// synthetic, we know we won't find a native component if we go any further.
|
|
3393
|
-
return null;
|
|
3394
|
-
}
|
|
3395
|
-
return owner;
|
|
3396
|
-
}
|
|
3397
3260
|
function createStylesheet(vm, stylesheets) {
|
|
3398
|
-
const { renderMode, shadowMode, renderer: {
|
|
3261
|
+
const { renderMode, shadowMode, renderer: { insertStylesheet }, } = vm;
|
|
3399
3262
|
if (renderMode === 1 /* RenderMode.Shadow */ && shadowMode === 1 /* ShadowMode.Synthetic */) {
|
|
3400
3263
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
3401
3264
|
insertStylesheet(stylesheets[i]);
|
|
3402
3265
|
}
|
|
3403
3266
|
}
|
|
3404
|
-
else
|
|
3267
|
+
else {
|
|
3405
3268
|
// Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
|
|
3406
3269
|
// This works in the client, because the stylesheets are created, and cached in the VM
|
|
3407
3270
|
// the first time the VM renders.
|
|
3408
3271
|
// native shadow or light DOM, SSR
|
|
3409
3272
|
return ArrayMap.call(stylesheets, createInlineStyleVNode);
|
|
3410
3273
|
}
|
|
3411
|
-
else {
|
|
3412
|
-
// native shadow or light DOM, DOM renderer
|
|
3413
|
-
const root = getNearestNativeShadowComponent(vm);
|
|
3414
|
-
// null root means a global style
|
|
3415
|
-
const target = isNull(root) ? undefined : root.shadowRoot;
|
|
3416
|
-
for (let i = 0; i < stylesheets.length; i++) {
|
|
3417
|
-
insertStylesheet(stylesheets[i], target);
|
|
3418
|
-
}
|
|
3419
|
-
}
|
|
3420
3274
|
return null;
|
|
3421
3275
|
}
|
|
3422
3276
|
|
|
@@ -3702,7 +3556,7 @@ function patchChildren(c1, c2, parent, renderer) {
|
|
|
3702
3556
|
updateStaticChildren(c1, c2, parent, renderer);
|
|
3703
3557
|
}
|
|
3704
3558
|
}
|
|
3705
|
-
function patch(n1, n2, renderer) {
|
|
3559
|
+
function patch(n1, n2, parent, renderer) {
|
|
3706
3560
|
var _a, _b;
|
|
3707
3561
|
if (n1 === n2) {
|
|
3708
3562
|
return;
|
|
@@ -3731,7 +3585,7 @@ function patch(n1, n2, renderer) {
|
|
|
3731
3585
|
patchElement(n1, n2, (_a = n2.data.renderer) !== null && _a !== void 0 ? _a : renderer);
|
|
3732
3586
|
break;
|
|
3733
3587
|
case 3 /* VNodeType.CustomElement */:
|
|
3734
|
-
patchCustomElement(n1, n2, (_b = n2.data.renderer) !== null && _b !== void 0 ? _b : renderer);
|
|
3588
|
+
patchCustomElement(n1, n2, parent, (_b = n2.data.renderer) !== null && _b !== void 0 ? _b : renderer);
|
|
3735
3589
|
break;
|
|
3736
3590
|
}
|
|
3737
3591
|
}
|
|
@@ -3792,10 +3646,11 @@ function mountElement(vnode, parent, anchor, renderer) {
|
|
|
3792
3646
|
const { sel, owner, data: { svg }, } = vnode;
|
|
3793
3647
|
const { createElement } = renderer;
|
|
3794
3648
|
const namespace = isTrue(svg) ? SVG_NAMESPACE : undefined;
|
|
3795
|
-
const elm = createElement(sel, namespace);
|
|
3649
|
+
const elm = (vnode.elm = createElement(sel, namespace));
|
|
3796
3650
|
linkNodeToShadow(elm, owner, renderer);
|
|
3797
|
-
|
|
3798
|
-
|
|
3651
|
+
applyStyleScoping(elm, owner, renderer);
|
|
3652
|
+
applyDomManual(elm, vnode);
|
|
3653
|
+
applyElementRestrictions(elm, vnode);
|
|
3799
3654
|
patchElementPropsAndAttrs$1(null, vnode, renderer);
|
|
3800
3655
|
insertNode(elm, parent, anchor, renderer);
|
|
3801
3656
|
mountVNodes(vnode.children, elm, renderer, null);
|
|
@@ -3810,6 +3665,7 @@ function mountStatic(vnode, parent, anchor, renderer) {
|
|
|
3810
3665
|
const { cloneNode, isSyntheticShadowDefined } = renderer;
|
|
3811
3666
|
const elm = (vnode.elm = cloneNode(vnode.fragment, true));
|
|
3812
3667
|
linkNodeToShadow(elm, owner, renderer);
|
|
3668
|
+
applyElementRestrictions(elm, vnode);
|
|
3813
3669
|
// Marks this node as Static to propagate the shadow resolver. must happen after elm is assigned to the proper shadow
|
|
3814
3670
|
const { renderMode, shadowMode } = owner;
|
|
3815
3671
|
if (isSyntheticShadowDefined) {
|
|
@@ -3817,10 +3673,6 @@ function mountStatic(vnode, parent, anchor, renderer) {
|
|
|
3817
3673
|
elm[KEY__SHADOW_STATIC] = true;
|
|
3818
3674
|
}
|
|
3819
3675
|
}
|
|
3820
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
3821
|
-
const isLight = renderMode === 0 /* RenderMode.Light */;
|
|
3822
|
-
patchElementWithRestrictions(elm, { isPortal: false, isLight });
|
|
3823
|
-
}
|
|
3824
3676
|
insertNode(elm, parent, anchor, renderer);
|
|
3825
3677
|
}
|
|
3826
3678
|
function mountCustomElement(vnode, parent, anchor, renderer) {
|
|
@@ -3837,9 +3689,10 @@ function mountCustomElement(vnode, parent, anchor, renderer) {
|
|
|
3837
3689
|
// the custom element from the registry is expecting an upgrade callback
|
|
3838
3690
|
vm = createViewModelHook(elm, vnode, renderer);
|
|
3839
3691
|
});
|
|
3840
|
-
linkNodeToShadow(elm, owner, renderer);
|
|
3841
3692
|
vnode.elm = elm;
|
|
3842
3693
|
vnode.vm = vm;
|
|
3694
|
+
linkNodeToShadow(elm, owner, renderer);
|
|
3695
|
+
applyStyleScoping(elm, owner, renderer);
|
|
3843
3696
|
if (vm) {
|
|
3844
3697
|
allocateChildren(vnode, vm);
|
|
3845
3698
|
}
|
|
@@ -3859,22 +3712,32 @@ function mountCustomElement(vnode, parent, anchor, renderer) {
|
|
|
3859
3712
|
appendVM(vm);
|
|
3860
3713
|
}
|
|
3861
3714
|
}
|
|
3862
|
-
function patchCustomElement(n1, n2, renderer) {
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
allocateChildren(n2, vm);
|
|
3715
|
+
function patchCustomElement(n1, n2, parent, renderer) {
|
|
3716
|
+
if (n1.ctor !== n2.ctor) {
|
|
3717
|
+
// If the constructor, unmount the current component and mount a new one using the new
|
|
3718
|
+
// constructor.
|
|
3719
|
+
const anchor = renderer.nextSibling(n1.elm);
|
|
3720
|
+
unmount(n1, parent, renderer, true);
|
|
3721
|
+
mountCustomElement(n2, parent, anchor, renderer);
|
|
3870
3722
|
}
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3723
|
+
else {
|
|
3724
|
+
// Otherwise patch the existing component with new props/attrs/etc.
|
|
3725
|
+
const elm = (n2.elm = n1.elm);
|
|
3726
|
+
const vm = (n2.vm = n1.vm);
|
|
3727
|
+
patchElementPropsAndAttrs$1(n1, n2, renderer);
|
|
3728
|
+
if (!isUndefined$1(vm)) {
|
|
3729
|
+
// in fallback mode, the allocation will always set children to
|
|
3730
|
+
// empty and delegate the real allocation to the slot elements
|
|
3731
|
+
allocateChildren(n2, vm);
|
|
3732
|
+
}
|
|
3733
|
+
// in fallback mode, the children will be always empty, so, nothing
|
|
3734
|
+
// will happen, but in native, it does allocate the light dom
|
|
3735
|
+
patchChildren(n1.children, n2.children, elm, renderer);
|
|
3736
|
+
if (!isUndefined$1(vm)) {
|
|
3737
|
+
// this will probably update the shadowRoot, but only if the vm is in a dirty state
|
|
3738
|
+
// this is important to preserve the top to bottom synchronous rendering phase.
|
|
3739
|
+
rerenderVM(vm);
|
|
3740
|
+
}
|
|
3878
3741
|
}
|
|
3879
3742
|
}
|
|
3880
3743
|
function mountVNodes(vnodes, parent, renderer, anchor, start = 0, end = vnodes.length) {
|
|
@@ -3923,22 +3786,6 @@ function unmountVNodes(vnodes, parent, renderer, doRemove = false, start = 0, en
|
|
|
3923
3786
|
function isVNode(vnode) {
|
|
3924
3787
|
return vnode != null;
|
|
3925
3788
|
}
|
|
3926
|
-
function observeElementChildNodes(elm) {
|
|
3927
|
-
elm.$domManual$ = true;
|
|
3928
|
-
}
|
|
3929
|
-
function setElementShadowToken(elm, token) {
|
|
3930
|
-
elm.$shadowToken$ = token;
|
|
3931
|
-
}
|
|
3932
|
-
// Set the scope token class for *.scoped.css styles
|
|
3933
|
-
function setScopeTokenClassIfNecessary(elm, owner, renderer) {
|
|
3934
|
-
const token = getScopeTokenClass(owner);
|
|
3935
|
-
if (!isNull(token)) {
|
|
3936
|
-
const { getClassList } = renderer;
|
|
3937
|
-
// TODO [#2762]: this dot notation with add is probably problematic
|
|
3938
|
-
// probably we should have a renderer api for just the add operation
|
|
3939
|
-
getClassList(elm).add(token);
|
|
3940
|
-
}
|
|
3941
|
-
}
|
|
3942
3789
|
function linkNodeToShadow(elm, owner, renderer) {
|
|
3943
3790
|
const { renderRoot, renderMode, shadowMode } = owner;
|
|
3944
3791
|
const { isSyntheticShadowDefined } = renderer;
|
|
@@ -3991,31 +3838,37 @@ function patchElementPropsAndAttrs$1(oldVnode, vnode, renderer) {
|
|
|
3991
3838
|
patchAttributes(oldVnode, vnode, renderer);
|
|
3992
3839
|
patchProps(oldVnode, vnode, renderer);
|
|
3993
3840
|
}
|
|
3994
|
-
function
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
if (
|
|
3998
|
-
const {
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
context.lwc.dom === "manual" /* LwcDomMode.Manual */) {
|
|
4003
|
-
// this element will now accept any manual content inserted into it
|
|
4004
|
-
observeElementChildNodes(elm);
|
|
4005
|
-
}
|
|
4006
|
-
if (!isUndefined$1(stylesheetToken)) {
|
|
4007
|
-
// when running in synthetic shadow mode, we need to set the shadowToken value
|
|
4008
|
-
// into each element from the template, so they can be styled accordingly.
|
|
4009
|
-
setElementShadowToken(elm, stylesheetToken);
|
|
4010
|
-
}
|
|
3841
|
+
function applyStyleScoping(elm, owner, renderer) {
|
|
3842
|
+
// Set the class name for `*.scoped.css` style scoping.
|
|
3843
|
+
const scopeToken = getScopeTokenClass(owner);
|
|
3844
|
+
if (!isNull(scopeToken)) {
|
|
3845
|
+
const { getClassList } = renderer;
|
|
3846
|
+
// TODO [#2762]: this dot notation with add is probably problematic
|
|
3847
|
+
// probably we should have a renderer api for just the add operation
|
|
3848
|
+
getClassList(elm).add(scopeToken);
|
|
4011
3849
|
}
|
|
3850
|
+
// Set property element for synthetic shadow DOM style scoping.
|
|
3851
|
+
const { stylesheetToken: syntheticToken } = owner.context;
|
|
3852
|
+
if (owner.shadowMode === 1 /* ShadowMode.Synthetic */ && !isUndefined$1(syntheticToken)) {
|
|
3853
|
+
elm.$shadowToken$ = syntheticToken;
|
|
3854
|
+
}
|
|
3855
|
+
}
|
|
3856
|
+
function applyDomManual(elm, vnode) {
|
|
3857
|
+
var _a;
|
|
3858
|
+
const { owner, data: { context }, } = vnode;
|
|
3859
|
+
if (owner.shadowMode === 1 /* ShadowMode.Synthetic */ && ((_a = context === null || context === void 0 ? void 0 : context.lwc) === null || _a === void 0 ? void 0 : _a.dom) === "manual" /* LwcDomMode.Manual */) {
|
|
3860
|
+
elm.$domManual$ = true;
|
|
3861
|
+
}
|
|
3862
|
+
}
|
|
3863
|
+
function applyElementRestrictions(elm, vnode) {
|
|
3864
|
+
var _a, _b;
|
|
4012
3865
|
if (process.env.NODE_ENV !== 'production') {
|
|
4013
|
-
const
|
|
4014
|
-
const
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
3866
|
+
const isPortal = vnode.type === 2 /* VNodeType.Element */ && ((_b = (_a = vnode.data.context) === null || _a === void 0 ? void 0 : _a.lwc) === null || _b === void 0 ? void 0 : _b.dom) === "manual" /* LwcDomMode.Manual */;
|
|
3867
|
+
const isLight = vnode.owner.renderMode === 0 /* RenderMode.Light */;
|
|
3868
|
+
patchElementWithRestrictions(elm, {
|
|
3869
|
+
isPortal,
|
|
3870
|
+
isLight,
|
|
3871
|
+
});
|
|
4019
3872
|
}
|
|
4020
3873
|
}
|
|
4021
3874
|
function allocateChildren(vnode, vm) {
|
|
@@ -4050,15 +3903,6 @@ function createViewModelHook(elm, vnode, renderer) {
|
|
|
4050
3903
|
return vm;
|
|
4051
3904
|
}
|
|
4052
3905
|
const { sel, mode, ctor, owner } = vnode;
|
|
4053
|
-
setScopeTokenClassIfNecessary(elm, owner, renderer);
|
|
4054
|
-
if (owner.shadowMode === 1 /* ShadowMode.Synthetic */) {
|
|
4055
|
-
const { stylesheetToken } = owner.context;
|
|
4056
|
-
// when running in synthetic shadow mode, we need to set the shadowToken value
|
|
4057
|
-
// into each element from the template, so they can be styled accordingly.
|
|
4058
|
-
if (!isUndefined$1(stylesheetToken)) {
|
|
4059
|
-
setElementShadowToken(elm, stylesheetToken);
|
|
4060
|
-
}
|
|
4061
|
-
}
|
|
4062
3906
|
vm = createVM(elm, ctor, renderer, {
|
|
4063
3907
|
mode,
|
|
4064
3908
|
owner,
|
|
@@ -4163,25 +4007,25 @@ function updateDynamicChildren(oldCh, newCh, parent, renderer) {
|
|
|
4163
4007
|
newEndVnode = newCh[--newEndIdx];
|
|
4164
4008
|
}
|
|
4165
4009
|
else if (isSameVnode(oldStartVnode, newStartVnode)) {
|
|
4166
|
-
patch(oldStartVnode, newStartVnode, renderer);
|
|
4010
|
+
patch(oldStartVnode, newStartVnode, parent, renderer);
|
|
4167
4011
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
4168
4012
|
newStartVnode = newCh[++newStartIdx];
|
|
4169
4013
|
}
|
|
4170
4014
|
else if (isSameVnode(oldEndVnode, newEndVnode)) {
|
|
4171
|
-
patch(oldEndVnode, newEndVnode, renderer);
|
|
4015
|
+
patch(oldEndVnode, newEndVnode, parent, renderer);
|
|
4172
4016
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
4173
4017
|
newEndVnode = newCh[--newEndIdx];
|
|
4174
4018
|
}
|
|
4175
4019
|
else if (isSameVnode(oldStartVnode, newEndVnode)) {
|
|
4176
4020
|
// Vnode moved right
|
|
4177
|
-
patch(oldStartVnode, newEndVnode, renderer);
|
|
4021
|
+
patch(oldStartVnode, newEndVnode, parent, renderer);
|
|
4178
4022
|
insertNode(oldStartVnode.elm, parent, renderer.nextSibling(oldEndVnode.elm), renderer);
|
|
4179
4023
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
4180
4024
|
newEndVnode = newCh[--newEndIdx];
|
|
4181
4025
|
}
|
|
4182
4026
|
else if (isSameVnode(oldEndVnode, newStartVnode)) {
|
|
4183
4027
|
// Vnode moved left
|
|
4184
|
-
patch(oldEndVnode, newStartVnode, renderer);
|
|
4028
|
+
patch(oldEndVnode, newStartVnode, parent, renderer);
|
|
4185
4029
|
insertNode(newStartVnode.elm, parent, oldStartVnode.elm, renderer);
|
|
4186
4030
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
4187
4031
|
newStartVnode = newCh[++newStartIdx];
|
|
@@ -4204,7 +4048,7 @@ function updateDynamicChildren(oldCh, newCh, parent, renderer) {
|
|
|
4204
4048
|
mount(newStartVnode, parent, renderer, oldStartVnode.elm);
|
|
4205
4049
|
}
|
|
4206
4050
|
else {
|
|
4207
|
-
patch(elmToMove, newStartVnode, renderer);
|
|
4051
|
+
patch(elmToMove, newStartVnode, parent, renderer);
|
|
4208
4052
|
// Delete the old child, but copy the array since it is read-only.
|
|
4209
4053
|
// The `oldCh` will be GC'ed after `updateDynamicChildren` is complete,
|
|
4210
4054
|
// so we only care about the `oldCh` object inside this function.
|
|
@@ -4264,7 +4108,7 @@ function updateStaticChildren(c1, c2, parent, renderer) {
|
|
|
4264
4108
|
if (isVNode(n1)) {
|
|
4265
4109
|
if (isVNode(n2)) {
|
|
4266
4110
|
// both vnodes are equivalent, and we just need to patch them
|
|
4267
|
-
patch(n1, n2, renderer);
|
|
4111
|
+
patch(n1, n2, parent, renderer);
|
|
4268
4112
|
anchor = n2.elm;
|
|
4269
4113
|
}
|
|
4270
4114
|
else {
|
|
@@ -4598,13 +4442,6 @@ function fid(url) {
|
|
|
4598
4442
|
}
|
|
4599
4443
|
return url;
|
|
4600
4444
|
}
|
|
4601
|
-
/**
|
|
4602
|
-
* Map to store an index value assigned to any dynamic component reference ingested
|
|
4603
|
-
* by dc() api. This allows us to generate a unique unique per template per dynamic
|
|
4604
|
-
* component reference to avoid diffing algo mismatches.
|
|
4605
|
-
*/
|
|
4606
|
-
const DynamicImportedComponentMap = new Map();
|
|
4607
|
-
let dynamicImportedComponentCounter = 0;
|
|
4608
4445
|
/**
|
|
4609
4446
|
* create a dynamic component via `<x-foo lwc:dynamic={Ctor}>`
|
|
4610
4447
|
*/
|
|
@@ -4621,18 +4458,7 @@ function dc(sel, Ctor, data, children = EmptyArray) {
|
|
|
4621
4458
|
if (!isComponentConstructor(Ctor)) {
|
|
4622
4459
|
throw new Error(`Invalid LWC Constructor ${toString$1(Ctor)} for custom element <${sel}>.`);
|
|
4623
4460
|
}
|
|
4624
|
-
|
|
4625
|
-
if (isUndefined$1(idx)) {
|
|
4626
|
-
idx = dynamicImportedComponentCounter++;
|
|
4627
|
-
DynamicImportedComponentMap.set(Ctor, idx);
|
|
4628
|
-
}
|
|
4629
|
-
// the new vnode key is a mix of idx and compiler key, this is required by the diffing algo
|
|
4630
|
-
// to identify different constructors as vnodes with different keys to avoid reusing the
|
|
4631
|
-
// element used for previous constructors.
|
|
4632
|
-
// Shallow clone is necessary here becuase VElementData may be shared across VNodes due to
|
|
4633
|
-
// hoisting optimization.
|
|
4634
|
-
const newData = Object.assign(Object.assign({}, data), { key: `dc:${idx}:${data.key}` });
|
|
4635
|
-
return c(sel, Ctor, newData, children);
|
|
4461
|
+
return c(sel, Ctor, data, children);
|
|
4636
4462
|
}
|
|
4637
4463
|
/**
|
|
4638
4464
|
* slow children collection marking mechanism. this API allows the compiler to signal
|
|
@@ -5069,13 +4895,7 @@ function getComponentRegisteredTemplate(Ctor) {
|
|
|
5069
4895
|
return signedTemplateMap.get(Ctor);
|
|
5070
4896
|
}
|
|
5071
4897
|
function getTemplateReactiveObserver(vm) {
|
|
5072
|
-
return
|
|
5073
|
-
const { isDirty } = vm;
|
|
5074
|
-
if (isFalse(isDirty)) {
|
|
5075
|
-
markComponentAsDirty(vm);
|
|
5076
|
-
scheduleRehydration(vm);
|
|
5077
|
-
}
|
|
5078
|
-
});
|
|
4898
|
+
return createReactiveObserver();
|
|
5079
4899
|
}
|
|
5080
4900
|
function renderComponent$1(vm) {
|
|
5081
4901
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -5312,7 +5132,7 @@ function createVM(elm, ctor, renderer, options) {
|
|
|
5312
5132
|
renderer
|
|
5313
5133
|
};
|
|
5314
5134
|
vm.shadowMode = computeShadowMode(vm, renderer);
|
|
5315
|
-
vm.tro = getTemplateReactiveObserver(
|
|
5135
|
+
vm.tro = getTemplateReactiveObserver();
|
|
5316
5136
|
|
|
5317
5137
|
if (process.env.NODE_ENV !== 'production') {
|
|
5318
5138
|
vm.toString = () => {
|
|
@@ -5474,89 +5294,7 @@ function patchShadowRoot(vm, newCh) {
|
|
|
5474
5294
|
|
|
5475
5295
|
if (vm.state === 1
|
|
5476
5296
|
/* VMState.connected */
|
|
5477
|
-
)
|
|
5478
|
-
// If the element is connected, that means connectedCallback was already issued, and
|
|
5479
|
-
// any successive rendering should finish with the call to renderedCallback, otherwise
|
|
5480
|
-
// the connectedCallback will take care of calling it in the right order at the end of
|
|
5481
|
-
// the current rehydration process.
|
|
5482
|
-
runRenderedCallback(vm);
|
|
5483
|
-
}
|
|
5484
|
-
}
|
|
5485
|
-
|
|
5486
|
-
function runRenderedCallback(vm) {
|
|
5487
|
-
const {
|
|
5488
|
-
def: {
|
|
5489
|
-
renderedCallback
|
|
5490
|
-
},
|
|
5491
|
-
renderer: {
|
|
5492
|
-
ssr
|
|
5493
|
-
}
|
|
5494
|
-
} = vm;
|
|
5495
|
-
|
|
5496
|
-
if (isTrue(ssr)) {
|
|
5497
|
-
return;
|
|
5498
|
-
}
|
|
5499
|
-
|
|
5500
|
-
const {
|
|
5501
|
-
rendered
|
|
5502
|
-
} = Services;
|
|
5503
|
-
|
|
5504
|
-
if (rendered) {
|
|
5505
|
-
invokeServiceHook(vm, rendered);
|
|
5506
|
-
}
|
|
5507
|
-
|
|
5508
|
-
if (!isUndefined$1(renderedCallback)) {
|
|
5509
|
-
logOperationStart(4
|
|
5510
|
-
/* OperationId.RenderedCallback */
|
|
5511
|
-
, vm);
|
|
5512
|
-
invokeComponentCallback(vm, renderedCallback);
|
|
5513
|
-
logOperationEnd(4
|
|
5514
|
-
/* OperationId.RenderedCallback */
|
|
5515
|
-
, vm);
|
|
5516
|
-
}
|
|
5517
|
-
}
|
|
5518
|
-
let rehydrateQueue = [];
|
|
5519
|
-
|
|
5520
|
-
function flushRehydrationQueue() {
|
|
5521
|
-
logGlobalOperationStart(8
|
|
5522
|
-
/* OperationId.GlobalRehydrate */
|
|
5523
|
-
);
|
|
5524
|
-
|
|
5525
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
5526
|
-
assert.invariant(rehydrateQueue.length, `If rehydrateQueue was scheduled, it is because there must be at least one VM on this pending queue instead of ${rehydrateQueue}.`);
|
|
5527
|
-
}
|
|
5528
|
-
|
|
5529
|
-
const vms = rehydrateQueue.sort((a, b) => a.idx - b.idx);
|
|
5530
|
-
rehydrateQueue = []; // reset to a new queue
|
|
5531
|
-
|
|
5532
|
-
for (let i = 0, len = vms.length; i < len; i += 1) {
|
|
5533
|
-
const vm = vms[i];
|
|
5534
|
-
|
|
5535
|
-
try {
|
|
5536
|
-
rehydrate(vm);
|
|
5537
|
-
} catch (error) {
|
|
5538
|
-
if (i + 1 < len) {
|
|
5539
|
-
// pieces of the queue are still pending to be rehydrated, those should have priority
|
|
5540
|
-
if (rehydrateQueue.length === 0) {
|
|
5541
|
-
addCallbackToNextTick(flushRehydrationQueue);
|
|
5542
|
-
}
|
|
5543
|
-
|
|
5544
|
-
ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, i + 1));
|
|
5545
|
-
} // we need to end the measure before throwing.
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
logGlobalOperationEnd(8
|
|
5549
|
-
/* OperationId.GlobalRehydrate */
|
|
5550
|
-
); // re-throwing the original error will break the current tick, but since the next tick is
|
|
5551
|
-
// already scheduled, it should continue patching the rest.
|
|
5552
|
-
|
|
5553
|
-
throw error; // eslint-disable-line no-unsafe-finally
|
|
5554
|
-
}
|
|
5555
|
-
}
|
|
5556
|
-
|
|
5557
|
-
logGlobalOperationEnd(8
|
|
5558
|
-
/* OperationId.GlobalRehydrate */
|
|
5559
|
-
);
|
|
5297
|
+
) ;
|
|
5560
5298
|
}
|
|
5561
5299
|
|
|
5562
5300
|
function runConnectedCallback(vm) {
|
|
@@ -5745,25 +5483,6 @@ function resetComponentRoot(vm) {
|
|
|
5745
5483
|
runChildNodesDisconnectedCallback(vm);
|
|
5746
5484
|
vm.velements = EmptyArray;
|
|
5747
5485
|
}
|
|
5748
|
-
function scheduleRehydration(vm) {
|
|
5749
|
-
const {
|
|
5750
|
-
renderer: {
|
|
5751
|
-
ssr
|
|
5752
|
-
}
|
|
5753
|
-
} = vm;
|
|
5754
|
-
|
|
5755
|
-
if (isTrue(ssr) || isTrue(vm.isScheduled)) {
|
|
5756
|
-
return;
|
|
5757
|
-
}
|
|
5758
|
-
|
|
5759
|
-
vm.isScheduled = true;
|
|
5760
|
-
|
|
5761
|
-
if (rehydrateQueue.length === 0) {
|
|
5762
|
-
addCallbackToNextTick(flushRehydrationQueue);
|
|
5763
|
-
}
|
|
5764
|
-
|
|
5765
|
-
ArrayPush$1.call(rehydrateQueue, vm);
|
|
5766
|
-
}
|
|
5767
5486
|
|
|
5768
5487
|
function getErrorBoundaryVM(vm) {
|
|
5769
5488
|
let currentVm = vm;
|
|
@@ -5842,15 +5561,8 @@ class WireContextRegistrationEvent extends CustomEvent {
|
|
|
5842
5561
|
}
|
|
5843
5562
|
|
|
5844
5563
|
function createFieldDataCallback(vm, name) {
|
|
5845
|
-
const {
|
|
5846
|
-
cmpFields
|
|
5847
|
-
} = vm;
|
|
5848
5564
|
return value => {
|
|
5849
|
-
|
|
5850
|
-
// storing the value in the underlying storage
|
|
5851
|
-
cmpFields[name] = value;
|
|
5852
|
-
componentValueMutated(vm, name);
|
|
5853
|
-
}
|
|
5565
|
+
updateComponentValue(vm, name, value);
|
|
5854
5566
|
};
|
|
5855
5567
|
}
|
|
5856
5568
|
|
|
@@ -5865,21 +5577,8 @@ function createMethodDataCallback(vm, method) {
|
|
|
5865
5577
|
}
|
|
5866
5578
|
|
|
5867
5579
|
function createConfigWatcher(component, configCallback, callbackWhenConfigIsReady) {
|
|
5868
|
-
let hasPendingConfig = false; // creating the reactive observer for reactive params when needed
|
|
5869
|
-
|
|
5870
|
-
const ro = new ReactiveObserver(() => {
|
|
5871
|
-
if (hasPendingConfig === false) {
|
|
5872
|
-
hasPendingConfig = true; // collect new config in the micro-task
|
|
5873
5580
|
|
|
5874
|
-
|
|
5875
|
-
hasPendingConfig = false; // resetting current reactive params
|
|
5876
|
-
|
|
5877
|
-
ro.reset(); // dispatching a new config due to a change in the configuration
|
|
5878
|
-
|
|
5879
|
-
computeConfigAndUpdate();
|
|
5880
|
-
});
|
|
5881
|
-
}
|
|
5882
|
-
});
|
|
5581
|
+
const ro = createReactiveObserver();
|
|
5883
5582
|
|
|
5884
5583
|
const computeConfigAndUpdate = () => {
|
|
5885
5584
|
let config;
|
|
@@ -6163,7 +5862,7 @@ function readonly(obj) {
|
|
|
6163
5862
|
assert.fail('@readonly cannot be used as a decorator just yet, use it as a function with one argument to produce a readonly version of the provided value.');
|
|
6164
5863
|
}
|
|
6165
5864
|
}
|
|
6166
|
-
return
|
|
5865
|
+
return getReadOnlyProxy(obj);
|
|
6167
5866
|
}
|
|
6168
5867
|
|
|
6169
5868
|
/*
|
|
@@ -6277,7 +5976,7 @@ function freezeTemplate(tmpl) {
|
|
|
6277
5976
|
});
|
|
6278
5977
|
}
|
|
6279
5978
|
}
|
|
6280
|
-
/* version: 2.
|
|
5979
|
+
/* version: 2.23.0 */
|
|
6281
5980
|
|
|
6282
5981
|
/*
|
|
6283
5982
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -6360,10 +6059,6 @@ class HTMLElementImpl {
|
|
|
6360
6059
|
return createElement(tagName);
|
|
6361
6060
|
}
|
|
6362
6061
|
}
|
|
6363
|
-
const ssr = true;
|
|
6364
|
-
function isHydrating() {
|
|
6365
|
-
return false;
|
|
6366
|
-
}
|
|
6367
6062
|
const isNativeShadowDefined = false;
|
|
6368
6063
|
const isSyntheticShadowDefined = false;
|
|
6369
6064
|
function insert(node, parent, anchor) {
|
|
@@ -6602,11 +6297,9 @@ const HTMLElementExported = HTMLElementImpl;
|
|
|
6602
6297
|
/* noop */
|
|
6603
6298
|
const assertInstanceOfHTMLElement = noop;
|
|
6604
6299
|
const renderer = {
|
|
6605
|
-
ssr,
|
|
6606
6300
|
isNativeShadowDefined,
|
|
6607
6301
|
isSyntheticShadowDefined,
|
|
6608
6302
|
HTMLElementExported,
|
|
6609
|
-
isHydrating,
|
|
6610
6303
|
insert,
|
|
6611
6304
|
remove,
|
|
6612
6305
|
cloneNode,
|
|
@@ -6753,6 +6446,6 @@ function renderComponent(tagName, Ctor, props = {}) {
|
|
|
6753
6446
|
*/
|
|
6754
6447
|
freeze(LightningElement);
|
|
6755
6448
|
seal(LightningElement.prototype);
|
|
6756
|
-
/* version: 2.
|
|
6449
|
+
/* version: 2.23.0 */
|
|
6757
6450
|
|
|
6758
6451
|
export { LightningElement, api$1 as api, createContextProvider, freezeTemplate, getComponentDef, isComponentConstructor, parseFragment, parseFragment as parseSVGFragment, readonly, register, registerComponent, registerDecorators, registerTemplate, renderComponent, renderer, sanitizeAttribute, setFeatureFlag, setFeatureFlagForTest, setHooks, track, unwrap, wire };
|