lwc 2.38.1 → 2.39.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 +203 -122
- package/dist/engine-dom/esm/es2017/engine-dom.js.map +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom.js +203 -122
- package/dist/engine-dom/iife/es2017/engine-dom.js.map +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +154 -40
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js.map +1 -1
- package/dist/engine-dom/iife/es5/engine-dom.js +353 -207
- package/dist/engine-dom/iife/es5/engine-dom.js.map +1 -1
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +305 -153
- package/dist/engine-dom/iife/es5/engine-dom_debug.js.map +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom.js +203 -122
- package/dist/engine-dom/umd/es2017/engine-dom.js.map +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +154 -40
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js.map +1 -1
- package/dist/engine-dom/umd/es5/engine-dom.js +353 -207
- package/dist/engine-dom/umd/es5/engine-dom.js.map +1 -1
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +305 -153
- package/dist/engine-dom/umd/es5/engine-dom_debug.js.map +1 -1
- package/dist/engine-server/commonjs/es2017/engine-server.js +168 -75
- package/dist/engine-server/commonjs/es2017/engine-server.js.map +1 -1
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +168 -75
- package/dist/engine-server/esm/es2017/engine-server.js.map +1 -1
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js.map +1 -1
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js.map +1 -1
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js.map +1 -1
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js.map +1 -1
- package/dist/wire-service/esm/es2017/wire-service.js +2 -2
- package/dist/wire-service/esm/es2017/wire-service.js.map +1 -1
- package/dist/wire-service/iife/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service.js.map +1 -1
- package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service_debug.js.map +1 -1
- package/dist/wire-service/iife/es5/wire-service.js +2 -2
- package/dist/wire-service/iife/es5/wire-service.js.map +1 -1
- package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es5/wire-service_debug.js.map +1 -1
- package/dist/wire-service/umd/es2017/wire-service.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service.js.map +1 -1
- package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service_debug.js.map +1 -1
- package/dist/wire-service/umd/es5/wire-service.js +2 -2
- package/dist/wire-service/umd/es5/wire-service.js.map +1 -1
- package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es5/wire-service_debug.js.map +1 -1
- package/package.json +7 -7
|
@@ -442,9 +442,9 @@ function htmlEscape(str, attrMode = false) {
|
|
|
442
442
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
443
443
|
*/
|
|
444
444
|
// Increment whenever the LWC template compiler changes
|
|
445
|
-
const LWC_VERSION = "2.
|
|
445
|
+
const LWC_VERSION = "2.39.0";
|
|
446
446
|
const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
447
|
-
/** version: 2.
|
|
447
|
+
/** version: 2.39.0 */
|
|
448
448
|
|
|
449
449
|
/**
|
|
450
450
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -523,7 +523,7 @@ function setFeatureFlagForTest(name, value) {
|
|
|
523
523
|
setFeatureFlag(name, value);
|
|
524
524
|
}
|
|
525
525
|
}
|
|
526
|
-
/** version: 2.
|
|
526
|
+
/** version: 2.39.0 */
|
|
527
527
|
|
|
528
528
|
/*
|
|
529
529
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -619,7 +619,7 @@ function applyAriaReflection(prototype = Element.prototype) {
|
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
621
|
}
|
|
622
|
-
/** version: 2.
|
|
622
|
+
/** version: 2.39.0 */
|
|
623
623
|
|
|
624
624
|
/* proxy-compat-disable */
|
|
625
625
|
|
|
@@ -3104,6 +3104,93 @@ const BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor, getOw
|
|
|
3104
3104
|
freeze(BaseBridgeElement);
|
|
3105
3105
|
seal(BaseBridgeElement.prototype);
|
|
3106
3106
|
|
|
3107
|
+
/*
|
|
3108
|
+
* Copyright (c) 2023, salesforce.com, inc.
|
|
3109
|
+
* All rights reserved.
|
|
3110
|
+
* SPDX-License-Identifier: MIT
|
|
3111
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3112
|
+
*/
|
|
3113
|
+
const supportsWeakRefs = typeof WeakRef === 'function' && typeof FinalizationRegistry === 'function';
|
|
3114
|
+
// In browsers that doesn't support WeakRefs, the values will still leak, but at least the keys won't
|
|
3115
|
+
class LegacyWeakMultiMap {
|
|
3116
|
+
constructor() {
|
|
3117
|
+
this._map = new WeakMap();
|
|
3118
|
+
}
|
|
3119
|
+
_getValues(key) {
|
|
3120
|
+
let values = this._map.get(key);
|
|
3121
|
+
if (isUndefined$1(values)) {
|
|
3122
|
+
values = new Set();
|
|
3123
|
+
this._map.set(key, values);
|
|
3124
|
+
}
|
|
3125
|
+
return values;
|
|
3126
|
+
}
|
|
3127
|
+
get(key) {
|
|
3128
|
+
return this._getValues(key);
|
|
3129
|
+
}
|
|
3130
|
+
add(key, vm) {
|
|
3131
|
+
const set = this._getValues(key);
|
|
3132
|
+
set.add(vm);
|
|
3133
|
+
}
|
|
3134
|
+
delete(key) {
|
|
3135
|
+
this._map.delete(key);
|
|
3136
|
+
}
|
|
3137
|
+
}
|
|
3138
|
+
// This implementation relies on the WeakRef/FinalizationRegistry proposal.
|
|
3139
|
+
// For some background, see: https://github.com/tc39/proposal-weakrefs
|
|
3140
|
+
class ModernWeakMultiMap {
|
|
3141
|
+
constructor() {
|
|
3142
|
+
this._map = new WeakMap();
|
|
3143
|
+
this._registry = new FinalizationRegistry((weakRefs) => {
|
|
3144
|
+
// This should be considered an optional cleanup method to remove GC'ed values from their respective arrays.
|
|
3145
|
+
// JS VMs are not obligated to call FinalizationRegistry callbacks.
|
|
3146
|
+
// Work backwards, removing stale VMs
|
|
3147
|
+
for (let i = weakRefs.length - 1; i >= 0; i--) {
|
|
3148
|
+
const vm = weakRefs[i].deref();
|
|
3149
|
+
if (isUndefined$1(vm)) {
|
|
3150
|
+
ArraySplice.call(weakRefs, i, 1); // remove
|
|
3151
|
+
}
|
|
3152
|
+
}
|
|
3153
|
+
});
|
|
3154
|
+
}
|
|
3155
|
+
_getWeakRefs(key) {
|
|
3156
|
+
let weakRefs = this._map.get(key);
|
|
3157
|
+
if (isUndefined$1(weakRefs)) {
|
|
3158
|
+
weakRefs = [];
|
|
3159
|
+
this._map.set(key, weakRefs);
|
|
3160
|
+
}
|
|
3161
|
+
return weakRefs;
|
|
3162
|
+
}
|
|
3163
|
+
get(key) {
|
|
3164
|
+
const weakRefs = this._getWeakRefs(key);
|
|
3165
|
+
const result = new Set();
|
|
3166
|
+
for (const weakRef of weakRefs) {
|
|
3167
|
+
const vm = weakRef.deref();
|
|
3168
|
+
if (!isUndefined$1(vm)) {
|
|
3169
|
+
result.add(vm);
|
|
3170
|
+
}
|
|
3171
|
+
}
|
|
3172
|
+
return result;
|
|
3173
|
+
}
|
|
3174
|
+
add(key, value) {
|
|
3175
|
+
const weakRefs = this._getWeakRefs(key);
|
|
3176
|
+
// We could check for duplicate values here, but it doesn't seem worth it.
|
|
3177
|
+
// We transform the output into a Set anyway
|
|
3178
|
+
ArrayPush$1.call(weakRefs, new WeakRef(value));
|
|
3179
|
+
// It's important here not to leak the second argument, which is the "held value." The FinalizationRegistry
|
|
3180
|
+
// effectively creates a strong reference between the first argument (the "target") and the held value. When
|
|
3181
|
+
// the target is GC'ed, the callback is called, and then the held value is GC'ed.
|
|
3182
|
+
// Putting the key here would mean the key is not GC'ed until the value is GC'ed, which defeats the purpose
|
|
3183
|
+
// of the WeakMap. Whereas putting the weakRefs array here is fine, because it doesn't have a strong reference
|
|
3184
|
+
// to anything. See also this example:
|
|
3185
|
+
// https://gist.github.com/nolanlawson/79a3d36e8e6cc25c5048bb17c1795aea
|
|
3186
|
+
this._registry.register(value, weakRefs);
|
|
3187
|
+
}
|
|
3188
|
+
delete(key) {
|
|
3189
|
+
this._map.delete(key);
|
|
3190
|
+
}
|
|
3191
|
+
}
|
|
3192
|
+
const WeakMultiMap = supportsWeakRefs ? ModernWeakMultiMap : LegacyWeakMultiMap;
|
|
3193
|
+
|
|
3107
3194
|
/*
|
|
3108
3195
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
3109
3196
|
* All rights reserved.
|
|
@@ -3113,9 +3200,13 @@ seal(BaseBridgeElement.prototype);
|
|
|
3113
3200
|
const swappedTemplateMap = new WeakMap();
|
|
3114
3201
|
const swappedComponentMap = new WeakMap();
|
|
3115
3202
|
const swappedStyleMap = new WeakMap();
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3203
|
+
// The important thing here is the weak values – VMs are transient (one per component instance) and should be GC'ed,
|
|
3204
|
+
// so we don't want to create strong references to them.
|
|
3205
|
+
// The weak keys are kind of useless, because Templates, LightningElementConstructors, and StylesheetFactories are
|
|
3206
|
+
// never GC'ed. But maybe they will be someday, so we may as well use weak keys too.
|
|
3207
|
+
const activeTemplates = new WeakMultiMap();
|
|
3208
|
+
const activeComponents = new WeakMultiMap();
|
|
3209
|
+
const activeStyles = new WeakMultiMap();
|
|
3119
3210
|
function getTemplateOrSwappedTemplate(tpl) {
|
|
3120
3211
|
assertNotProd(); // this method should never leak to prod
|
|
3121
3212
|
const visited = new Set();
|
|
@@ -3147,72 +3238,27 @@ function setActiveVM(vm) {
|
|
|
3147
3238
|
assertNotProd(); // this method should never leak to prod
|
|
3148
3239
|
// tracking active component
|
|
3149
3240
|
const Ctor = vm.def.ctor;
|
|
3150
|
-
let componentVMs = activeComponents.get(Ctor);
|
|
3151
|
-
if (isUndefined$1(componentVMs)) {
|
|
3152
|
-
componentVMs = new Set();
|
|
3153
|
-
activeComponents.set(Ctor, componentVMs);
|
|
3154
|
-
}
|
|
3155
3241
|
// this will allow us to keep track of the hot components
|
|
3156
|
-
|
|
3242
|
+
activeComponents.add(Ctor, vm);
|
|
3157
3243
|
// tracking active template
|
|
3158
3244
|
const tpl = vm.cmpTemplate;
|
|
3159
3245
|
if (tpl) {
|
|
3160
|
-
let templateVMs = activeTemplates.get(tpl);
|
|
3161
|
-
if (isUndefined$1(templateVMs)) {
|
|
3162
|
-
templateVMs = new Set();
|
|
3163
|
-
activeTemplates.set(tpl, templateVMs);
|
|
3164
|
-
}
|
|
3165
3246
|
// this will allow us to keep track of the templates that are
|
|
3166
3247
|
// being used by a hot component
|
|
3167
|
-
|
|
3248
|
+
activeTemplates.add(tpl, vm);
|
|
3168
3249
|
// tracking active styles associated to template
|
|
3169
3250
|
const stylesheets = tpl.stylesheets;
|
|
3170
3251
|
if (!isUndefined$1(stylesheets)) {
|
|
3171
|
-
flattenStylesheets(stylesheets)
|
|
3252
|
+
for (const stylesheet of flattenStylesheets(stylesheets)) {
|
|
3172
3253
|
// this is necessary because we don't hold the list of styles
|
|
3173
3254
|
// in the vm, we only hold the selected (already swapped template)
|
|
3174
3255
|
// but the styles attached to the template might not be the actual
|
|
3175
3256
|
// active ones, but the swapped versions of those.
|
|
3176
|
-
|
|
3177
|
-
let stylesheetVMs = activeStyles.get(stylesheet);
|
|
3178
|
-
if (isUndefined$1(stylesheetVMs)) {
|
|
3179
|
-
stylesheetVMs = new Set();
|
|
3180
|
-
activeStyles.set(stylesheet, stylesheetVMs);
|
|
3181
|
-
}
|
|
3257
|
+
const swappedStylesheet = getStyleOrSwappedStyle(stylesheet);
|
|
3182
3258
|
// this will allow us to keep track of the stylesheet that are
|
|
3183
3259
|
// being used by a hot component
|
|
3184
|
-
|
|
3185
|
-
}
|
|
3186
|
-
}
|
|
3187
|
-
}
|
|
3188
|
-
}
|
|
3189
|
-
function removeActiveVM(vm) {
|
|
3190
|
-
assertNotProd(); // this method should never leak to prod
|
|
3191
|
-
// tracking inactive component
|
|
3192
|
-
const Ctor = vm.def.ctor;
|
|
3193
|
-
let list = activeComponents.get(Ctor);
|
|
3194
|
-
if (!isUndefined$1(list)) {
|
|
3195
|
-
// deleting the vm from the set to avoid leaking memory
|
|
3196
|
-
list.delete(vm);
|
|
3197
|
-
}
|
|
3198
|
-
// removing inactive template
|
|
3199
|
-
const tpl = vm.cmpTemplate;
|
|
3200
|
-
if (tpl) {
|
|
3201
|
-
list = activeTemplates.get(tpl);
|
|
3202
|
-
if (!isUndefined$1(list)) {
|
|
3203
|
-
// deleting the vm from the set to avoid leaking memory
|
|
3204
|
-
list.delete(vm);
|
|
3205
|
-
}
|
|
3206
|
-
// removing active styles associated to template
|
|
3207
|
-
const styles = tpl.stylesheets;
|
|
3208
|
-
if (!isUndefined$1(styles)) {
|
|
3209
|
-
flattenStylesheets(styles).forEach((style) => {
|
|
3210
|
-
list = activeStyles.get(style);
|
|
3211
|
-
if (!isUndefined$1(list)) {
|
|
3212
|
-
// deleting the vm from the set to avoid leaking memory
|
|
3213
|
-
list.delete(vm);
|
|
3214
|
-
}
|
|
3215
|
-
});
|
|
3260
|
+
activeStyles.add(swappedStylesheet, vm);
|
|
3261
|
+
}
|
|
3216
3262
|
}
|
|
3217
3263
|
}
|
|
3218
3264
|
}
|
|
@@ -3589,6 +3635,9 @@ function isVBaseElement(vnode) {
|
|
|
3589
3635
|
function isSameVnode(vnode1, vnode2) {
|
|
3590
3636
|
return vnode1.key === vnode2.key && vnode1.sel === vnode2.sel;
|
|
3591
3637
|
}
|
|
3638
|
+
function isVCustomElement(vnode) {
|
|
3639
|
+
return vnode.type === 3 /* VNodeType.CustomElement */;
|
|
3640
|
+
}
|
|
3592
3641
|
function isVFragment(vnode) {
|
|
3593
3642
|
return vnode.type === 5 /* VNodeType.Fragment */;
|
|
3594
3643
|
}
|
|
@@ -3894,7 +3943,12 @@ function patch(n1, n2, parent, renderer) {
|
|
|
3894
3943
|
return;
|
|
3895
3944
|
}
|
|
3896
3945
|
if (process.env.NODE_ENV !== 'production') {
|
|
3897
|
-
if (!isSameVnode(n1, n2)
|
|
3946
|
+
if (!isSameVnode(n1, n2) &&
|
|
3947
|
+
// Currently the only scenario when patch does not receive the same vnodes are for
|
|
3948
|
+
// dynamic components. When a dynamic component's constructor changes, the value of its
|
|
3949
|
+
// tag name (sel) will be different. The engine will unmount the previous element
|
|
3950
|
+
// and mount the new one using the new constructor in patchCustomElement.
|
|
3951
|
+
!(isVCustomElement(n1) && isVCustomElement(n2))) {
|
|
3898
3952
|
throw new Error('Expected these VNodes to be the same: ' +
|
|
3899
3953
|
JSON.stringify({ sel: n1.sel, key: n1.key }) +
|
|
3900
3954
|
', ' +
|
|
@@ -4082,8 +4136,9 @@ function mountCustomElement(vnode, parent, anchor, renderer) {
|
|
|
4082
4136
|
}
|
|
4083
4137
|
}
|
|
4084
4138
|
function patchCustomElement(n1, n2, parent, renderer) {
|
|
4139
|
+
// TODO [#3331]: This if branch should be removed in 246 with lwc:dynamic
|
|
4085
4140
|
if (n1.ctor !== n2.ctor) {
|
|
4086
|
-
// If the constructor, unmount the current component and mount a new one using the new
|
|
4141
|
+
// If the constructor differs, unmount the current component and mount a new one using the new
|
|
4087
4142
|
// constructor.
|
|
4088
4143
|
const anchor = renderer.nextSibling(n1.elm);
|
|
4089
4144
|
unmount(n1, parent, renderer, true);
|
|
@@ -4576,9 +4631,17 @@ function updateStaticChildren(c1, c2, parent, renderer) {
|
|
|
4576
4631
|
if (n2 !== n1) {
|
|
4577
4632
|
if (isVNode(n1)) {
|
|
4578
4633
|
if (isVNode(n2)) {
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4634
|
+
if (isSameVnode(n1, n2)) {
|
|
4635
|
+
// both vnodes are equivalent, and we just need to patch them
|
|
4636
|
+
patch(n1, n2, parent, renderer);
|
|
4637
|
+
anchor = n2.elm;
|
|
4638
|
+
}
|
|
4639
|
+
else {
|
|
4640
|
+
// removing the old vnode since the new one is different
|
|
4641
|
+
unmount(n1, parent, renderer, true);
|
|
4642
|
+
mount(n2, parent, renderer, anchor);
|
|
4643
|
+
anchor = n2.elm;
|
|
4644
|
+
}
|
|
4582
4645
|
}
|
|
4583
4646
|
else {
|
|
4584
4647
|
// removing the old vnode since the new one is null
|
|
@@ -4980,16 +5043,18 @@ function fid(url) {
|
|
|
4980
5043
|
return url;
|
|
4981
5044
|
}
|
|
4982
5045
|
/**
|
|
4983
|
-
* create a dynamic component via `<x-foo lwc:dynamic={Ctor}>`
|
|
5046
|
+
* [ddc] - create a (deprecated) dynamic component via `<x-foo lwc:dynamic={Ctor}>`
|
|
5047
|
+
*
|
|
5048
|
+
* TODO [#3331]: remove usage of lwc:dynamic in 246
|
|
4984
5049
|
*/
|
|
4985
|
-
function
|
|
5050
|
+
function ddc(sel, Ctor, data, children = EmptyArray) {
|
|
4986
5051
|
if (process.env.NODE_ENV !== 'production') {
|
|
4987
5052
|
assert.isTrue(isString(sel), `dc() 1st argument sel must be a string.`);
|
|
4988
5053
|
assert.isTrue(isObject(data), `dc() 3nd argument data must be an object.`);
|
|
4989
5054
|
assert.isTrue(arguments.length === 3 || isArray$1(children), `dc() 4nd argument data must be an array.`);
|
|
4990
5055
|
}
|
|
4991
5056
|
// null or undefined values should produce a null value in the VNodes
|
|
4992
|
-
if (Ctor
|
|
5057
|
+
if (isNull(Ctor) || isUndefined$1(Ctor)) {
|
|
4993
5058
|
return null;
|
|
4994
5059
|
}
|
|
4995
5060
|
if (!isComponentConstructor(Ctor)) {
|
|
@@ -4997,6 +5062,30 @@ function dc(sel, Ctor, data, children = EmptyArray) {
|
|
|
4997
5062
|
}
|
|
4998
5063
|
return c(sel, Ctor, data, children);
|
|
4999
5064
|
}
|
|
5065
|
+
/**
|
|
5066
|
+
* [dc] - create a dynamic component via `<lwc:component lwc:is={Ctor}>`
|
|
5067
|
+
*/
|
|
5068
|
+
function dc(Ctor, data, children = EmptyArray) {
|
|
5069
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
5070
|
+
assert.isTrue(isObject(data), `dc() 2nd argument data must be an object.`);
|
|
5071
|
+
assert.isTrue(arguments.length === 3 || isArray$1(children), `dc() 3rd argument data must be an array.`);
|
|
5072
|
+
}
|
|
5073
|
+
// Null or undefined values should produce a null value in the VNodes.
|
|
5074
|
+
// This is the only value at compile time as the constructor will not be known.
|
|
5075
|
+
if (isNull(Ctor) || isUndefined$1(Ctor)) {
|
|
5076
|
+
return null;
|
|
5077
|
+
}
|
|
5078
|
+
if (!isComponentConstructor(Ctor)) {
|
|
5079
|
+
throw new Error(`Invalid constructor ${toString$1(Ctor)} is not a LightningElement constructor.`);
|
|
5080
|
+
}
|
|
5081
|
+
// Look up the dynamic component's name at runtime once the constructor is available.
|
|
5082
|
+
// This information is only known at runtime and is stored as part of registerComponent.
|
|
5083
|
+
const sel = getComponentRegisteredName(Ctor);
|
|
5084
|
+
if (isUndefined$1(sel) || sel === '') {
|
|
5085
|
+
throw new Error(`Invalid LWC constructor ${toString$1(Ctor)} does not have a registered name`);
|
|
5086
|
+
}
|
|
5087
|
+
return c(sel, Ctor, data, children);
|
|
5088
|
+
}
|
|
5000
5089
|
/**
|
|
5001
5090
|
* slow children collection marking mechanism. this API allows the compiler to signal
|
|
5002
5091
|
* to the engine that a particular collection of children must be diffed using the slow
|
|
@@ -5059,6 +5148,7 @@ const api = freeze({
|
|
|
5059
5148
|
fid,
|
|
5060
5149
|
shc,
|
|
5061
5150
|
ssf,
|
|
5151
|
+
ddc,
|
|
5062
5152
|
});
|
|
5063
5153
|
|
|
5064
5154
|
/*
|
|
@@ -5419,28 +5509,34 @@ function invokeEventListener(vm, fn, thisValue, event) {
|
|
|
5419
5509
|
* SPDX-License-Identifier: MIT
|
|
5420
5510
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
5421
5511
|
*/
|
|
5422
|
-
const
|
|
5512
|
+
const registeredComponentMap = new Map();
|
|
5423
5513
|
/**
|
|
5424
5514
|
* INTERNAL: This function can only be invoked by compiled code. The compiler
|
|
5425
5515
|
* will prevent this function from being imported by userland code.
|
|
5426
5516
|
*/
|
|
5427
5517
|
function registerComponent(
|
|
5428
5518
|
// We typically expect a LightningElementConstructor, but technically you can call this with anything
|
|
5429
|
-
Ctor,
|
|
5519
|
+
Ctor, metadata) {
|
|
5430
5520
|
if (isFunction$1(Ctor)) {
|
|
5431
5521
|
if (process.env.NODE_ENV !== 'production') {
|
|
5432
5522
|
// There is no point in running this in production, because the version mismatch check relies
|
|
5433
5523
|
// on code comments which are stripped out in production by minifiers
|
|
5434
5524
|
checkVersionMismatch(Ctor, 'component');
|
|
5435
5525
|
}
|
|
5436
|
-
|
|
5526
|
+
// TODO [#3331]: add validation to check the value of metadata.sel is not an empty string.
|
|
5527
|
+
registeredComponentMap.set(Ctor, metadata);
|
|
5437
5528
|
}
|
|
5438
5529
|
// chaining this method as a way to wrap existing assignment of component constructor easily,
|
|
5439
5530
|
// without too much transformation
|
|
5440
5531
|
return Ctor;
|
|
5441
5532
|
}
|
|
5442
5533
|
function getComponentRegisteredTemplate(Ctor) {
|
|
5443
|
-
|
|
5534
|
+
var _a;
|
|
5535
|
+
return (_a = registeredComponentMap.get(Ctor)) === null || _a === void 0 ? void 0 : _a.tmpl;
|
|
5536
|
+
}
|
|
5537
|
+
function getComponentRegisteredName(Ctor) {
|
|
5538
|
+
var _a;
|
|
5539
|
+
return (_a = registeredComponentMap.get(Ctor)) === null || _a === void 0 ? void 0 : _a.sel;
|
|
5444
5540
|
}
|
|
5445
5541
|
function getTemplateReactiveObserver(vm) {
|
|
5446
5542
|
return createReactiveObserver();
|
|
@@ -5570,9 +5666,6 @@ function resetComponentStateWhenRemoved(vm) {
|
|
|
5570
5666
|
runChildNodesDisconnectedCallback(vm);
|
|
5571
5667
|
runLightChildNodesDisconnectedCallback(vm);
|
|
5572
5668
|
}
|
|
5573
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
5574
|
-
removeActiveVM(vm);
|
|
5575
|
-
}
|
|
5576
5669
|
}
|
|
5577
5670
|
// this method is triggered by the diffing algo only when a vnode from the
|
|
5578
5671
|
// old vnode.children is removed from the DOM.
|
|
@@ -6217,7 +6310,7 @@ function readonly(obj) {
|
|
|
6217
6310
|
}
|
|
6218
6311
|
return getReadOnlyProxy(obj);
|
|
6219
6312
|
}
|
|
6220
|
-
/* version: 2.
|
|
6313
|
+
/* version: 2.39.0 */
|
|
6221
6314
|
|
|
6222
6315
|
/*
|
|
6223
6316
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -6752,7 +6845,7 @@ seal(LightningElement.prototype);
|
|
|
6752
6845
|
function createElement() {
|
|
6753
6846
|
throw new Error('createElement is not supported in @lwc/engine-server, only @lwc/engine-dom.');
|
|
6754
6847
|
}
|
|
6755
|
-
/* version: 2.
|
|
6848
|
+
/* version: 2.39.0 */
|
|
6756
6849
|
|
|
6757
6850
|
export { LightningElement, api$1 as api, createContextProvider, createElement, freezeTemplate, getComponentDef, isComponentConstructor, parseFragment, parseFragment as parseSVGFragment, readonly, register, registerComponent, registerDecorators, registerTemplate, renderComponent, renderer, sanitizeAttribute, setFeatureFlag, setFeatureFlagForTest, setHooks, track, unwrap, wire };
|
|
6758
6851
|
//# sourceMappingURL=engine-server.js.map
|