diff --git a/package.json b/package.json index f41e06be8fd..3c01bbfdd19 100644 --- a/package.json +++ b/package.json @@ -74,19 +74,19 @@ }, "devDependencies": { "@babel/preset-env": "^7.9.5", - "@glimmer/compiler": "0.70.0", + "@glimmer/compiler": "0.71.1", "@glimmer/env": "^0.1.7", - "@glimmer/global-context": "0.70.0", - "@glimmer/interfaces": "0.70.0", - "@glimmer/manager": "0.70.0", - "@glimmer/destroyable": "0.70.0", - "@glimmer/owner": "0.70.0", - "@glimmer/node": "0.70.0", - "@glimmer/opcode-compiler": "0.70.0", - "@glimmer/program": "0.70.0", - "@glimmer/reference": "0.70.0", - "@glimmer/runtime": "0.70.0", - "@glimmer/validator": "0.70.0", + "@glimmer/global-context": "0.71.1", + "@glimmer/interfaces": "0.71.1", + "@glimmer/manager": "0.71.1", + "@glimmer/destroyable": "0.71.1", + "@glimmer/owner": "0.71.1", + "@glimmer/node": "0.71.1", + "@glimmer/opcode-compiler": "0.71.1", + "@glimmer/program": "0.71.1", + "@glimmer/reference": "0.71.1", + "@glimmer/runtime": "0.71.1", + "@glimmer/validator": "0.71.1", "@simple-dom/document": "^1.4.0", "@types/qunit": "^2.9.1", "@types/rsvp": "^4.0.3", diff --git a/packages/@ember/-internals/glimmer/lib/component-managers/internal.ts b/packages/@ember/-internals/glimmer/lib/component-managers/internal.ts index ac2e9ddcc02..3fda28fee7f 100644 --- a/packages/@ember/-internals/glimmer/lib/component-managers/internal.ts +++ b/packages/@ember/-internals/glimmer/lib/component-managers/internal.ts @@ -41,10 +41,6 @@ export default class InternalManager implements InternalComponentManager, WithCreateInstance { - static for(definition: EmberInternalComponentConstructor, name: string): () => InternalManager { - return () => new InternalManager(definition, name); - } - constructor(private ComponentClass: EmberInternalComponentConstructor, private name: string) {} getCapabilities(): InternalComponentCapabilities { diff --git a/packages/@ember/-internals/glimmer/lib/component.ts b/packages/@ember/-internals/glimmer/lib/component.ts index 81f97092df5..f7f65e7c123 100644 --- a/packages/@ember/-internals/glimmer/lib/component.ts +++ b/packages/@ember/-internals/glimmer/lib/component.ts @@ -1128,6 +1128,6 @@ Component.reopenClass({ positionalParams: [], }); -setInternalComponentManager(() => CURLY_COMPONENT_MANAGER, Component); +setInternalComponentManager(CURLY_COMPONENT_MANAGER, Component); export default Component; diff --git a/packages/@ember/-internals/glimmer/lib/components/input.ts b/packages/@ember/-internals/glimmer/lib/components/input.ts index eb2c7c3c4f3..bd0e4da0393 100644 --- a/packages/@ember/-internals/glimmer/lib/components/input.ts +++ b/packages/@ember/-internals/glimmer/lib/components/input.ts @@ -126,7 +126,7 @@ export const InputComponent = { }, }; -setInternalComponentManager(InternalManager.for(Input, 'input'), InputComponent); +setInternalComponentManager(new InternalManager(Input, 'input'), InputComponent); setComponentTemplate(InputTemplate, InputComponent); Input.toString = () => '@ember/component/input'; diff --git a/packages/@ember/-internals/glimmer/lib/helper.ts b/packages/@ember/-internals/glimmer/lib/helper.ts index 215aa20882f..b1888d6dac1 100644 --- a/packages/@ember/-internals/glimmer/lib/helper.ts +++ b/packages/@ember/-internals/glimmer/lib/helper.ts @@ -8,7 +8,7 @@ import { getDebugName, symbol } from '@ember/-internals/utils'; import { join } from '@ember/runloop'; import { DEBUG } from '@glimmer/env'; import { Arguments, Dict, HelperManager } from '@glimmer/interfaces'; -import { helperCapabilities, setHelperManager } from '@glimmer/manager'; +import { getInternalHelperManager, helperCapabilities, setHelperManager } from '@glimmer/manager'; import { consumeTag, createTag, @@ -195,11 +195,11 @@ class ClassicHelperManager implements HelperManager { } } -export const CLASSIC_HELPER_MANAGER_FACTORY = (owner: Owner | undefined): ClassicHelperManager => { +setHelperManager((owner: Owner | undefined): ClassicHelperManager => { return new ClassicHelperManager(owner); -}; +}, Helper); -setHelperManager(CLASSIC_HELPER_MANAGER_FACTORY, Helper); +export const CLASSIC_HELPER_MANAGER = getInternalHelperManager(Helper); /////////// diff --git a/packages/@ember/-internals/glimmer/lib/helpers/-assert-implicit-component-helper-argument.ts b/packages/@ember/-internals/glimmer/lib/helpers/-assert-implicit-component-helper-argument.ts deleted file mode 100644 index b7879daa2c5..00000000000 --- a/packages/@ember/-internals/glimmer/lib/helpers/-assert-implicit-component-helper-argument.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { assert } from '@ember/debug'; -import { DEBUG } from '@glimmer/env'; -import { Helper, VMArguments } from '@glimmer/interfaces'; -import { createComputeRef, valueForRef } from '@glimmer/reference'; -import { internalHelper } from './internal-helper'; - -let helper: Helper; - -if (DEBUG) { - helper = (args: VMArguments) => { - let inner = args.positional.at(0); - let messageRef = args.positional.at(1); - - return createComputeRef(() => { - let value = valueForRef(inner); - - assert(valueForRef(messageRef) as string, typeof value !== 'string'); - - return value; - }); - }; -} else { - helper = (args: VMArguments) => args.positional.at(0); -} - -export default internalHelper(helper); diff --git a/packages/@ember/-internals/glimmer/lib/helpers/internal-helper.ts b/packages/@ember/-internals/glimmer/lib/helpers/internal-helper.ts index 1152a6bf541..99645339afc 100644 --- a/packages/@ember/-internals/glimmer/lib/helpers/internal-helper.ts +++ b/packages/@ember/-internals/glimmer/lib/helpers/internal-helper.ts @@ -2,5 +2,5 @@ import { Helper, HelperDefinitionState } from '@glimmer/interfaces'; import { setInternalHelperManager } from '@glimmer/manager'; export function internalHelper(helper: Helper): HelperDefinitionState { - return setInternalHelperManager(() => helper, {}); + return setInternalHelperManager(helper, {}); } diff --git a/packages/@ember/-internals/glimmer/lib/modifiers/action.ts b/packages/@ember/-internals/glimmer/lib/modifiers/action.ts index dfb67e406d2..165df09fa1e 100644 --- a/packages/@ember/-internals/glimmer/lib/modifiers/action.ts +++ b/packages/@ember/-internals/glimmer/lib/modifiers/action.ts @@ -1,3 +1,4 @@ +import { Owner } from '@ember/-internals/owner'; import { uuid } from '@ember/-internals/utils'; import { ActionManager, isSimpleClick } from '@ember/-internals/views'; import { assert, deprecate } from '@ember/debug'; @@ -204,6 +205,7 @@ export class ActionState { class ActionModifierManager implements InternalModifierManager { create( + _owner: Owner, element: SimpleElement, _state: object, args: VMArguments, @@ -312,4 +314,4 @@ class ActionModifierManager implements InternalModifierManager ACTION_MODIFIER_MANAGER, {}); +export default setInternalModifierManager(ACTION_MODIFIER_MANAGER, {}); diff --git a/packages/@ember/-internals/glimmer/lib/modifiers/internal.ts b/packages/@ember/-internals/glimmer/lib/modifiers/internal.ts index 0fcdbcd83b6..886728732b0 100644 --- a/packages/@ember/-internals/glimmer/lib/modifiers/internal.ts +++ b/packages/@ember/-internals/glimmer/lib/modifiers/internal.ts @@ -63,23 +63,19 @@ class InternalModifierState implements Destroyable { class InternalModifierManager implements ModifierManager { - constructor(private readonly owner: Owner) {} - create( + owner: Owner, element: SimpleElement, factory: typeof InternalModifier, args: VMArguments ): InternalModifierState { assert('element must be an HTMLElement', element instanceof HTMLElement); - let instance = new factory(this.owner, element, args.capture()); + let instance = new factory(owner, element, args.capture()); registerDestructor(instance, (modifier) => modifier.remove()); - return new InternalModifierState( - factory.name, - new factory(this.owner, element, args.capture()) - ); + return new InternalModifierState(factory.name, instance); } // not needed for now, but feel free to implement this @@ -105,4 +101,4 @@ class InternalModifierManager } } -setInternalModifierManager((owner: Owner) => new InternalModifierManager(owner), InternalModifier); +setInternalModifierManager(new InternalModifierManager(), InternalModifier); diff --git a/packages/@ember/-internals/glimmer/lib/modifiers/on.ts b/packages/@ember/-internals/glimmer/lib/modifiers/on.ts index aaee250600d..c6e696a0b72 100644 --- a/packages/@ember/-internals/glimmer/lib/modifiers/on.ts +++ b/packages/@ember/-internals/glimmer/lib/modifiers/on.ts @@ -1,3 +1,4 @@ +import { Owner } from '@ember/-internals/owner'; import { assert } from '@ember/debug'; import { registerDestructor } from '@glimmer/destroyable'; import { DEBUG } from '@glimmer/env'; @@ -322,6 +323,7 @@ class OnModifierManager implements InternalModifierManager ON_MODIFIER_MANAGER, on); +setInternalModifierManager(ON_MODIFIER_MANAGER, on); export default on; diff --git a/packages/@ember/-internals/glimmer/lib/resolver.ts b/packages/@ember/-internals/glimmer/lib/resolver.ts index 529601e1ddd..cda2a83ff0b 100644 --- a/packages/@ember/-internals/glimmer/lib/resolver.ts +++ b/packages/@ember/-internals/glimmer/lib/resolver.ts @@ -31,13 +31,12 @@ import { import { _WeakSet } from '@glimmer/util'; import { isCurlyManager } from './component-managers/curly'; import { - CLASSIC_HELPER_MANAGER_FACTORY, + CLASSIC_HELPER_MANAGER, HelperFactory, HelperInstance, isClassicHelper, SimpleHelper, } from './helper'; -import { default as componentAssertionHelper } from './helpers/-assert-implicit-component-helper-argument'; import { default as inElementNullCheckHelper } from './helpers/-in-element-null-check'; import { default as normalizeClassHelper } from './helpers/-normalize-class'; import { default as trackArray } from './helpers/-track-array'; @@ -193,7 +192,6 @@ const BUILTIN_KEYWORD_HELPERS = { '-get-dynamic-var': internalHelper(getDynamicVar), '-mount': mountHelper, '-outlet': outletHelper, - '-assert-implicit-component-helper-argument': componentAssertionHelper, '-in-el-null': inElementNullCheckHelper, }; @@ -267,10 +265,10 @@ export default class ResolverImpl implements RuntimeResolver, CompileTime // we'll trigger an assertion if (!CLASSIC_HELPER_MANAGER_ASSOCIATED.has(factory)) { CLASSIC_HELPER_MANAGER_ASSOCIATED.add(factory); - setInternalHelperManager(CLASSIC_HELPER_MANAGER_FACTORY, factory); + setInternalHelperManager(CLASSIC_HELPER_MANAGER, factory); } } else { - setInternalHelperManager(CLASSIC_HELPER_MANAGER_FACTORY, factory); + setInternalHelperManager(CLASSIC_HELPER_MANAGER, factory); } return factory; @@ -345,7 +343,7 @@ export default class ResolverImpl implements RuntimeResolver, CompileTime }; } else { let factory = owner.factoryFor(P`component:-default`)!; - let manager = getInternalComponentManager(owner, factory.class as object); + let manager = getInternalComponentManager(factory.class as object); definition = { state: factory, @@ -358,7 +356,7 @@ export default class ResolverImpl implements RuntimeResolver, CompileTime let factory = pair.component; let ComponentClass = factory.class!; - let manager = getInternalComponentManager(owner, ComponentClass); + let manager = getInternalComponentManager(ComponentClass); definition = { state: isCurlyManager(manager) ? factory : ComponentClass, diff --git a/packages/@ember/-internals/glimmer/tests/integration/components/contextual-components-test.js b/packages/@ember/-internals/glimmer/tests/integration/components/contextual-components-test.js index e6b868efdbc..efdaea036a6 100644 --- a/packages/@ember/-internals/glimmer/tests/integration/components/contextual-components-test.js +++ b/packages/@ember/-internals/glimmer/tests/integration/components/contextual-components-test.js @@ -1319,20 +1319,6 @@ moduleFor( this.assertStableRerender(); } - ['@test GH#17121 implicit component invocations should not perform string lookup']() { - this.registerComponent('foo-bar', { template: 'foo-bar component' }); - - expectAssertion( - () => - this.render(strip` - {{#let 'foo-bar' as |foo|}} - {{foo 1 2 3}} - {{/let}} - `), - "expected `foo` to be a contextual component but found a string. Did you mean `(component foo)`? ('-top-level' @ L1:C29) " - ); - } - ['@test RFC#311 invoking named args (without arguments)']() { this.registerComponent('x-outer', { template: '{{@inner}}' }); this.registerComponent('x-inner', { template: 'inner' }); diff --git a/packages/@ember/-internals/glimmer/tests/integration/components/strict-mode-test.js b/packages/@ember/-internals/glimmer/tests/integration/components/strict-mode-test.js index 934b4496453..df70247e557 100644 --- a/packages/@ember/-internals/glimmer/tests/integration/components/strict-mode-test.js +++ b/packages/@ember/-internals/glimmer/tests/integration/components/strict-mode-test.js @@ -19,6 +19,7 @@ import { on, fn, } from '@ember/-internals/glimmer'; +import GlimmerishComponent from '../../utils/glimmerish-component'; if (EMBER_STRICT_MODE) { moduleFor( @@ -89,6 +90,69 @@ if (EMBER_STRICT_MODE) { this.assertHTML('foobar'); this.assertStableRerender(); } + + '@test Can use a dynamic component definition'() { + let Foo = defineComponent({}, 'Hello, world!'); + let Bar = defineComponent( + {}, + '', + class extends GlimmerishComponent { + Foo = Foo; + } + ); + + this.registerComponent('bar', { ComponentClass: Bar }); + + this.render(''); + this.assertHTML('Hello, world!'); + this.assertStableRerender(); + } + + '@test Can use a dynamic component definition (curly)'() { + let Foo = defineComponent({}, 'Hello, world!'); + let Bar = defineComponent( + {}, + '{{this.Foo}}', + class extends GlimmerishComponent { + Foo = Foo; + } + ); + + this.registerComponent('bar', { ComponentClass: Bar }); + + this.render(''); + this.assertHTML('Hello, world!'); + this.assertStableRerender(); + } + + '@test Can use a dynamic helper definition'() { + let foo = defineSimpleHelper(() => 'Hello, world!'); + let Bar = defineComponent( + {}, + '{{this.foo}}', + class extends GlimmerishComponent { + foo = foo; + } + ); + + this.registerComponent('bar', { ComponentClass: Bar }); + + this.render(''); + this.assertHTML('Hello, world!'); + this.assertStableRerender(); + } + + '@feature(EMBER_DYNAMIC_HELPERS_AND_MODIFIERS) Can use a curried dynamic helper'() { + let foo = defineSimpleHelper((value) => value); + let Foo = defineComponent({}, '{{@value}}'); + let Bar = defineComponent({ Foo, foo }, ''); + + this.registerComponent('bar', { ComponentClass: Bar }); + + this.render(''); + this.assertHTML('Hello, world!'); + this.assertStableRerender(); + } } ); diff --git a/packages/@ember/-internals/glimmer/tests/integration/helpers/custom-helper-test.js b/packages/@ember/-internals/glimmer/tests/integration/helpers/custom-helper-test.js index 83cb108e001..b8c884c0a72 100644 --- a/packages/@ember/-internals/glimmer/tests/integration/helpers/custom-helper-test.js +++ b/packages/@ember/-internals/glimmer/tests/integration/helpers/custom-helper-test.js @@ -1,7 +1,13 @@ import { DEBUG } from '@glimmer/env'; -import { RenderingTestCase, moduleFor, runDestroy, runTask } from 'internal-test-helpers'; -import { Helper } from '@ember/-internals/glimmer'; +import { + RenderingTestCase, + moduleFor, + runDestroy, + runTask, + defineSimpleHelper, +} from 'internal-test-helpers'; +import { Helper, Component } from '@ember/-internals/glimmer'; import { set, tracked } from '@ember/-internals/metal'; import { backtrackingMessageFor } from '../../utils/debug-stack'; @@ -769,6 +775,31 @@ moduleFor( this.render('{{hello-world}}'); }, expectedMessage); } + + '@feature(EMBER_DYNAMIC_HELPERS_AND_MODIFIERS) Can use a curried dynamic helper'() { + let val = defineSimpleHelper((value) => value); + + this.registerComponent('foo', { + template: '{{@value}}', + }); + + this.registerComponent('bar', { + template: '', + ComponentClass: Component.extend({ val }), + }); + + this.render(''); + this.assertText('Hello, world!'); + this.assertStableRerender(); + } + + '@feature(!EMBER_DYNAMIC_HELPERS_AND_MODIFIERS) Can use a curried dynamic helper'() { + expectAssertion(() => { + this.registerComponent('bar', { + template: '', + }); + }, /Cannot use the \(helper\) keyword yet, as it has not been implemented/); + } } ); diff --git a/packages/@ember/-internals/glimmer/tests/integration/modifiers/on-test.js b/packages/@ember/-internals/glimmer/tests/integration/modifiers/on-test.js index 14204334a60..f10186b6a61 100644 --- a/packages/@ember/-internals/glimmer/tests/integration/modifiers/on-test.js +++ b/packages/@ember/-internals/glimmer/tests/integration/modifiers/on-test.js @@ -19,7 +19,7 @@ moduleFor( getOnManagerInstance() { // leveraging private APIs, this can be deleted if these APIs change // but it has been useful to verify some internal details - return getInternalModifierManager(this.owner, on); + return getInternalModifierManager(on); } assertCounts(expected) { @@ -390,7 +390,7 @@ moduleFor( getOnManagerInstance() { // leveraging private APIs, this can be deleted if these APIs change // but it has been useful to verify some internal details - return getInternalModifierManager(this.owner, on); + return getInternalModifierManager(on); } assertCounts(expected) { diff --git a/packages/@ember/canary-features/index.ts b/packages/@ember/canary-features/index.ts index 13458920d71..8ba141bd5d0 100644 --- a/packages/@ember/canary-features/index.ts +++ b/packages/@ember/canary-features/index.ts @@ -20,6 +20,7 @@ export const DEFAULT_FEATURES = { EMBER_GLIMMER_INVOKE_HELPER: true, EMBER_MODERNIZED_BUILT_IN_COMPONENTS: null, EMBER_STRICT_MODE: null, + EMBER_DYNAMIC_HELPERS_AND_MODIFIERS: null, }; /** @@ -77,3 +78,6 @@ export const EMBER_MODERNIZED_BUILT_IN_COMPONENTS = featureValue( FEATURES.EMBER_MODERNIZED_BUILT_IN_COMPONENTS ); export const EMBER_STRICT_MODE = featureValue(FEATURES.EMBER_STRICT_MODE); +export const EMBER_DYNAMIC_HELPERS_AND_MODIFIERS = featureValue( + FEATURES.EMBER_DYNAMIC_HELPERS_AND_MODIFIERS +); diff --git a/packages/ember-template-compiler/index.ts b/packages/ember-template-compiler/index.ts index fc69a458b97..3cdea8978d9 100644 --- a/packages/ember-template-compiler/index.ts +++ b/packages/ember-template-compiler/index.ts @@ -27,7 +27,7 @@ export { registerPlugin, unregisterPlugin, } from './lib/system/compile-options'; -export { default as defaultPlugins } from './lib/plugins/index'; +export { RESOLUTION_MODE_TRANSFORMS, STRICT_MODE_TRANSFORMS } from './lib/plugins/index'; export { EmberPrecompileOptions } from './lib/types'; // used to bootstrap templates diff --git a/packages/ember-template-compiler/lib/plugins/assert-against-dynamic-helpers-modifiers.ts b/packages/ember-template-compiler/lib/plugins/assert-against-dynamic-helpers-modifiers.ts new file mode 100644 index 00000000000..5596042bae9 --- /dev/null +++ b/packages/ember-template-compiler/lib/plugins/assert-against-dynamic-helpers-modifiers.ts @@ -0,0 +1,56 @@ +import { assert } from '@ember/debug'; +import { AST, ASTPlugin } from '@glimmer/syntax'; +import calculateLocationDisplay from '../system/calculate-location-display'; +import { EmberASTPluginEnvironment } from '../types'; +import { isPath, trackLocals } from './utils'; + +export default function assertAgainstDynamicHelpersModifiers( + env: EmberASTPluginEnvironment +): ASTPlugin { + let { moduleName } = env.meta; + let { hasLocal, node } = trackLocals(); + + return { + name: 'assert-against-dynamic-helpers-modifiers', + + visitor: { + Program: node, + + ElementNode: { + keys: { + children: node, + }, + }, + + MustacheStatement(node: AST.MustacheStatement) { + if (isPath(node.path)) { + let name = node.path.parts[0]; + + assert( + `${messageFor(name)} ${calculateLocationDisplay(moduleName, node.loc)}`, + (name !== 'helper' && name !== 'modifier') || isLocalVariable(node.path, hasLocal) + ); + } + }, + + SubExpression(node: AST.SubExpression) { + if (isPath(node.path)) { + let name = node.path.parts[0]; + + assert( + `${messageFor(name)} ${calculateLocationDisplay(moduleName, node.loc)}`, + (name !== 'helper' && name !== 'modifier') || isLocalVariable(node.path, hasLocal) + ); + } + }, + }, + }; +} + +function isLocalVariable(node: AST.PathExpression, hasLocal: (k: string) => boolean): boolean { + return !node.this && node.parts.length === 1 && hasLocal(node.parts[0]); +} + +function messageFor(name: string): string { + return `Cannot use the (${name}) keyword yet, as it has not been implemented.`; +} diff --git a/packages/ember-template-compiler/lib/plugins/assert-local-variable-shadowing-helper-invocation.ts b/packages/ember-template-compiler/lib/plugins/assert-local-variable-shadowing-helper-invocation.ts deleted file mode 100644 index 0022edf624a..00000000000 --- a/packages/ember-template-compiler/lib/plugins/assert-local-variable-shadowing-helper-invocation.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { assert } from '@ember/debug'; -import { AST, ASTPlugin } from '@glimmer/syntax'; -import calculateLocationDisplay from '../system/calculate-location-display'; -import { EmberASTPluginEnvironment } from '../types'; -import { isPath, trackLocals } from './utils'; - -export default function assertLocalVariableShadowingHelperInvocation( - env: EmberASTPluginEnvironment -): ASTPlugin { - let { moduleName } = env.meta; - let { hasLocal, node } = trackLocals(); - - if (env.strictMode) { - return { - name: 'assert-local-variable-shadowing-helper-invocation', - visitor: {}, - }; - } - - return { - name: 'assert-local-variable-shadowing-helper-invocation', - - visitor: { - Program: node, - - ElementNode: { - keys: { - children: node, - }, - }, - - MustacheStatement(node: AST.MustacheStatement) { - if (isPath(node.path) && hasArguments(node)) { - let name = node.path.parts[0]; - let type = 'helper'; - - assert( - `${messageFor(name, type)} ${calculateLocationDisplay(moduleName, node.loc)}`, - !isLocalVariable(node.path, hasLocal) - ); - } - }, - - SubExpression(node: AST.SubExpression) { - if (isPath(node.path)) { - let name = node.path.parts[0]; - let type = 'helper'; - - assert( - `${messageFor(name, type)} ${calculateLocationDisplay(moduleName, node.loc)}`, - !isLocalVariable(node.path, hasLocal) - ); - } - }, - - ElementModifierStatement(node: AST.ElementModifierStatement) { - if (isPath(node.path)) { - let name = node.path.parts[0]; - let type = 'modifier'; - - assert( - `${messageFor(name, type)} ${calculateLocationDisplay(moduleName, node.loc)}`, - !isLocalVariable(node.path, hasLocal) - ); - } - }, - }, - }; -} - -function isLocalVariable(node: AST.PathExpression, hasLocal: (k: string) => boolean): boolean { - return !node.this && node.parts.length === 1 && hasLocal(node.parts[0]); -} - -function messageFor(name: string, type: string): string { - return `Cannot invoke the \`${name}\` ${type} because it was shadowed by a local variable (i.e. a block param) with the same name. Please rename the local variable to resolve the conflict.`; -} - -function hasArguments(node: AST.MustacheStatement): boolean { - return node.params.length > 0 || node.hash.pairs.length > 0; -} diff --git a/packages/ember-template-compiler/lib/plugins/index.ts b/packages/ember-template-compiler/lib/plugins/index.ts index a882a0e4dce..ead78cda876 100644 --- a/packages/ember-template-compiler/lib/plugins/index.ts +++ b/packages/ember-template-compiler/lib/plugins/index.ts @@ -1,13 +1,12 @@ +import AssertAgainstDynamicHelpersModifiers from './assert-against-dynamic-helpers-modifiers'; import AssertAgainstNamedBlocks from './assert-against-named-blocks'; import AssertIfHelperWithoutArguments from './assert-if-helper-without-arguments'; import AssertInputHelperWithoutBlock from './assert-input-helper-without-block'; -import AssertLocalVariableShadowingHelperInvocation from './assert-local-variable-shadowing-helper-invocation'; import AssertReservedNamedArguments from './assert-reserved-named-arguments'; import AssertSplattributeExpressions from './assert-splattribute-expression'; import DeprecateSendAction from './deprecate-send-action'; import TransformActionSyntax from './transform-action-syntax'; import TransformAttrsIntoArgs from './transform-attrs-into-args'; -import TransformComponentInvocation from './transform-component-invocation'; import TransformEachInIntoEach from './transform-each-in-into-each'; import TransformEachTrackArray from './transform-each-track-array'; import TransformHasBlockSyntax from './transform-has-block-syntax'; @@ -17,35 +16,48 @@ import TransformOldClassBindingSyntax from './transform-old-class-binding-syntax import TransformQuotedBindingsIntoJustBindings from './transform-quoted-bindings-into-just-bindings'; import TransformWrapMountAndOutlet from './transform-wrap-mount-and-outlet'; -import { EMBER_NAMED_BLOCKS } from '@ember/canary-features'; +import { EMBER_DYNAMIC_HELPERS_AND_MODIFIERS, EMBER_NAMED_BLOCKS } from '@ember/canary-features'; import { SEND_ACTION } from '@ember/deprecated-features'; // order of plugins is important -const transforms = [ - TransformComponentInvocation, - TransformOldClassBindingSyntax, - TransformQuotedBindingsIntoJustBindings, - AssertReservedNamedArguments, - TransformActionSyntax, - TransformAttrsIntoArgs, - TransformEachInIntoEach, - TransformHasBlockSyntax, - AssertLocalVariableShadowingHelperInvocation, - TransformLinkTo, - AssertInputHelperWithoutBlock, - TransformInElement, - AssertIfHelperWithoutArguments, - AssertSplattributeExpressions, - TransformEachTrackArray, - TransformWrapMountAndOutlet, -]; +export const RESOLUTION_MODE_TRANSFORMS = Object.freeze( + [ + TransformOldClassBindingSyntax, + TransformQuotedBindingsIntoJustBindings, + AssertReservedNamedArguments, + TransformActionSyntax, + TransformAttrsIntoArgs, + TransformEachInIntoEach, + TransformHasBlockSyntax, + TransformLinkTo, + AssertInputHelperWithoutBlock, + TransformInElement, + AssertIfHelperWithoutArguments, + AssertSplattributeExpressions, + TransformEachTrackArray, + TransformWrapMountAndOutlet, + SEND_ACTION ? DeprecateSendAction : null, + !EMBER_NAMED_BLOCKS ? AssertAgainstNamedBlocks : null, + !EMBER_DYNAMIC_HELPERS_AND_MODIFIERS ? AssertAgainstDynamicHelpersModifiers : null, + ].filter(notNull) +); -if (SEND_ACTION) { - transforms.push(DeprecateSendAction); -} +export const STRICT_MODE_TRANSFORMS = Object.freeze( + [ + TransformQuotedBindingsIntoJustBindings, + AssertReservedNamedArguments, + TransformActionSyntax, + TransformEachInIntoEach, + TransformInElement, + AssertSplattributeExpressions, + TransformEachTrackArray, + TransformWrapMountAndOutlet, + SEND_ACTION ? DeprecateSendAction : null, + !EMBER_NAMED_BLOCKS ? AssertAgainstNamedBlocks : null, + !EMBER_DYNAMIC_HELPERS_AND_MODIFIERS ? AssertAgainstDynamicHelpersModifiers : null, + ].filter(notNull) +); -if (!EMBER_NAMED_BLOCKS) { - transforms.push(AssertAgainstNamedBlocks); +function notNull(value: TValue | null): value is TValue { + return value !== null; } - -export default Object.freeze(transforms); diff --git a/packages/ember-template-compiler/lib/plugins/transform-component-invocation.ts b/packages/ember-template-compiler/lib/plugins/transform-component-invocation.ts deleted file mode 100644 index 103a1f28e4a..00000000000 --- a/packages/ember-template-compiler/lib/plugins/transform-component-invocation.ts +++ /dev/null @@ -1,232 +0,0 @@ -import { AST, ASTPlugin } from '@glimmer/syntax'; -import calculateLocationDisplay from '../system/calculate-location-display'; -import { Builders, EmberASTPluginEnvironment } from '../types'; -import { isPath, trackLocals } from './utils'; - -/** - Transforms unambigious invocations of closure components to be wrapped with - the component helper. Once these syntaxes are fully supported by Glimmer VM - natively, this transform can be removed. - - ```handlebars - {{!-- this.foo is not a legal helper/component name --}} - {{this.foo "with" some="args"}} - ``` - - with - - ```handlebars - {{component this.foo "with" some="args"}} - ``` - - and - - ```handlebars - {{!-- this.foo is not a legal helper/component name --}} - {{#this.foo}}...{{/this.foo}} - ``` - - with - - ```handlebars - {{#component this.foo}}...{{/component}} - ``` - - and - - ```handlebars - {{!-- foo.bar is not a legal helper/component name --}} - {{foo.bar "with" some="args"}} - ``` - - with - - ```handlebars - {{component foo.bar "with" some="args"}} - ``` - - and - - ```handlebars - {{!-- foo.bar is not a legal helper/component name --}} - {{#foo.bar}}...{{/foo.bar}} - ``` - - with - - ```handlebars - {{#component foo.bar}}...{{/component}} - ``` - - and - - ```handlebars - {{!-- @foo is not a legal helper/component name --}} - {{@foo "with" some="args"}} - ``` - - with - - ```handlebars - {{component @foo "with" some="args"}} - ``` - - and - - ```handlebars - {{!-- @foo is not a legal helper/component name --}} - {{#@foo}}...{{/@foo}} - ``` - - with - - ```handlebars - {{#component @foo}}...{{/component}} - ``` - - and - - ```handlebars - {{#let ... as |foo|}} - {{!-- foo is a local variable --}} - {{foo "with" some="args"}} - {{/let}} - ``` - - with - - ```handlebars - {{#let ... as |foo|}} - {{component foo "with" some="args"}} - {{/let}} - ``` - - and - - ```handlebars - {{#let ... as |foo|}} - {{!-- foo is a local variable --}} - {{#foo}}...{{/foo}} - {{/let}} - ``` - - with - - ```handlebars - {{#let ... as |foo|}} - {{#component foo}}...{{/component}} - {{/let}} - ``` - - @private - @class TransFormComponentInvocation -*/ -export default function transformComponentInvocation(env: EmberASTPluginEnvironment): ASTPlugin { - let { hasLocal, node } = trackLocals(); - - let isAttrs = false; - - return { - name: 'transform-component-invocation', - - visitor: { - Program: node, - - ElementNode: { - keys: { - attributes: { - enter() { - isAttrs = true; - }, - - exit() { - isAttrs = false; - }, - }, - - children: node, - }, - }, - - BlockStatement(node: AST.BlockStatement) { - if (isBlockInvocation(node, hasLocal)) { - wrapInComponent(env, node); - } - }, - - MustacheStatement(node: AST.MustacheStatement): AST.Node | void { - if (!isAttrs && isInlineInvocation(node, hasLocal)) { - wrapInComponent(env, node); - } - }, - }, - }; -} - -function isInlineInvocation( - node: AST.MustacheStatement, - hasLocal: (k: string) => boolean -): boolean { - let { path } = node; - return isPath(path) && isIllegalName(path, hasLocal) && hasArguments(node); -} - -function isIllegalName(node: AST.PathExpression, hasLocal: (k: string) => boolean): boolean { - return isThisPath(node) || isDotPath(node) || isNamedArg(node) || isLocalVariable(node, hasLocal); -} - -function isThisPath(node: AST.PathExpression): boolean { - return node.this === true; -} - -function isDotPath(node: AST.PathExpression): boolean { - return node.parts.length > 1; -} - -function isNamedArg(node: AST.PathExpression): boolean { - return node.data === true; -} - -function isLocalVariable(node: AST.PathExpression, hasLocal: (k: string) => boolean): boolean { - return !node.this && hasLocal(node.parts[0]); -} - -function hasArguments(node: AST.MustacheStatement): boolean { - return node.params.length > 0 || node.hash.pairs.length > 0; -} - -function isBlockInvocation(node: AST.BlockStatement, hasLocal: (k: string) => boolean): boolean { - return isPath(node.path) && isIllegalName(node.path, hasLocal); -} - -function wrapInAssertion(moduleName: string, node: AST.PathExpression, b: Builders) { - let error = b.string( - `expected \`${ - node.original - }\` to be a contextual component but found a string. Did you mean \`(component ${ - node.original - })\`? ${calculateLocationDisplay(moduleName, node.loc)}` - ); - - return b.sexpr( - b.path('-assert-implicit-component-helper-argument'), - [node, error], - b.hash(), - node.loc - ); -} - -function wrapInComponent( - env: EmberASTPluginEnvironment, - node: AST.MustacheStatement | AST.BlockStatement -) { - let { moduleName } = env.meta; - let { builders: b } = env.syntax; - - let component = env.isProduction - ? node.path - : wrapInAssertion(moduleName, node.path as AST.PathExpression, b); - - node.path = b.path('component'); - node.params.unshift(component); -} diff --git a/packages/ember-template-compiler/lib/system/compile-options.ts b/packages/ember-template-compiler/lib/system/compile-options.ts index 9002d6e2fd7..1e9e2129cfc 100644 --- a/packages/ember-template-compiler/lib/system/compile-options.ts +++ b/packages/ember-template-compiler/lib/system/compile-options.ts @@ -2,7 +2,7 @@ import { EMBER_STRICT_MODE } from '@ember/canary-features'; import { assign } from '@ember/polyfills'; import { PrecompileOptions } from '@glimmer/compiler'; import { AST, ASTPlugin, ASTPluginEnvironment, Syntax } from '@glimmer/syntax'; -import PLUGINS from '../plugins/index'; +import { RESOLUTION_MODE_TRANSFORMS, STRICT_MODE_TRANSFORMS } from '../plugins/index'; import { EmberPrecompileOptions, PluginFunc } from '../types'; import COMPONENT_NAME_SIMPLE_DASHERIZE_CACHE from './dasherize-component-name'; @@ -32,10 +32,12 @@ export default function compileOptions( meta.moduleName = options.moduleName; } + let builtInPlugins = options.strictMode ? STRICT_MODE_TRANSFORMS : RESOLUTION_MODE_TRANSFORMS; + if (!_options.plugins) { - options.plugins = { ast: [...USER_PLUGINS, ...PLUGINS] }; + options.plugins = { ast: [...USER_PLUGINS, ...builtInPlugins] }; } else { - let potententialPugins = [...USER_PLUGINS, ...PLUGINS]; + let potententialPugins = [...USER_PLUGINS, ...builtInPlugins]; let providedPlugins = options.plugins.ast.map((plugin) => wrapLegacyPluginIfNeeded(plugin)); let pluginsToAdd = potententialPugins.filter((plugin) => { return options.plugins.ast.indexOf(plugin) === -1; diff --git a/packages/ember-template-compiler/tests/plugins/assert-local-variable-shadowing-helper-invocation-test.js b/packages/ember-template-compiler/tests/plugins/assert-local-variable-shadowing-helper-invocation-test.js deleted file mode 100644 index 313334fe2b0..00000000000 --- a/packages/ember-template-compiler/tests/plugins/assert-local-variable-shadowing-helper-invocation-test.js +++ /dev/null @@ -1,651 +0,0 @@ -import { compile } from '../../index'; -import { moduleFor, AbstractTestCase } from 'internal-test-helpers'; - -moduleFor( - 'ember-template-compiler: assert-local-variable-shadowing-helper-invocation', - class extends AbstractTestCase { - [`@test block statements shadowing sub-expression invocations`]() { - expectAssertion(() => { - compile( - ` - {{#let foo as |foo|}} - {{concat (foo)}} - {{/let}}`, - { moduleName: 'baz/foo-bar' } - ); - }, `Cannot invoke the \`foo\` helper because it was shadowed by a local variable (i.e. a block param) with the same name. Please rename the local variable to resolve the conflict. ('baz/foo-bar' @ L3:C21) `); - - expectAssertion(() => { - compile( - ` - {{#let foo as |foo|}} - {{concat (foo bar baz)}} - {{/let}}`, - { moduleName: 'baz/foo-bar' } - ); - }, `Cannot invoke the \`foo\` helper because it was shadowed by a local variable (i.e. a block param) with the same name. Please rename the local variable to resolve the conflict. ('baz/foo-bar' @ L3:C21) `); - - // Not shadowed - - compile( - ` - {{#let foo as |foo|}}{{/let}} - {{concat (foo)}} - {{concat (foo bar baz)}}`, - { moduleName: 'baz/foo-bar' } - ); - - // Not invocations - - compile( - ` - {{#let foo as |foo|}} - {{concat foo}} - {{/let}}`, - { moduleName: 'baz/foo-bar' } - ); - - compile( - ` - {{#let (concat foo) as |concat|}} - {{input value=concat}} - {{/let}}`, - { moduleName: 'baz/foo-bar' } - ); - } - - [`@test element nodes shadowing sub-expression invocations`]() { - expectAssertion(() => { - compile( - ` - - {{concat (foo)}} - `, - { moduleName: 'baz/foo-bar' } - ); - }, `Cannot invoke the \`foo\` helper because it was shadowed by a local variable (i.e. a block param) with the same name. Please rename the local variable to resolve the conflict. ('baz/foo-bar' @ L3:C21) `); - - expectAssertion(() => { - compile( - ` - - {{concat (foo bar baz)}} - `, - { moduleName: 'baz/foo-bar' } - ); - }, `Cannot invoke the \`foo\` helper because it was shadowed by a local variable (i.e. a block param) with the same name. Please rename the local variable to resolve the conflict. ('baz/foo-bar' @ L3:C21) `); - - // Not shadowed - - compile( - ` - - {{concat (foo)}} - {{concat (foo bar baz)}}`, - { moduleName: 'baz/foo-bar' } - ); - - // Not invocations - - compile( - ` - - {{concat foo}} - `, - { moduleName: 'baz/foo-bar' } - ); - - compile( - ` - - {{input value=concat}} - `, - { moduleName: 'baz/foo-bar' } - ); - } - - [`@test deeply nested sub-expression invocations`]() { - expectAssertion(() => { - compile( - ` - {{#let foo as |foo|}} - - {{#each items as |baz|}} - {{concat (foo)}} - {{/each}} - - {{/let}}`, - { moduleName: 'baz/foo-bar' } - ); - }, `Cannot invoke the \`foo\` helper because it was shadowed by a local variable (i.e. a block param) with the same name. Please rename the local variable to resolve the conflict. ('baz/foo-bar' @ L5:C25) `); - - expectAssertion(() => { - compile( - ` - {{#let foo as |foo|}} - - {{#each items as |baz|}} - {{concat (foo bar baz)}} - {{/each}} - - {{/let}}`, - { moduleName: 'baz/foo-bar' } - ); - }, `Cannot invoke the \`foo\` helper because it was shadowed by a local variable (i.e. a block param) with the same name. Please rename the local variable to resolve the conflict. ('baz/foo-bar' @ L5:C25) `); - - // Not shadowed - - compile( - ` - {{#let foo as |foo|}} - - {{#each items as |baz|}} - {{/each}} - {{concat (baz)}} - {{concat (baz bat)}} - - {{concat (bar)}} - {{concat (bar baz bat)}} - {{/let}} - {{concat (foo)}} - {{concat (foo bar baz bat)}}`, - { moduleName: 'baz/foo-bar' } - ); - - // Not invocations - - compile( - ` - {{#let foo as |foo|}} - - {{#each items as |baz|}} - {{concat foo}} - {{/each}} - - {{/let}}`, - { moduleName: 'baz/foo-bar' } - ); - - compile( - ` - {{#let (foo foo) as |foo|}} - - {{#each (baz baz) as |baz|}} - {{concat foo bar baz}} - {{/each}} - - {{/let}}`, - { moduleName: 'baz/foo-bar' } - ); - } - - [`@test block statements shadowing attribute sub-expression invocations`]() { - expectAssertion(() => { - compile( - ` - {{#let foo as |foo|}} -
- {{/let}}`, - { moduleName: 'baz/foo-bar' } - ); - }, `Cannot invoke the \`foo\` helper because it was shadowed by a local variable (i.e. a block param) with the same name. Please rename the local variable to resolve the conflict. ('baz/foo-bar' @ L3:C32) `); - - // Not shadowed - - compile( - ` - {{#let foo as |foo|}}{{/let}} -
-
`, - { moduleName: 'baz/foo-bar' } - ); - - // Not invocations - - compile( - ` - {{#let foo as |foo|}} -
- {{/let}}`, - { moduleName: 'baz/foo-bar' } - ); - - compile( - ` - {{#let (foo foo) as |foo|}} -
- {{/let}}`, - { moduleName: 'baz/foo-bar' } - ); - } - - [`@test element nodes shadowing attribute sub-expression invocations`]() { - expectAssertion(() => { - compile( - ` - -
- `, - { moduleName: 'baz/foo-bar' } - ); - }, `Cannot invoke the \`foo\` helper because it was shadowed by a local variable (i.e. a block param) with the same name. Please rename the local variable to resolve the conflict. ('baz/foo-bar' @ L3:C32) `); - - // Not shadowed - - compile( - ` - -
-
`, - { moduleName: 'baz/foo-bar' } - ); - - // Not invocations - - compile( - ` - -
- `, - { moduleName: 'baz/foo-bar' } - ); - - compile( - ` - -
- `, - { moduleName: 'baz/foo-bar' } - ); - } - - [`@test deeply nested attribute sub-expression invocations`]() { - expectAssertion(() => { - compile( - ` - {{#let foo as |foo|}} - - {{#each items as |baz|}} -
- {{/each}} - - {{/let}}`, - { moduleName: 'baz/foo-bar' } - ); - }, `Cannot invoke the \`foo\` helper because it was shadowed by a local variable (i.e. a block param) with the same name. Please rename the local variable to resolve the conflict. ('baz/foo-bar' @ L5:C36) `); - - // Not shadowed - - compile( - ` - {{#let foo as |foo|}} - - {{#each items as |baz|}} - {{/each}} -
-
- -
-
- {{/let}} -
-
`, - { moduleName: 'baz/foo-bar' } - ); - - // Not invocations - - compile( - ` - {{#let foo as |foo|}} - - {{#each items as |baz|}} -
- {{/each}} - - {{/let}}`, - { moduleName: 'baz/foo-bar' } - ); - - compile( - ` - {{#let (foo foo) as |foo|}} - - {{#each (baz baz) as |baz|}} -
- {{/each}} - - {{/let}}`, - { moduleName: 'baz/foo-bar' } - ); - } - - [`@test block statements shadowing attribute mustache invocations`]() { - expectAssertion(() => { - compile( - ` - {{#let foo as |foo|}} -
- {{/let}}`, - { moduleName: 'baz/foo-bar' } - ); - }, `Cannot invoke the \`foo\` helper because it was shadowed by a local variable (i.e. a block param) with the same name. Please rename the local variable to resolve the conflict. ('baz/foo-bar' @ L3:C23) `); - - // Not shadowed - - compile( - ` - {{#let foo as |foo|}}{{/let}} -
-
`, - { moduleName: 'baz/foo-bar' } - ); - - // Not invocations - - compile( - ` - {{#let foo as |foo|}} -
- {{/let}}`, - { moduleName: 'baz/foo-bar' } - ); - - compile( - ` - {{#let (concat foo) as |concat|}} -
- {{/let}}`, - { moduleName: 'baz/foo-bar' } - ); - } - - [`@test element nodes shadowing attribute mustache invocations`]() { - expectAssertion(() => { - compile( - ` - -
- `, - { moduleName: 'baz/foo-bar' } - ); - }, `Cannot invoke the \`foo\` helper because it was shadowed by a local variable (i.e. a block param) with the same name. Please rename the local variable to resolve the conflict. ('baz/foo-bar' @ L3:C23) `); - - // Not shadowed - - compile( - ` - -
-
`, - { moduleName: 'baz/foo-bar' } - ); - - // Not invocations - - compile( - ` - -
- `, - { moduleName: 'baz/foo-bar' } - ); - - compile( - ` - -
- `, - { moduleName: 'baz/foo-bar' } - ); - } - - [`@test deeply nested attribute mustache invocations`]() { - expectAssertion(() => { - compile( - ` - {{#let foo as |foo|}} - - {{#each items as |baz|}} -
- {{/each}} - - {{/let}}`, - { moduleName: 'baz/foo-bar' } - ); - }, `Cannot invoke the \`foo\` helper because it was shadowed by a local variable (i.e. a block param) with the same name. Please rename the local variable to resolve the conflict. ('baz/foo-bar' @ L5:C27) `); - - // Not shadowed - - compile( - ` - {{#let foo as |foo|}} - - {{#each items as |baz|}} - {{/each}} -
-
- -
-
- {{/let}} -
-
`, - { moduleName: 'baz/foo-bar' } - ); - - // Not invocations - - compile( - ` - {{#let foo as |foo|}} - - {{#each items as |baz|}} -
- {{/each}} - - {{/let}}`, - { moduleName: 'baz/foo-bar' } - ); - - compile( - ` - {{#let (foo foo) as |foo|}} - - {{#each (baz baz) as |baz|}} -
- {{/each}} - - {{/let}}`, - { moduleName: 'baz/foo-bar' } - ); - } - - [`@test block statements shadowing mustache invocations`](assert) { - // These are fine, because they should already be considered contextual - // component invocations, not helper invocations - assert.expect(0); - - compile( - ` - {{#let foo as |foo|}} - {{foo}} - {{/let}}`, - { moduleName: 'baz/foo-bar' } - ); - - compile( - ` - {{#let foo as |foo|}} - {{foo bar baz}} - {{/let}}`, - { moduleName: 'baz/foo-bar' } - ); - } - - [`@test element nodes shadowing mustache invocations`](assert) { - // These are fine, because they should already be considered contextual - // component invocations, not helper invocations - assert.expect(0); - - compile( - ` - - {{foo}} - `, - { moduleName: 'baz/foo-bar' } - ); - - compile( - ` - - {{foo bar baz}} - `, - { moduleName: 'baz/foo-bar' } - ); - } - - [`@test deeply nested mustache invocations`](assert) { - // These are fine, because they should already be considered contextual - // component invocations, not helper invocations - assert.expect(0); - - compile( - ` - {{#let foo as |foo|}} - - {{#each items as |baz|}} - {{foo}} - {{/each}} - - {{/let}}`, - { moduleName: 'baz/foo-bar' } - ); - - compile( - ` - {{#let foo as |foo|}} - - {{#each items as |baz|}} - {{foo bar baz}} - {{/each}} - - {{/let}}`, - { moduleName: 'baz/foo-bar' } - ); - } - - [`@test block statements shadowing modifier invocations`]() { - expectAssertion(() => { - compile( - ` - {{#let foo as |foo|}} -
- {{/let}}`, - { moduleName: 'baz/foo-bar' } - ); - }, `Cannot invoke the \`foo\` modifier because it was shadowed by a local variable (i.e. a block param) with the same name. Please rename the local variable to resolve the conflict. ('baz/foo-bar' @ L3:C17) `); - - expectAssertion(() => { - compile( - ` - {{#let foo as |foo|}} -
- {{/let}}`, - { moduleName: 'baz/foo-bar' } - ); - }, `Cannot invoke the \`foo\` modifier because it was shadowed by a local variable (i.e. a block param) with the same name. Please rename the local variable to resolve the conflict. ('baz/foo-bar' @ L3:C17) `); - - // Not shadowed - - compile( - ` - {{#let foo as |foo|}}{{/let}} -
-
`, - { moduleName: 'baz/foo-bar' } - ); - } - - [`@test element nodes shadowing modifier invocations`]() { - expectAssertion(() => { - compile( - ` - -
- `, - { moduleName: 'baz/foo-bar' } - ); - }, `Cannot invoke the \`foo\` modifier because it was shadowed by a local variable (i.e. a block param) with the same name. Please rename the local variable to resolve the conflict. ('baz/foo-bar' @ L3:C17) `); - - expectAssertion(() => { - compile( - ` - -
- `, - { moduleName: 'baz/foo-bar' } - ); - }, `Cannot invoke the \`foo\` modifier because it was shadowed by a local variable (i.e. a block param) with the same name. Please rename the local variable to resolve the conflict. ('baz/foo-bar' @ L3:C17) `); - - // Not shadowed - - compile( - ` - -
-
`, - { moduleName: 'baz/foo-bar' } - ); - } - - [`@test deeply nested modifier invocations`]() { - expectAssertion(() => { - compile( - ` - {{#let foo as |foo|}} - - {{#each items as |baz|}} -
- {{/each}} - - {{/let}}`, - { moduleName: 'baz/foo-bar' } - ); - }, `Cannot invoke the \`foo\` modifier because it was shadowed by a local variable (i.e. a block param) with the same name. Please rename the local variable to resolve the conflict. ('baz/foo-bar' @ L5:C21) `); - - expectAssertion(() => { - compile( - ` - {{#let foo as |foo|}} - - {{#each items as |baz|}} -
- {{/each}} - - {{/let}}`, - { moduleName: 'baz/foo-bar' } - ); - }, `Cannot invoke the \`foo\` modifier because it was shadowed by a local variable (i.e. a block param) with the same name. Please rename the local variable to resolve the conflict. ('baz/foo-bar' @ L5:C21) `); - - // Not shadowed - - compile( - ` - {{#let foo as |foo|}} - - {{#each items as |baz|}} - {{/each}} -
-
- -
-
- {{/let}} -
-
`, - { moduleName: 'baz/foo-bar' } - ); - } - } -); diff --git a/packages/ember-template-compiler/tests/plugins/transform-component-invocation-test.js b/packages/ember-template-compiler/tests/plugins/transform-component-invocation-test.js index b693cec4030..c91857cb088 100644 --- a/packages/ember-template-compiler/tests/plugins/transform-component-invocation-test.js +++ b/packages/ember-template-compiler/tests/plugins/transform-component-invocation-test.js @@ -1,4 +1,4 @@ -import { compile, precompile } from '../../index'; +import { compile } from '../../index'; import { moduleFor, AbstractTestCase } from 'internal-test-helpers'; moduleFor( @@ -26,20 +26,5 @@ moduleFor( compile(layout, { moduleName: `example-${i}` }); }); } - - '@test production compilation results in smaller template size'(assert) { - let layout = `{{this.modal open}}`; - - let debugOutput = precompile(layout, { moduleName: `example.hbs` }); - let prodOutput = precompile(layout, { isProduction: true, moduleName: `example.hbs` }); - - assert.notStrictEqual( - prodOutput, - debugOutput, - 'expected output to differ between prod and non-prod' - ); - - assert.ok(prodOutput.length < debugOutput.length, 'prod output is smaller'); - } } ); diff --git a/packages/ember-template-compiler/tests/system/compile_options_test.js b/packages/ember-template-compiler/tests/system/compile_options_test.js index c49297f0b59..1ee2968adf8 100644 --- a/packages/ember-template-compiler/tests/system/compile_options_test.js +++ b/packages/ember-template-compiler/tests/system/compile_options_test.js @@ -1,7 +1,8 @@ import { compile, compileOptions, - defaultPlugins, + RESOLUTION_MODE_TRANSFORMS, + STRICT_MODE_TRANSFORMS, registerPlugin, unregisterPlugin, } from '../../index'; @@ -14,13 +15,24 @@ moduleFor( assert.notEqual(compileOptions(), compileOptions()); } - ['@test has default AST plugins'](assert) { - assert.expect(defaultPlugins.length); + ['@test has default AST plugins in resolution mode'](assert) { + assert.expect(RESOLUTION_MODE_TRANSFORMS.length); let plugins = compileOptions().plugins.ast; - for (let i = 0; i < defaultPlugins.length; i++) { - let plugin = defaultPlugins[i]; + for (let i = 0; i < RESOLUTION_MODE_TRANSFORMS.length; i++) { + let plugin = RESOLUTION_MODE_TRANSFORMS[i]; + assert.ok(plugins.indexOf(plugin) > -1, `includes ${plugin}`); + } + } + + ['@test has default AST plugins in strict mode'](assert) { + assert.expect(STRICT_MODE_TRANSFORMS.length); + + let plugins = compileOptions({ strictMode: true }).plugins.ast; + + for (let i = 0; i < STRICT_MODE_TRANSFORMS.length; i++) { + let plugin = STRICT_MODE_TRANSFORMS[i]; assert.ok(plugins.indexOf(plugin) > -1, `includes ${plugin}`); } } diff --git a/yarn.lock b/yarn.lock index 979ae5125af..306490c572f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1657,187 +1657,187 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" -"@glimmer/compiler@0.70.0": - version "0.70.0" - resolved "https://registry.yarnpkg.com/@glimmer/compiler/-/compiler-0.70.0.tgz#ded74455db50bf1a0b5ef36428ab619fcf88d32a" - integrity sha512-rSuLbqr128lwbNl8lPrfc6lJCPiCA36yGEQq9cqIydAjSolrcdxHploM01InA5f4Sh4rPxl+M22HnYU1irna0A== - dependencies: - "@glimmer/interfaces" "0.70.0" - "@glimmer/syntax" "0.70.0" - "@glimmer/util" "0.70.0" - "@glimmer/wire-format" "0.70.0" +"@glimmer/compiler@0.71.1": + version "0.71.1" + resolved "https://registry.yarnpkg.com/@glimmer/compiler/-/compiler-0.71.1.tgz#9404db2743102b23778d2d2f6a451fc1bb858e29" + integrity sha512-SnRjlAfOCeijHufJMuHQ2mtat5GX71NCOswVoHRkiL9BiU2qmUBwqyiUmSIw25XE9ub27ya3BpZNEkXalRyR1g== + dependencies: + "@glimmer/interfaces" "0.71.1" + "@glimmer/syntax" "0.71.1" + "@glimmer/util" "0.71.1" + "@glimmer/wire-format" "0.71.1" "@simple-dom/interface" "^1.4.0" -"@glimmer/destroyable@0.70.0": - version "0.70.0" - resolved "https://registry.yarnpkg.com/@glimmer/destroyable/-/destroyable-0.70.0.tgz#767c5de933a0dc9d4a41199443d88e0adb2d1a9f" - integrity sha512-A2ndHW9bFkGz4JJNG9kgWw1qXXrCTiIeUawDp0eatnSvRSePn4gggtsOWRuqU+zdNXpWUSH8VyvmJGByEYrDYw== +"@glimmer/destroyable@0.71.1": + version "0.71.1" + resolved "https://registry.yarnpkg.com/@glimmer/destroyable/-/destroyable-0.71.1.tgz#8dc70b3126abfae2a55d4d3d613e2eb1817241f0" + integrity sha512-IQkEYsP7Bn5ibkVfufTLZIqs/txKqMUxYY120m+TQC8/1ZxzQd7SW1UyUSYJ/wgk0j2FuUPqRc1nuyS1MrpbQQ== dependencies: "@glimmer/env" "0.1.7" - "@glimmer/global-context" "0.70.0" - "@glimmer/interfaces" "0.70.0" - "@glimmer/util" "0.70.0" + "@glimmer/global-context" "0.71.1" + "@glimmer/interfaces" "0.71.1" + "@glimmer/util" "0.71.1" -"@glimmer/encoder@0.70.0": - version "0.70.0" - resolved "https://registry.yarnpkg.com/@glimmer/encoder/-/encoder-0.70.0.tgz#156d01f5d41afdc63418891466da8cf5a7b4b420" - integrity sha512-iOjvfdJWCbnrQb9ymCgUcnzB/cDVY5mVXM0zqi89D/AI0jYWUQzqIOPd6UJiWZPJv5OfiD1yQP17+hnnoeQQsg== +"@glimmer/encoder@0.71.1": + version "0.71.1" + resolved "https://registry.yarnpkg.com/@glimmer/encoder/-/encoder-0.71.1.tgz#b48ff5e6830ab5ac4d9f9b4a0dae18493701b6df" + integrity sha512-GacjjgpxmKFClTXdIJWYufXGifTww2fYoqj7nwLCJUauA3vw0QEtojaiRwqPoq4CFbqfCQ0TH9kPp3T2BVambQ== dependencies: "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.70.0" - "@glimmer/vm" "0.70.0" + "@glimmer/interfaces" "0.71.1" + "@glimmer/vm" "0.71.1" "@glimmer/env@0.1.7", "@glimmer/env@^0.1.7": version "0.1.7" resolved "https://registry.yarnpkg.com/@glimmer/env/-/env-0.1.7.tgz#fd2d2b55a9029c6b37a6c935e8c8871ae70dfa07" integrity sha1-/S0rVakCnGs3psk16MiHGucN+gc= -"@glimmer/global-context@0.70.0": - version "0.70.0" - resolved "https://registry.yarnpkg.com/@glimmer/global-context/-/global-context-0.70.0.tgz#1212b34a92955107458ffe03976175ed6a2f7a37" - integrity sha512-uszWyrUI8AntyfMJFQc41CbsbNV3byiz2sknvQh2XE9vDEI1tKmSPp8Gcvuq3xZwV1Ou0eE2ZwXAM9bGJniYsA== +"@glimmer/global-context@0.71.1": + version "0.71.1" + resolved "https://registry.yarnpkg.com/@glimmer/global-context/-/global-context-0.71.1.tgz#95fd8716e0310bf23df3a5f922418f69fcf0b7a8" + integrity sha512-reIeczp/TvCPM9KaCXdQG+eGZwvQ/FuINe6yNNb1XtxFyAI9oPt6G5OYFd+2ZPpe4GDmoeI4d2hJedpV/4L9SQ== dependencies: "@glimmer/env" "^0.1.7" -"@glimmer/interfaces@0.70.0": - version "0.70.0" - resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.70.0.tgz#1a5782a12ebca787e55930db2ec310ffc23d5c9c" - integrity sha512-HT3Yv97f353LW2TuEJnBhyg5Ebt9Mbp0s7uedb5mOJQbUxhGG24yy0HjOHUV+HRI0yCQPZO/q7ojJgX3MAknQg== +"@glimmer/interfaces@0.71.1": + version "0.71.1" + resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.71.1.tgz#97f7d08fcae102724ab8a6db643ec5c2ac767383" + integrity sha512-7rQMdPUBvrqpr7V/0T+JScTCPL1cMUGswhNa9agdmWz7MKlj+5tVfcNF8l0Ur3ykqC+sYuTHhXCt6ij+T6dClQ== dependencies: "@simple-dom/interface" "^1.4.0" -"@glimmer/low-level@0.70.0": - version "0.70.0" - resolved "https://registry.yarnpkg.com/@glimmer/low-level/-/low-level-0.70.0.tgz#b086435edf2a88c2fb37d835afb970d896ed73e2" - integrity sha512-w8BEjOowKAg//pBrQppcPgX0uRD2E03QXcLH4nttznsqpQVt0TzqMf3ilNZkcKU5tAp2HjxY+RPGrTauZmiFhw== +"@glimmer/low-level@0.71.1": + version "0.71.1" + resolved "https://registry.yarnpkg.com/@glimmer/low-level/-/low-level-0.71.1.tgz#ce557e61df88f5525a6da0aebfb3d6df780b449f" + integrity sha512-hnxHQEXXeu/seRHrGmwIdUfUyk/q+zLzgcYNw968qm87aOvo5gc4G4Hx9AZNV0vg7rnD4ZE/wo0zJid3igrTbA== -"@glimmer/manager@0.70.0": - version "0.70.0" - resolved "https://registry.yarnpkg.com/@glimmer/manager/-/manager-0.70.0.tgz#b113974f54c74df55e700dac5dd205317c92b605" - integrity sha512-bJJVPXecCISaVi9cRS9DHRHO2Ly1UzPJQ8UjU7uuTamY5X/JCt4GTL9jXSRB0lV4NQCc80RIcDFam3NnlPkz+w== +"@glimmer/manager@0.71.1": + version "0.71.1" + resolved "https://registry.yarnpkg.com/@glimmer/manager/-/manager-0.71.1.tgz#76f51efe8517de4506380b639add4bd1d2ec1900" + integrity sha512-0ggU6ao703VmXIgKmWTvY4XI+MUKmSsqE8TgkGH/30gy+GAfdk2EGreV+NlZMuJbSYL9QaG6BAiGv81OJ9gsHA== dependencies: - "@glimmer/destroyable" "0.70.0" + "@glimmer/destroyable" "0.71.1" "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.70.0" - "@glimmer/reference" "0.70.0" - "@glimmer/util" "0.70.0" - "@glimmer/validator" "0.70.0" - -"@glimmer/node@0.70.0": - version "0.70.0" - resolved "https://registry.yarnpkg.com/@glimmer/node/-/node-0.70.0.tgz#8e7a879733e6d5e02148e10b5599b64c0261a8f2" - integrity sha512-2lV9WQJOGiq8bFAyKb52fsyt+iu7KMgShu5vnpKGQXZGR66Gsn5Re5tiy0YnIFYxklZCvkQeJDuDiYx+GhS2aw== - dependencies: - "@glimmer/interfaces" "0.70.0" - "@glimmer/runtime" "0.70.0" - "@glimmer/util" "0.70.0" + "@glimmer/interfaces" "0.71.1" + "@glimmer/reference" "0.71.1" + "@glimmer/util" "0.71.1" + "@glimmer/validator" "0.71.1" + +"@glimmer/node@0.71.1": + version "0.71.1" + resolved "https://registry.yarnpkg.com/@glimmer/node/-/node-0.71.1.tgz#aad61512254a24e8737f36251d3f7b53a4e8d0cb" + integrity sha512-Ksb70sOgB+VBRz6sO3dcGx+awWtgP7W+qOyXonoMVUA5ZmRom0QSTPQnrdV46DFtzdv+QZXS3vHTmXhAwOzeLw== + dependencies: + "@glimmer/interfaces" "0.71.1" + "@glimmer/runtime" "0.71.1" + "@glimmer/util" "0.71.1" "@simple-dom/document" "^1.4.0" "@simple-dom/interface" "^1.4.0" -"@glimmer/opcode-compiler@0.70.0": - version "0.70.0" - resolved "https://registry.yarnpkg.com/@glimmer/opcode-compiler/-/opcode-compiler-0.70.0.tgz#532ce4c31b1cce1715259287c791ad087699d39f" - integrity sha512-cRtsR9aTl5+1ctzGoz8oMUufkmWjkZEuQWJJgJVmv7fJGK+63XcVjA2utySoQp3cm/c5g99hWzLdsHZyQPLAFQ== +"@glimmer/opcode-compiler@0.71.1": + version "0.71.1" + resolved "https://registry.yarnpkg.com/@glimmer/opcode-compiler/-/opcode-compiler-0.71.1.tgz#b61a109b17f1ffb62cab3c7fad3513ebac3d76c8" + integrity sha512-xnNDdnklzud5FrQKctUq8W95amF+AX/3ZIyYxzmXF9V+iCncM6QDb97AcgERWGbIKcFpqvsg9fe0tjPgJyBwow== dependencies: - "@glimmer/encoder" "0.70.0" + "@glimmer/encoder" "0.71.1" "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.70.0" - "@glimmer/reference" "0.70.0" - "@glimmer/util" "0.70.0" - "@glimmer/vm" "0.70.0" - "@glimmer/wire-format" "0.70.0" + "@glimmer/interfaces" "0.71.1" + "@glimmer/reference" "0.71.1" + "@glimmer/util" "0.71.1" + "@glimmer/vm" "0.71.1" + "@glimmer/wire-format" "0.71.1" -"@glimmer/owner@0.70.0": - version "0.70.0" - resolved "https://registry.yarnpkg.com/@glimmer/owner/-/owner-0.70.0.tgz#9746c91e1f5e552a099629a9552ea888e2de3d5f" - integrity sha512-i54xmibwBLg0zC5rN4EkXnCv3Ny7zGZzOlUmUyi15WxPkSy9V9d8ZsyO5ORhsg79KTHnhM/DKalWDjyBEwNPYA== +"@glimmer/owner@0.71.1": + version "0.71.1" + resolved "https://registry.yarnpkg.com/@glimmer/owner/-/owner-0.71.1.tgz#6ad6a4a9c11002d71b8d4d9d630a28280c52ce7f" + integrity sha512-wBkK++p2UgZjV6tX5ECKddf7V2uU6i/gJfSPiKAwWe/anT37bhCa6+KJxF3mQaJIIHXSX5ue0JrOPIr4tTHc0Q== dependencies: - "@glimmer/util" "0.70.0" + "@glimmer/util" "0.71.1" -"@glimmer/program@0.70.0": - version "0.70.0" - resolved "https://registry.yarnpkg.com/@glimmer/program/-/program-0.70.0.tgz#3282f5caa420487a13d5296c5c392da4227beb37" - integrity sha512-NkXKIiqX1oB6VV87GpiWJBbX2t58ra+oyABf2NrL67vui4rMC0VZWpwH7U6OzAMnW8kjjz9z02+ER9L9I5bduA== +"@glimmer/program@0.71.1": + version "0.71.1" + resolved "https://registry.yarnpkg.com/@glimmer/program/-/program-0.71.1.tgz#2eca5b6d1d853a918db92d1635835c22d435736b" + integrity sha512-RQA0PwwkEFRWp48g3AQLg2vmgSu+88pwxX4uE+00qI7I6Rr3wu65S0W48EiVtSKYzT/FdGRGoXMUVlCcWW40Hw== dependencies: - "@glimmer/encoder" "0.70.0" + "@glimmer/encoder" "0.71.1" "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.70.0" - "@glimmer/manager" "0.70.0" - "@glimmer/opcode-compiler" "0.70.0" - "@glimmer/util" "0.70.0" + "@glimmer/interfaces" "0.71.1" + "@glimmer/manager" "0.71.1" + "@glimmer/opcode-compiler" "0.71.1" + "@glimmer/util" "0.71.1" -"@glimmer/reference@0.70.0": - version "0.70.0" - resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.70.0.tgz#2031e8bf0c3281e7d457fc52b151b66449822cf6" - integrity sha512-GcyUw/KeIChdzj2z6zf3jFhl0J6gBhHd1wNbcCClR9a3ufQl6GJ7rtV2JFoc9AGEQMWytYfeFVrggerP39POFg== +"@glimmer/reference@0.71.1": + version "0.71.1" + resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.71.1.tgz#496ecacd3b80ff0c44b0b17c08a1285c32c40a52" + integrity sha512-9E15EgzG3ZK05Jg4w6lR0xSCKrEGcYyCKwE2Lf9/CanOpairH7gqRmwqWSaTSGVqxsm2CUSDs7u9xgJ+KF1Pww== dependencies: "@glimmer/env" "^0.1.7" - "@glimmer/global-context" "0.70.0" - "@glimmer/interfaces" "0.70.0" - "@glimmer/util" "0.70.0" - "@glimmer/validator" "0.70.0" + "@glimmer/global-context" "0.71.1" + "@glimmer/interfaces" "0.71.1" + "@glimmer/util" "0.71.1" + "@glimmer/validator" "0.71.1" -"@glimmer/runtime@0.70.0": - version "0.70.0" - resolved "https://registry.yarnpkg.com/@glimmer/runtime/-/runtime-0.70.0.tgz#254ce45f84a165c9c0b0fa6b571f401a730edc69" - integrity sha512-9Um3E82gsTE6ozcSqQ6BoVwEaGRya5zwuE9zMSDrN2GxYTIRhlG4Ox89s4wO5izcXWd3PmrFPCBQDsO0iz7NYQ== +"@glimmer/runtime@0.71.1": + version "0.71.1" + resolved "https://registry.yarnpkg.com/@glimmer/runtime/-/runtime-0.71.1.tgz#9166965b1eda5632d9379b1ae2d475463d77c106" + integrity sha512-MDC+8K/Mg5t3eIhsmkP3FHKPFtxPWU6cJXpeFuZTbJge/+KxUCUJC+pA4Lfuyqo6U0whrOAczZbrHI6JFuNxnw== dependencies: - "@glimmer/destroyable" "0.70.0" + "@glimmer/destroyable" "0.71.1" "@glimmer/env" "0.1.7" - "@glimmer/global-context" "0.70.0" - "@glimmer/interfaces" "0.70.0" - "@glimmer/low-level" "0.70.0" - "@glimmer/owner" "0.70.0" - "@glimmer/program" "0.70.0" - "@glimmer/reference" "0.70.0" - "@glimmer/util" "0.70.0" - "@glimmer/validator" "0.70.0" - "@glimmer/vm" "0.70.0" - "@glimmer/wire-format" "0.70.0" + "@glimmer/global-context" "0.71.1" + "@glimmer/interfaces" "0.71.1" + "@glimmer/low-level" "0.71.1" + "@glimmer/owner" "0.71.1" + "@glimmer/program" "0.71.1" + "@glimmer/reference" "0.71.1" + "@glimmer/util" "0.71.1" + "@glimmer/validator" "0.71.1" + "@glimmer/vm" "0.71.1" + "@glimmer/wire-format" "0.71.1" "@simple-dom/interface" "^1.4.0" -"@glimmer/syntax@0.70.0": - version "0.70.0" - resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.70.0.tgz#3b10023b84a02af7bf0ba4f3308946a5a932e603" - integrity sha512-1SFC2hbSfeV2IUwS2tMFljYCdZCq/CC+hw1S2boHWHG7I4yq3NdSQeYytLDB5yOuWAFE4ZGc4XRRntWjDRgGuQ== +"@glimmer/syntax@0.71.1": + version "0.71.1" + resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.71.1.tgz#1ec478ca4d014669a5e82c8a15e88ab491d6024c" + integrity sha512-etDJPRS2IS4RwtyoFZGG7BRsMLfXZ/9YjjZOwRqeuLxmWhI5DoEqlCVSU1GiIljG0PPZwXZUeN38OTr4vag65Q== dependencies: - "@glimmer/interfaces" "0.70.0" - "@glimmer/util" "0.70.0" + "@glimmer/interfaces" "0.71.1" + "@glimmer/util" "0.71.1" "@handlebars/parser" "^2.0.0" simple-html-tokenizer "^0.5.10" -"@glimmer/util@0.70.0": - version "0.70.0" - resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.70.0.tgz#55cac3330cecb19a12fae21de918f49fe46d9f8b" - integrity sha512-h16boov87CGlXgu9c2O2XBx4xDMu/fEAHJh3YGUnfyPB/Tqebf4K9wUVKl5yl8AzhBeRT0+n/+vvyQhcl8vEmg== +"@glimmer/util@0.71.1": + version "0.71.1" + resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.71.1.tgz#ea071269d5b32c3762890f2a3fd46f3259c68857" + integrity sha512-gYI8XmPqYO4FFn/MBcnIJ/EpcigpHfXN8F4YWB4VsqHRfZlM6bIsFx1LNrt5gXcStY2tbDnEN6LxJhSbnPf4RA== dependencies: "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.70.0" + "@glimmer/interfaces" "0.71.1" "@simple-dom/interface" "^1.4.0" -"@glimmer/validator@0.70.0": - version "0.70.0" - resolved "https://registry.yarnpkg.com/@glimmer/validator/-/validator-0.70.0.tgz#21279efb0f07a9bd8493d2c03c168951da6af8ea" - integrity sha512-DcQwH3mjHMMqID9j7wKtRAeL1oVm+X1VAFE+RGQuRXzUxbLzYEPFDYE1XnXsbMG96KM+SJoF9yAuqzojprqNpw== +"@glimmer/validator@0.71.1": + version "0.71.1" + resolved "https://registry.yarnpkg.com/@glimmer/validator/-/validator-0.71.1.tgz#fc7840aa266d39dd23b655f4eaaecaf59f8b3bec" + integrity sha512-Z6UcCoHeJTPmzFYpDn2W4+AlthPI+pffmjyaeVDVexieLhRodJNQu+8Wj6aCvEGezR4pHe3er9bdoDWH4HFKzA== dependencies: "@glimmer/env" "^0.1.7" - "@glimmer/global-context" "0.70.0" + "@glimmer/global-context" "0.71.1" -"@glimmer/vm@0.70.0": - version "0.70.0" - resolved "https://registry.yarnpkg.com/@glimmer/vm/-/vm-0.70.0.tgz#344abe18e290c3b10f68013baf7b232ec3e4a0b7" - integrity sha512-c21anP1sBKExaLoIYPLn1BAJBjkXb9wrw9EaIjEzQLh6REn2aGbFiVmYjH0bP0i23n7ilc9fZTw/IyF0AqSjew== +"@glimmer/vm@0.71.1": + version "0.71.1" + resolved "https://registry.yarnpkg.com/@glimmer/vm/-/vm-0.71.1.tgz#024f8471f300f26e75627bedb2a1dfb09f1e979f" + integrity sha512-3kBbyXi54x68xUgiFecBY6LwDYLnYx8jMWoq17hJGliIU+QMK2EVChwuCDxeOcG3Vqm4jI2H/kcWZIup58xnBQ== dependencies: - "@glimmer/interfaces" "0.70.0" - "@glimmer/util" "0.70.0" + "@glimmer/interfaces" "0.71.1" + "@glimmer/util" "0.71.1" -"@glimmer/wire-format@0.70.0": - version "0.70.0" - resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.70.0.tgz#e261b9bb866cf32f355697968954424ff095ae3a" - integrity sha512-gRjq5cNHrilj/Bqb778+4LWhvOYyaI1UH6A0COgYBMXYiY1XHDKNPG26QZ/uc3OUtG8lTST2R1h071oScOf2Hw== +"@glimmer/wire-format@0.71.1": + version "0.71.1" + resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.71.1.tgz#e9ab892b218873e206ddecafb0f6ad5548665f1c" + integrity sha512-BiugiphqQSz7l2/t7tfw8lX9pTG4y0qZk3w3ZCmghPF1J5iF5PSjx2LEeX2i5gkOt06gTCqKjAtMkO7GHnh8ag== dependencies: - "@glimmer/interfaces" "0.70.0" - "@glimmer/util" "0.70.0" + "@glimmer/interfaces" "0.71.1" + "@glimmer/util" "0.71.1" "@handlebars/parser@^2.0.0": version "2.0.0"