Skip to content

Commit 24b77d7

Browse files
committed
Disable all new keywords behind a feature flag
1 parent 189e915 commit 24b77d7

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

packages/@ember/canary-features/index.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { ENV } from '@ember/-internals/environment';
1313

1414
export const DEFAULT_FEATURES = {
1515
// FLAG_NAME: true/false
16+
NEW_KEYWORDS_2026_05: true,
1617
};
1718

1819
/**
@@ -55,12 +56,14 @@ export function isEnabled(feature: string): boolean {
5556

5657
// Uncomment the below when features are present:
5758

58-
// function featureValue(value: null | boolean) {
59-
// if (ENV.ENABLE_OPTIONAL_FEATURES && value === null) {
60-
// return true;
61-
// }
59+
function featureValue(value: null | boolean) {
60+
if (ENV.ENABLE_OPTIONAL_FEATURES && value === null) {
61+
return true;
62+
}
6263

63-
// return value;
64-
// }
64+
return value;
65+
}
6566
//
6667
// export const FLAG_NAME = featureValue(FEATURES.FLAG_NAME);
68+
69+
export const NEW_KEYWORDS_2026_05 = featureValue(FEATURES.NEW_KEYWORDS_2026_05);

packages/@ember/template-compiler/lib/plugins/auto-import-builtins.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { AST, ASTPlugin } from '@glimmer/syntax';
22
import type { EmberASTPluginEnvironment } from '../types';
33
import { isPath, trackLocals } from './utils';
4+
import { NEW_KEYWORDS_2026_05 } from '@ember/canary-features';
45

56
/**
67
@module ember
@@ -14,6 +15,13 @@ import { isPath, trackLocals } from './utils';
1415
*/
1516

1617
export default function autoImportBuiltins(env: EmberASTPluginEnvironment): ASTPlugin {
18+
if (!NEW_KEYWORDS_2026_05) {
19+
return {
20+
name: 'auto-import-built-ins-disabled',
21+
visitor: {},
22+
};
23+
}
24+
1725
let { hasLocal, visitor } = trackLocals(env);
1826

1927
return {

0 commit comments

Comments
 (0)