@lwc/engine-core 8.23.0 → 8.24.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/framework/component.d.ts +6 -0
- package/dist/index.cjs.js +16 -1
- package/dist/index.js +16 -1
- package/package.json +4 -4
|
@@ -9,6 +9,10 @@ type ComponentConstructorMetadata = {
|
|
|
9
9
|
sel: string;
|
|
10
10
|
apiVersion: APIVersion;
|
|
11
11
|
enableSyntheticElementInternals?: boolean | undefined;
|
|
12
|
+
componentFeatureFlag?: {
|
|
13
|
+
value: boolean;
|
|
14
|
+
path: string;
|
|
15
|
+
} | undefined;
|
|
12
16
|
};
|
|
13
17
|
/**
|
|
14
18
|
* INTERNAL: This function can only be invoked by compiled code. The compiler
|
|
@@ -21,6 +25,8 @@ export declare function getComponentRegisteredTemplate(Ctor: LightningElementCon
|
|
|
21
25
|
export declare function getComponentRegisteredName(Ctor: LightningElementConstructor): string | undefined;
|
|
22
26
|
export declare function getComponentAPIVersion(Ctor: LightningElementConstructor): APIVersion;
|
|
23
27
|
export declare function supportsSyntheticElementInternals(Ctor: LightningElementConstructor): boolean;
|
|
28
|
+
export declare function isComponentFeatureEnabled(Ctor: LightningElementConstructor): boolean;
|
|
29
|
+
export declare function getComponentMetadata(Ctor: LightningElementConstructor): ComponentConstructorMetadata | undefined;
|
|
24
30
|
export declare function getTemplateReactiveObserver(vm: VM): ReactiveObserver;
|
|
25
31
|
export declare function resetTemplateObserverAndUnsubscribe(vm: VM): void;
|
|
26
32
|
export declare function renderComponent(vm: VM): VNodes;
|
package/dist/index.cjs.js
CHANGED
|
@@ -3754,6 +3754,13 @@ function getCtorProto(Ctor) {
|
|
|
3754
3754
|
return proto;
|
|
3755
3755
|
}
|
|
3756
3756
|
function createComponentDef(Ctor) {
|
|
3757
|
+
// Enforce component-level feature flag if provided at compile time
|
|
3758
|
+
if (!isComponentFeatureEnabled(Ctor)) {
|
|
3759
|
+
const metadata = getComponentMetadata(Ctor);
|
|
3760
|
+
const componentName = Ctor.name || metadata?.sel || 'Unknown';
|
|
3761
|
+
const componentFeatureFlagPath = metadata?.componentFeatureFlag?.path || 'Unknown';
|
|
3762
|
+
throw new Error(`Component ${componentName} is disabled by the feature flag at ${componentFeatureFlagPath}.`);
|
|
3763
|
+
}
|
|
3757
3764
|
const { shadowSupportMode: ctorShadowSupportMode, renderMode: ctorRenderMode, formAssociated: ctorFormAssociated, } = Ctor;
|
|
3758
3765
|
if (process.env.NODE_ENV !== 'production') {
|
|
3759
3766
|
const ctorName = Ctor.name;
|
|
@@ -6727,6 +6734,14 @@ function getComponentAPIVersion(Ctor) {
|
|
|
6727
6734
|
function supportsSyntheticElementInternals(Ctor) {
|
|
6728
6735
|
return registeredComponentMap.get(Ctor)?.enableSyntheticElementInternals || false;
|
|
6729
6736
|
}
|
|
6737
|
+
function isComponentFeatureEnabled(Ctor) {
|
|
6738
|
+
const flag = registeredComponentMap.get(Ctor)?.componentFeatureFlag;
|
|
6739
|
+
// Default to true if not provided
|
|
6740
|
+
return flag?.value !== false;
|
|
6741
|
+
}
|
|
6742
|
+
function getComponentMetadata(Ctor) {
|
|
6743
|
+
return registeredComponentMap.get(Ctor);
|
|
6744
|
+
}
|
|
6730
6745
|
function getTemplateReactiveObserver(vm) {
|
|
6731
6746
|
const reactiveObserver = createReactiveObserver(() => {
|
|
6732
6747
|
const { isDirty } = vm;
|
|
@@ -8825,5 +8840,5 @@ exports.swapTemplate = swapTemplate;
|
|
|
8825
8840
|
exports.track = track;
|
|
8826
8841
|
exports.unwrap = unwrap;
|
|
8827
8842
|
exports.wire = wire;
|
|
8828
|
-
/** version: 8.
|
|
8843
|
+
/** version: 8.24.0 */
|
|
8829
8844
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.js
CHANGED
|
@@ -3751,6 +3751,13 @@ function getCtorProto(Ctor) {
|
|
|
3751
3751
|
return proto;
|
|
3752
3752
|
}
|
|
3753
3753
|
function createComponentDef(Ctor) {
|
|
3754
|
+
// Enforce component-level feature flag if provided at compile time
|
|
3755
|
+
if (!isComponentFeatureEnabled(Ctor)) {
|
|
3756
|
+
const metadata = getComponentMetadata(Ctor);
|
|
3757
|
+
const componentName = Ctor.name || metadata?.sel || 'Unknown';
|
|
3758
|
+
const componentFeatureFlagPath = metadata?.componentFeatureFlag?.path || 'Unknown';
|
|
3759
|
+
throw new Error(`Component ${componentName} is disabled by the feature flag at ${componentFeatureFlagPath}.`);
|
|
3760
|
+
}
|
|
3754
3761
|
const { shadowSupportMode: ctorShadowSupportMode, renderMode: ctorRenderMode, formAssociated: ctorFormAssociated, } = Ctor;
|
|
3755
3762
|
if (process.env.NODE_ENV !== 'production') {
|
|
3756
3763
|
const ctorName = Ctor.name;
|
|
@@ -6724,6 +6731,14 @@ function getComponentAPIVersion(Ctor) {
|
|
|
6724
6731
|
function supportsSyntheticElementInternals(Ctor) {
|
|
6725
6732
|
return registeredComponentMap.get(Ctor)?.enableSyntheticElementInternals || false;
|
|
6726
6733
|
}
|
|
6734
|
+
function isComponentFeatureEnabled(Ctor) {
|
|
6735
|
+
const flag = registeredComponentMap.get(Ctor)?.componentFeatureFlag;
|
|
6736
|
+
// Default to true if not provided
|
|
6737
|
+
return flag?.value !== false;
|
|
6738
|
+
}
|
|
6739
|
+
function getComponentMetadata(Ctor) {
|
|
6740
|
+
return registeredComponentMap.get(Ctor);
|
|
6741
|
+
}
|
|
6727
6742
|
function getTemplateReactiveObserver(vm) {
|
|
6728
6743
|
const reactiveObserver = createReactiveObserver(() => {
|
|
6729
6744
|
const { isDirty } = vm;
|
|
@@ -8751,5 +8766,5 @@ function readonly(obj) {
|
|
|
8751
8766
|
}
|
|
8752
8767
|
|
|
8753
8768
|
export { BaseBridgeElement, 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, runFormAssociatedCallback, runFormDisabledCallback, runFormResetCallback, runFormStateRestoreCallback, sanitizeAttribute, shouldBeFormAssociated, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
|
|
8754
|
-
/** version: 8.
|
|
8769
|
+
/** version: 8.24.0 */
|
|
8755
8770
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
|
|
5
5
|
],
|
|
6
6
|
"name": "@lwc/engine-core",
|
|
7
|
-
"version": "8.
|
|
7
|
+
"version": "8.24.0",
|
|
8
8
|
"description": "Core LWC engine APIs.",
|
|
9
9
|
"keywords": [
|
|
10
10
|
"lwc"
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@lwc/features": "8.
|
|
50
|
-
"@lwc/shared": "8.
|
|
51
|
-
"@lwc/signals": "8.
|
|
49
|
+
"@lwc/features": "8.24.0",
|
|
50
|
+
"@lwc/shared": "8.24.0",
|
|
51
|
+
"@lwc/signals": "8.24.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"observable-membrane": "2.0.0"
|