Skip to content

Commit

Permalink
chore: change locker support flag for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
jhefferman-sfdc committed Jan 23, 2025
1 parent ad9a492 commit aa09988
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/@lwc/engine-core/src/framework/invoker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function invokeComponentConstructor(vm: VM, Ctor: LightningElementConstru
// the "instanceof" operator would not work here since Locker Service provides its own
// implementation of LightningElement, so we indirectly check if the base constructor is
// invoked by accessing the component on the vm.
const isInvalidConstructor = lwcRuntimeFlags.ENABLE_LEGACY_LOCKER_SUPPORT
const isInvalidConstructor = lwcRuntimeFlags.LEGACY_LOCKER_ENABLED
? vmBeingConstructed.component !== result
: !(result instanceof LightningElement);

Expand Down
2 changes: 1 addition & 1 deletion packages/@lwc/features/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const features: FeatureFlagMap = {
ENABLE_FORCE_SHADOW_MIGRATE_MODE: null,
ENABLE_EXPERIMENTAL_SIGNALS: null,
DISABLE_SYNTHETIC_SHADOW: null,
ENABLE_LEGACY_LOCKER_SUPPORT: null,
LEGACY_LOCKER_ENABLED: null,
};

if (!(globalThis as any).lwcRuntimeFlags) {
Expand Down
2 changes: 1 addition & 1 deletion packages/@lwc/features/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export interface FeatureFlagMap {
* If true, then lightning legacy locker is supported, otherwise lightning legacy locker will not function
* properly.
*/
ENABLE_LEGACY_LOCKER_SUPPORT: FeatureFlagValue;
LEGACY_LOCKER_ENABLED: FeatureFlagValue;
}

export type FeatureFlagName = keyof FeatureFlagMap;
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ describe.runIf(process.env.NATIVE_SHADOW)('native shadow', () => {

describe('locker integration', () => {
beforeEach(() => {
setFeatureFlagForTest('ENABLE_LEGACY_LOCKER_SUPPORT', true);
setFeatureFlagForTest('LEGACY_LOCKER_ENABLED', true);
});
afterEach(() => {
setFeatureFlagForTest('ENABLE_LEGACY_LOCKER_SUPPORT', false);
setFeatureFlagForTest('LEGACY_LOCKER_ENABLED', false);
});
it('should support component class that extend a mirror of the LightningElement', () => {
function SecureBaseClass() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import LockerIntegration from 'x/lockerIntegration';
import LockerLiveComponent from 'x/lockerLiveComponent';
import LockerHooks, { hooks } from 'x/lockerHooks';
beforeEach(() => {
setFeatureFlagForTest('ENABLE_LEGACY_LOCKER_SUPPORT', true);
setFeatureFlagForTest('LEGACY_LOCKER_ENABLED', true);
});
afterEach(() => {
setFeatureFlagForTest('ENABLE_LEGACY_LOCKER_SUPPORT', false);
setFeatureFlagForTest('LEGACY_LOCKER_ENABLED', false);
});
it('should support Locker integration which uses a wrapped LightningElement base class', () => {
const elm = createElement('x-secure-parent', { is: LockerIntegration });
Expand Down

0 comments on commit aa09988

Please sign in to comment.