@lwc/engine-core 3.2.0 → 3.3.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/README.md +0 -5
- package/dist/framework/main.d.ts +0 -1
- package/dist/index.cjs.js +8 -55
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +9 -55
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/framework/services.d.ts +0 -22
package/dist/index.js
CHANGED
|
@@ -5332,44 +5332,6 @@ function getWrappedComponentsListener(vm, listener) {
|
|
|
5332
5332
|
return wrappedListener;
|
|
5333
5333
|
}
|
|
5334
5334
|
|
|
5335
|
-
/*
|
|
5336
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
|
5337
|
-
* All rights reserved.
|
|
5338
|
-
* SPDX-License-Identifier: MIT
|
|
5339
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
5340
|
-
*/
|
|
5341
|
-
const Services = create(null);
|
|
5342
|
-
const hooks = ['rendered', 'connected', 'disconnected'];
|
|
5343
|
-
/**
|
|
5344
|
-
* EXPERIMENTAL: This function allows for the registration of "services"
|
|
5345
|
-
* in LWC by exposing hooks into the component life-cycle. This API is
|
|
5346
|
-
* subject to change or being removed.
|
|
5347
|
-
*/
|
|
5348
|
-
function register(service) {
|
|
5349
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
5350
|
-
assert.isTrue(isObject(service), `Invalid service declaration, ${service}: service must be an object`);
|
|
5351
|
-
}
|
|
5352
|
-
for (let i = 0; i < hooks.length; ++i) {
|
|
5353
|
-
const hookName = hooks[i];
|
|
5354
|
-
if (hookName in service) {
|
|
5355
|
-
let l = Services[hookName];
|
|
5356
|
-
if (isUndefined$1(l)) {
|
|
5357
|
-
Services[hookName] = l = [];
|
|
5358
|
-
}
|
|
5359
|
-
ArrayPush$1.call(l, service[hookName]);
|
|
5360
|
-
}
|
|
5361
|
-
}
|
|
5362
|
-
}
|
|
5363
|
-
function invokeServiceHook(vm, cbs) {
|
|
5364
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
5365
|
-
assert.isTrue(isArray$1(cbs) && cbs.length > 0, `Optimize invokeServiceHook() to be invoked only when needed`);
|
|
5366
|
-
}
|
|
5367
|
-
const { component, def, context } = vm;
|
|
5368
|
-
for (let i = 0, len = cbs.length; i < len; ++i) {
|
|
5369
|
-
cbs[i].call(undefined, component, {}, def, context);
|
|
5370
|
-
}
|
|
5371
|
-
}
|
|
5372
|
-
|
|
5373
5335
|
/*
|
|
5374
5336
|
* Copyright (c) 2023, Salesforce.com, inc.
|
|
5375
5337
|
* All rights reserved.
|
|
@@ -5428,7 +5390,13 @@ function resetComponentStateWhenRemoved(vm) {
|
|
|
5428
5390
|
// old vnode.children is removed from the DOM.
|
|
5429
5391
|
function removeVM(vm) {
|
|
5430
5392
|
if (process.env.NODE_ENV !== 'production') {
|
|
5431
|
-
|
|
5393
|
+
if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
5394
|
+
// With native lifecycle, we cannot be certain that connectedCallback was called before a component
|
|
5395
|
+
// was removed from the VDOM. If the component is disconnected, then connectedCallback will not fire
|
|
5396
|
+
// in native mode, although it will fire in synthetic mode due to appendChild triggering it.
|
|
5397
|
+
// See: W-14037619 for details
|
|
5398
|
+
assert.isTrue(vm.state === 1 /* VMState.connected */ || vm.state === 2 /* VMState.disconnected */, `${vm} must have been connected.`);
|
|
5399
|
+
}
|
|
5432
5400
|
}
|
|
5433
5401
|
resetComponentStateWhenRemoved(vm);
|
|
5434
5402
|
}
|
|
@@ -5671,10 +5639,6 @@ function runRenderedCallback(vm) {
|
|
|
5671
5639
|
if (!process.env.IS_BROWSER) {
|
|
5672
5640
|
return;
|
|
5673
5641
|
}
|
|
5674
|
-
const { rendered } = Services;
|
|
5675
|
-
if (rendered) {
|
|
5676
|
-
invokeServiceHook(vm, rendered);
|
|
5677
|
-
}
|
|
5678
5642
|
if (!isUndefined$1(renderedCallback)) {
|
|
5679
5643
|
logOperationStart(4 /* OperationId.RenderedCallback */, vm);
|
|
5680
5644
|
invokeComponentCallback(vm, renderedCallback);
|
|
@@ -5717,11 +5681,6 @@ function runConnectedCallback(vm) {
|
|
|
5717
5681
|
return; // nothing to do since it was already connected
|
|
5718
5682
|
}
|
|
5719
5683
|
vm.state = 1 /* VMState.connected */;
|
|
5720
|
-
// reporting connection
|
|
5721
|
-
const { connected } = Services;
|
|
5722
|
-
if (connected) {
|
|
5723
|
-
invokeServiceHook(vm, connected);
|
|
5724
|
-
}
|
|
5725
5684
|
if (hasWireAdapters(vm)) {
|
|
5726
5685
|
connectWireAdapters(vm);
|
|
5727
5686
|
}
|
|
@@ -5747,11 +5706,6 @@ function runDisconnectedCallback(vm) {
|
|
|
5747
5706
|
vm.isDirty = true;
|
|
5748
5707
|
}
|
|
5749
5708
|
vm.state = 2 /* VMState.disconnected */;
|
|
5750
|
-
// reporting disconnection
|
|
5751
|
-
const { disconnected } = Services;
|
|
5752
|
-
if (disconnected) {
|
|
5753
|
-
invokeServiceHook(vm, disconnected);
|
|
5754
|
-
}
|
|
5755
5709
|
if (hasWireAdapters(vm)) {
|
|
5756
5710
|
disconnectWireAdapters(vm);
|
|
5757
5711
|
}
|
|
@@ -6909,6 +6863,6 @@ function readonly(obj) {
|
|
|
6909
6863
|
return getReadOnlyProxy(obj);
|
|
6910
6864
|
}
|
|
6911
6865
|
|
|
6912
|
-
export { LightningElement, profilerControl as __unstable__ProfilerControl, reportingControl as __unstable__ReportingControl, api$1 as api, computeShadowAndRenderMode, connectRootElement, createContextProviderWithRegister, createVM, disconnectRootElement, freezeTemplate, getAssociatedVMIfPresent, getComponentAPIVersion, getComponentConstructor, getComponentDef, getComponentHtmlPrototype, hydrateRoot, isComponentConstructor, parseFragment, parseSVGFragment, readonly,
|
|
6913
|
-
/** version: 3.
|
|
6866
|
+
export { LightningElement, profilerControl as __unstable__ProfilerControl, reportingControl as __unstable__ReportingControl, api$1 as api, computeShadowAndRenderMode, connectRootElement, createContextProviderWithRegister, createVM, disconnectRootElement, freezeTemplate, getAssociatedVMIfPresent, getComponentAPIVersion, getComponentConstructor, getComponentDef, getComponentHtmlPrototype, hydrateRoot, isComponentConstructor, parseFragment, parseSVGFragment, readonly, registerComponent, registerDecorators, registerTemplate, sanitizeAttribute, setHooks, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
|
|
6867
|
+
/** version: 3.3.0 */
|
|
6914
6868
|
//# sourceMappingURL=index.js.map
|