From 666ae33ef189880fcf27c4d16dddb060cda35294 Mon Sep 17 00:00:00 2001 From: Katie Gengler Date: Mon, 3 May 2021 11:56:33 -0400 Subject: [PATCH 01/61] Disable non-enabled feature --- packages/@ember/canary-features/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@ember/canary-features/index.ts b/packages/@ember/canary-features/index.ts index c6afc535d6f..ce88fefdfbf 100644 --- a/packages/@ember/canary-features/index.ts +++ b/packages/@ember/canary-features/index.ts @@ -13,8 +13,8 @@ import { assign } from '@ember/polyfills'; */ export const DEFAULT_FEATURES = { - EMBER_LIBRARIES_ISREGISTERED: null, - EMBER_IMPROVED_INSTRUMENTATION: null, + EMBER_LIBRARIES_ISREGISTERED: false, + EMBER_IMPROVED_INSTRUMENTATION: false, EMBER_NAMED_BLOCKS: true, EMBER_GLIMMER_HELPER_MANAGER: true, EMBER_GLIMMER_INVOKE_HELPER: true, From 916e1041d8ed38f4dc8cff0a7a9b3b4013659c6c Mon Sep 17 00:00:00 2001 From: Katie Gengler Date: Mon, 3 May 2021 12:10:30 -0400 Subject: [PATCH 02/61] Add v3.28.0-beta.1 to CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5016e52bc63..1072ab38dd4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Ember Changelog +### v3.28.0-beta.1 (May 3, 2021) + +- [#19472](https://github.com/emberjs/ember.js/pull/19472) [BUGFIX] Prevent transformation of block params called `attrs` + ### v3.27.0 (May 3, 2021) - [#19309](https://github.com/emberjs/ember.js/pull/19309) / [#19487](https://github.com/emberjs/ember.js/pull/19487) / [#19474](https://github.com/emberjs/ember.js/pull/19474) [FEATURE] Enable `(helper` and `(modifier` helpers per [RFC #432](https://github.com/emberjs/rfcs/blob/master/text/0432-contextual-helpers.md). From 68fccf95ea7fbe2d0728bfd6c9a2190ff9c4554f Mon Sep 17 00:00:00 2001 From: Katie Gengler Date: Mon, 3 May 2021 12:11:07 -0400 Subject: [PATCH 03/61] Release v3.28.0-beta.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ea3fd977765..a2cc94b6acc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ember-source", - "version": "3.28.0-alpha.1", + "version": "3.28.0-beta.1", "description": "A JavaScript framework for creating ambitious web applications", "keywords": [ "ember-addon" From 173b8040be7952148c3919f1cafd543a8dac1b46 Mon Sep 17 00:00:00 2001 From: Chris Garrett Date: Tue, 11 May 2021 15:44:13 -0700 Subject: [PATCH 04/61] [BUGFIX release] Ensure ember-testing is loaded lazily The recently modules API update means we are now loading real modules, not polyfills based on the global. This means that the modules themselves are _eagerly required_, rather than being references to a value on the global. For example, previously, this: ```js import { registerWaiter } from '@ember/test'; if (someCondition) { registerWaiter(() => {}); } ``` Would become this: ```js if (someCondition) { Ember.Test.registerWaiter(() => {}); } ``` In either example, `registerWaiter` may or may not be called based on the state of `someCondition`. However, in the second case, if `Ember.Test` is not defined at all, it's completely ok as long as `someCondition` is `false`. It's never called, so we never get an error telling us `Ember.Test` is undefined. Without the transform, the module is eagerly required, along with all of its dependencies. If no one included `ember-testing`, then that means it will throw an error immediately. This PR makes the `@ember/test` module load `ember-testing` lazily, and if it's not available (e.g. in a production environment) it replaces the values with a function that throws a helpful error. --- packages/@ember/test/index.js | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/packages/@ember/test/index.js b/packages/@ember/test/index.js index 2c5d3ae272d..3f226dbcac6 100644 --- a/packages/@ember/test/index.js +++ b/packages/@ember/test/index.js @@ -1,11 +1,27 @@ -import { Test } from 'ember-testing'; +import require, { has } from 'require'; -const { - registerAsyncHelper, - registerHelper, - registerWaiter, - unregisterHelper, - unregisterWaiter, -} = Test; +export let registerAsyncHelper; +export let registerHelper; +export let registerWaiter; +export let unregisterHelper; +export let unregisterWaiter; -export { registerAsyncHelper, registerHelper, registerWaiter, unregisterHelper, unregisterWaiter }; +if (has('ember-testing')) { + let { Test } = require('ember-testing'); + + registerAsyncHelper = Test.registerAsyncHelper; + registerHelper = Test.registerHelper; + registerWaiter = Test.registerWaiter; + unregisterHelper = Test.unregisterHelper; + unregisterWaiter = Test.unregisterWaiter; +} else { + let testingNotAvailableMessage = () => { + throw new Error('Attempted to use test utilities, but `ember-testing` was not included'); + }; + + registerAsyncHelper = testingNotAvailableMessage; + registerHelper = testingNotAvailableMessage; + registerWaiter = testingNotAvailableMessage; + unregisterHelper = testingNotAvailableMessage; + unregisterWaiter = testingNotAvailableMessage; +} From 713a4c264c3a2e2b4631a31f6e1dbaf8e4649eb5 Mon Sep 17 00:00:00 2001 From: Godfrey Chan Date: Tue, 11 May 2021 16:38:13 -0700 Subject: [PATCH 05/61] [BUGFIX release] 3.27 deprecation metadata * Unify deprecation ids * Add missing `url` and `since` * Correctly reference `@ember/legacy-built-in-components` addon * Error instead for `` --- .../glimmer/lib/components/-link-to.ts | 10 +++- .../glimmer/lib/components/-textarea.ts | 10 +++- .../glimmer/lib/components/checkbox.ts | 10 +++- .../glimmer/lib/components/internal.ts | 24 +++++++-- .../glimmer/lib/components/link-to.ts | 54 ++++++++++++++++--- .../glimmer/lib/components/text-field.ts | 10 +++- .../-internals/glimmer/lib/environment.ts | 1 + .../link-to/rendering-angle-test.js | 14 +++++ .../link-to/rendering-curly-test.js | 14 +++++ .../lib/mixins/target_action_support.js | 5 +- .../views/lib/mixins/text_support.js | 5 +- packages/@ember/component/checkbox.ts | 9 ++-- packages/@ember/component/text-area.ts | 9 ++-- packages/@ember/component/text-field.ts | 9 ++-- packages/@ember/routing/link-component.ts | 9 ++-- packages/ember/index.js | 11 ++-- packages/ember/tests/reexports_test.js | 2 +- 17 files changed, 163 insertions(+), 43 deletions(-) diff --git a/packages/@ember/-internals/glimmer/lib/components/-link-to.ts b/packages/@ember/-internals/glimmer/lib/components/-link-to.ts index 2ae57b6e124..642eeb64605 100644 --- a/packages/@ember/-internals/glimmer/lib/components/-link-to.ts +++ b/packages/@ember/-internals/glimmer/lib/components/-link-to.ts @@ -1035,8 +1035,11 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) { { id: 'ember.built-in-components.reopen', for: 'ember-source', - since: {}, + since: { + enabled: '3.27.0', + }, until: '4.0.0', + url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-reopen', } ); @@ -1060,8 +1063,11 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) { { id: 'ember.built-in-components.reopen', for: 'ember-source', - since: {}, + since: { + enabled: '3.27.0', + }, until: '4.0.0', + url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-reopen', } ); diff --git a/packages/@ember/-internals/glimmer/lib/components/-textarea.ts b/packages/@ember/-internals/glimmer/lib/components/-textarea.ts index 00473ea09b7..95aa097bc1c 100644 --- a/packages/@ember/-internals/glimmer/lib/components/-textarea.ts +++ b/packages/@ember/-internals/glimmer/lib/components/-textarea.ts @@ -62,8 +62,11 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) { { id: 'ember.built-in-components.reopen', for: 'ember-source', - since: {}, + since: { + enabled: '3.27.0', + }, until: '4.0.0', + url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-reopen', } ); @@ -87,8 +90,11 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) { { id: 'ember.built-in-components.reopen', for: 'ember-source', - since: {}, + since: { + enabled: '3.27.0', + }, until: '4.0.0', + url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-reopen', } ); diff --git a/packages/@ember/-internals/glimmer/lib/components/checkbox.ts b/packages/@ember/-internals/glimmer/lib/components/checkbox.ts index 31d42f17da2..d9a39d50e49 100644 --- a/packages/@ember/-internals/glimmer/lib/components/checkbox.ts +++ b/packages/@ember/-internals/glimmer/lib/components/checkbox.ts @@ -181,8 +181,11 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) { { id: 'ember.built-in-components.reopen', for: 'ember-source', - since: {}, + since: { + enabled: '3.27.0', + }, until: '4.0.0', + url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-reopen', } ); @@ -206,8 +209,11 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) { { id: 'ember.built-in-components.reopen', for: 'ember-source', - since: {}, + since: { + enabled: '3.27.0', + }, until: '4.0.0', + url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-reopen', } ); diff --git a/packages/@ember/-internals/glimmer/lib/components/internal.ts b/packages/@ember/-internals/glimmer/lib/components/internal.ts index 1942dbe344f..393b4380aa8 100644 --- a/packages/@ember/-internals/glimmer/lib/components/internal.ts +++ b/packages/@ember/-internals/glimmer/lib/components/internal.ts @@ -274,8 +274,12 @@ export function handleDeprecatedArguments(target: DeprecatingInternalComponentCo deprecate(`Passing the \`@${name}\` argument to <${angle}> is deprecated.`, false, { id: 'ember.built-in-components.legacy-arguments', for: 'ember-source', - since: {}, + since: { + enabled: '3.27.0', + }, until: '4.0.0', + url: + 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-legacy-arguments', }); this.modernized = false; @@ -356,8 +360,12 @@ export function handleDeprecatedAttributeArguments( { id: 'ember.built-in-components.legacy-attribute-arguments', for: 'ember-source', - since: {}, + since: { + enabled: '3.27.0', + }, until: '4.0.0', + url: + 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-legacy-attribute-arguments', } ); @@ -517,8 +525,12 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) { { id: 'ember.built-in-components.legacy-attribute-arguments', for: 'ember-source', - since: {}, + since: { + enabled: '3.27.0', + }, until: '4.0.0', + url: + 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-legacy-attribute-arguments', } ); @@ -530,8 +542,12 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) { { id: 'ember.built-in-components.legacy-attribute-arguments', for: 'ember-source', - since: {}, + since: { + enabled: '3.27.0', + }, until: '4.0.0', + url: + 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-legacy-attribute-arguments', } ); diff --git a/packages/@ember/-internals/glimmer/lib/components/link-to.ts b/packages/@ember/-internals/glimmer/lib/components/link-to.ts index 32b69ea997b..40ee661d959 100644 --- a/packages/@ember/-internals/glimmer/lib/components/link-to.ts +++ b/packages/@ember/-internals/glimmer/lib/components/link-to.ts @@ -393,7 +393,6 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) { ['role', 'ariaRole'], // LinkTo - 'href', 'title', 'rel', 'tabindex', @@ -402,6 +401,23 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) { handleDeprecatedEventArguments(LinkTo); + // @href + { + let superOnUnsupportedArgument = prototype['onUnsupportedArgument']; + + Object.defineProperty(prototype, 'onUnsupportedArgument', { + configurable: true, + enumerable: false, + value: function onUnsupportedArgument(this: LinkTo, name: string): void { + if (name === 'href') { + assert(`Passing the \`@href\` argument to is not supported.`); + } else { + superOnUnsupportedArgument.call(this, name); + } + }, + }); + } + // @tagName { let superOnUnsupportedArgument = prototype['onUnsupportedArgument']; @@ -454,8 +470,12 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) { { id: 'ember.built-in-components.legacy-arguments', for: 'ember-source', - since: {}, + since: { + enabled: '3.27.0', + }, until: '4.0.0', + url: + 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-legacy-arguments', } ); @@ -472,8 +492,12 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) { { id: 'ember.built-in-components.legacy-arguments', for: 'ember-source', - since: {}, + since: { + enabled: '3.27.0', + }, until: '4.0.0', + url: + 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-legacy-arguments', } ); @@ -505,8 +529,12 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) { { id: 'ember.built-in-components.legacy-arguments', for: 'ember-source', - since: {}, + since: { + enabled: '3.27.0', + }, until: '4.0.0', + url: + 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-legacy-arguments', } ); } else { @@ -519,8 +547,12 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) { { id: 'ember.built-in-components.legacy-arguments', for: 'ember-source', - since: {}, + since: { + enabled: '3.27.0', + }, until: '4.0.0', + url: + 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-legacy-arguments', } ); @@ -540,8 +572,12 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) { { id: 'ember.built-in-components.legacy-arguments', for: 'ember-source', - since: {}, + since: { + enabled: '3.27.0', + }, until: '4.0.0', + url: + 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-legacy-arguments', } ); @@ -556,8 +592,12 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) { { id: 'ember.built-in-components.legacy-arguments', for: 'ember-source', - since: {}, + since: { + enabled: '3.27.0', + }, until: '4.0.0', + url: + 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-legacy-arguments', } ); } diff --git a/packages/@ember/-internals/glimmer/lib/components/text-field.ts b/packages/@ember/-internals/glimmer/lib/components/text-field.ts index 1db0db7bf3f..a83a0f1c4b5 100644 --- a/packages/@ember/-internals/glimmer/lib/components/text-field.ts +++ b/packages/@ember/-internals/glimmer/lib/components/text-field.ts @@ -225,8 +225,11 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) { { id: 'ember.built-in-components.reopen', for: 'ember-source', - since: {}, + since: { + enabled: '3.27.0', + }, until: '4.0.0', + url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-reopen', } ); @@ -250,8 +253,11 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) { { id: 'ember.built-in-components.reopen', for: 'ember-source', - since: {}, + since: { + enabled: '3.27.0', + }, until: '4.0.0', + url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-reopen', } ); diff --git a/packages/@ember/-internals/glimmer/lib/environment.ts b/packages/@ember/-internals/glimmer/lib/environment.ts index 847642050f0..75f2b5b281c 100644 --- a/packages/@ember/-internals/glimmer/lib/environment.ts +++ b/packages/@ember/-internals/glimmer/lib/environment.ts @@ -118,6 +118,7 @@ const VM_DEPRECATION_OVERRIDES: (DeprecationOptions & { }, { id: 'argument-less-helper-paren-less-invocation', + url: 'https://deprecations.emberjs.com/v3.x#toc_argument-less-helper-paren-less-invocation', until: '4.0.0', for: 'ember-source', since: { diff --git a/packages/@ember/-internals/glimmer/tests/integration/components/link-to/rendering-angle-test.js b/packages/@ember/-internals/glimmer/tests/integration/components/link-to/rendering-angle-test.js index 3932e4c573a..3c555705a1c 100644 --- a/packages/@ember/-internals/glimmer/tests/integration/components/link-to/rendering-angle-test.js +++ b/packages/@ember/-internals/glimmer/tests/integration/components/link-to/rendering-angle-test.js @@ -9,6 +9,7 @@ import { Router, Route } from '@ember/-internals/routing'; import Controller from '@ember/controller'; import { set } from '@ember/-internals/metal'; import { LinkComponent } from '@ember/-internals/glimmer'; +import { DEBUG } from '@glimmer/env'; moduleFor( ' component (rendering tests)', @@ -22,6 +23,19 @@ moduleFor( ); } + async [`@test it throws a useful error if you pass the href argument`](assert) { + this.addTemplate('application', `Index`); + + if (DEBUG) { + await assert.rejects( + this.visit('/'), + /Passing the `@href` argument to is not supported\./ + ); + } else { + assert.expect(0); + } + } + async ['@test it should be able to be inserted in DOM when the router is not present']() { this.addTemplate('application', `Go to Index`); diff --git a/packages/@ember/-internals/glimmer/tests/integration/components/link-to/rendering-curly-test.js b/packages/@ember/-internals/glimmer/tests/integration/components/link-to/rendering-curly-test.js index 7115e81ec21..b934154d7ba 100644 --- a/packages/@ember/-internals/glimmer/tests/integration/components/link-to/rendering-curly-test.js +++ b/packages/@ember/-internals/glimmer/tests/integration/components/link-to/rendering-curly-test.js @@ -3,6 +3,7 @@ import { moduleFor, ApplicationTestCase, RenderingTestCase, runTask } from 'inte import Controller from '@ember/controller'; import { set } from '@ember/-internals/metal'; import { LinkComponent } from '@ember/-internals/glimmer'; +import { DEBUG } from '@glimmer/env'; moduleFor( '{{link-to}} component (rendering tests)', @@ -15,6 +16,19 @@ moduleFor( }, /You must provide one or more parameters to the `{{link-to}}` component\. \('my-app\/templates\/application\.hbs' @ L1:C0\)/); } + async [`@test it throws a useful error if you pass the href argument`](assert) { + this.addTemplate('application', `{{#link-to href="nope" route="index"}}Index{{/link-to}}`); + + if (DEBUG) { + await assert.rejects( + this.visit('/'), + /Passing the `@href` argument to is not supported\./ + ); + } else { + assert.expect(0); + } + } + async ['@test it should be able to be inserted in DOM when the router is not present']() { this.addTemplate('application', `{{#link-to route='index'}}Go to Index{{/link-to}}`); diff --git a/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js b/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js index 6c46433fa6c..b0d4bde399b 100644 --- a/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +++ b/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js @@ -170,8 +170,11 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) { deprecate('Reopening Ember.TargetActionSupport is deprecated.', false, { id: 'ember.built-in-components.reopen', for: 'ember-source', - since: {}, + since: { + enabled: '3.27.0', + }, until: '4.0.0', + url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-reopen', }); TargetActionSupport._wasReopened = true; diff --git a/packages/@ember/-internals/views/lib/mixins/text_support.js b/packages/@ember/-internals/views/lib/mixins/text_support.js index e7e8b197a17..08c5fed43e4 100644 --- a/packages/@ember/-internals/views/lib/mixins/text_support.js +++ b/packages/@ember/-internals/views/lib/mixins/text_support.js @@ -365,8 +365,11 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) { deprecate('Reopening Ember.TextSupport is deprecated.', false, { id: 'ember.built-in-components.reopen', for: 'ember-source', - since: {}, + since: { + enabled: '3.27.0', + }, until: '4.0.0', + url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-reopen', }); TextSupport._wasReopened = true; diff --git a/packages/@ember/component/checkbox.ts b/packages/@ember/component/checkbox.ts index 374d4fb53cb..28788824d26 100644 --- a/packages/@ember/component/checkbox.ts +++ b/packages/@ember/component/checkbox.ts @@ -4,16 +4,17 @@ import { deprecate } from '@ember/debug'; if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) { deprecate( `Using Ember.Checkbox or importing from 'Checkbox' has been deprecated, install the ` + - `\`ember-legacy-built-in-components\` addon and use \`import { Checkbox } from ` + - `'ember-legacy-built-in-components';\` instead`, + `\`@ember/legacy-built-in-components\` addon and use \`import { Checkbox } from ` + + `'@ember/legacy-built-in-components';\` instead`, false, { - id: 'ember.legacy-built-in-components', + id: 'ember.built-in-components.import', until: '4.0.0', for: 'ember-source', since: { - // TODO: update this when enabling the feature + enabled: '3.27.0', }, + url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-import', } ); } diff --git a/packages/@ember/component/text-area.ts b/packages/@ember/component/text-area.ts index 10aaf051c0a..930a55ee198 100644 --- a/packages/@ember/component/text-area.ts +++ b/packages/@ember/component/text-area.ts @@ -4,16 +4,17 @@ import { deprecate } from '@ember/debug'; if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) { deprecate( `Using Ember.TextArea or importing from 'TextArea' has been deprecated, install the ` + - `\`ember-legacy-built-in-components\` addon and use \`import { TextArea } from ` + - `'ember-legacy-built-in-components';\` instead`, + `\`@ember/legacy-built-in-components\` addon and use \`import { TextArea } from ` + + `'@ember/legacy-built-in-components';\` instead`, false, { - id: 'ember.legacy-built-in-components', + id: 'ember.built-in-components.import', until: '4.0.0', for: 'ember-source', since: { - // TODO: update this when enabling the feature + enabled: '3.27.0', }, + url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-import', } ); } diff --git a/packages/@ember/component/text-field.ts b/packages/@ember/component/text-field.ts index 119f91bb2b3..77f3d6cdf3b 100644 --- a/packages/@ember/component/text-field.ts +++ b/packages/@ember/component/text-field.ts @@ -4,16 +4,17 @@ import { deprecate } from '@ember/debug'; if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) { deprecate( `Using Ember.TextField or importing from 'TextField' has been deprecated, install the ` + - `\`ember-legacy-built-in-components\` addon and use \`import { TextField } from ` + - `'ember-legacy-built-in-components';\` instead`, + `\`@ember/legacy-built-in-components\` addon and use \`import { TextField } from ` + + `'@ember/legacy-built-in-components';\` instead`, false, { - id: 'ember.legacy-built-in-components', + id: 'ember.built-in-components.import', until: '4.0.0', for: 'ember-source', since: { - // TODO: update this when enabling the feature + enabled: '3.27.0', }, + url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-import', } ); } diff --git a/packages/@ember/routing/link-component.ts b/packages/@ember/routing/link-component.ts index e419425d424..8c3e4f86a60 100644 --- a/packages/@ember/routing/link-component.ts +++ b/packages/@ember/routing/link-component.ts @@ -4,16 +4,17 @@ import { deprecate } from '@ember/debug'; if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) { deprecate( `Using Ember.LinkComponent or importing from 'LinkComponent' has been deprecated, install the ` + - `\`ember-legacy-built-in-components\` addon and use \`import { LinkComponent } from ` + - `'ember-legacy-built-in-components';\` instead`, + `\`@ember/legacy-built-in-components\` addon and use \`import { LinkComponent } from ` + + `'@ember/legacy-built-in-components';\` instead`, false, { - id: 'ember.legacy-built-in-components', + id: 'ember.built-in-components.import', until: '4.0.0', for: 'ember-source', since: { - // TODO: update this when enabling the feature + enabled: '3.27.0', }, + url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-import', } ); } diff --git a/packages/ember/index.js b/packages/ember/index.js index 43543fdb462..f9cd9a39659 100644 --- a/packages/ember/index.js +++ b/packages/ember/index.js @@ -513,17 +513,18 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) { if (availableInLegacyAddon) { message += - ` Install the \`ember-legacy-built-in-components\` addon and use ` + - `\`import { ${name} } from 'ember-legacy-built-in-components';\` instead.`; + ` Install the \`@ember/legacy-built-in-components\` addon and use ` + + `\`import { ${name} } from '@ember/legacy-built-in-components';\` instead.`; } deprecate(message, false, { - id: 'ember.built-in-components.legacy-import', + id: 'ember.built-in-components.import', until: '4.0.0', for: 'ember-source', since: { - // TODO: update this when enabling the feature + enabled: '3.27.0', }, + url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-import', }); return value; @@ -533,7 +534,7 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) { enumerable: true, }); - // Expose a non-deprecated version for tests and the ember-legacy-built-in-components addon + // Expose a non-deprecated version for tests and the @ember/legacy-built-in-components addon Ember[`_Legacy${name}`] = value; }); } else { diff --git a/packages/ember/tests/reexports_test.js b/packages/ember/tests/reexports_test.js index b5e131eff1d..4bccf517f6b 100644 --- a/packages/ember/tests/reexports_test.js +++ b/packages/ember/tests/reexports_test.js @@ -66,7 +66,7 @@ moduleFor( ), publicPath === null ? `Using Ember.${name} is deprecated.` - : `Using Ember.${name} or importing from '${publicPath}' is deprecated. Install the \`ember-legacy-built-in-components\` addon and use \`import { ${name} } from 'ember-legacy-built-in-components';\` instead.` + : `Using Ember.${name} or importing from '${publicPath}' is deprecated. Install the \`@ember/legacy-built-in-components\` addon and use \`import { ${name} } from '@ember/legacy-built-in-components';\` instead.` ); } catch (error) { assert.pushResult({ From d79f94f0d5a08629a8ee6d1620e005be4d26a53e Mon Sep 17 00:00:00 2001 From: Godfrey Chan Date: Wed, 12 May 2021 00:59:00 -0700 Subject: [PATCH 06/61] [CLEANUP] Deprecations URL consistency https://emberjs.com/deprecations/* is a redirect for https://deprecations.emberjs.com/* --- lib/index.js | 2 +- packages/@ember/-internals/console/index.js | 2 +- packages/@ember/-internals/glimmer/lib/component.ts | 6 +++--- .../-internals/glimmer/lib/components/abstract-input.ts | 4 ++-- .../@ember/-internals/glimmer/lib/modifiers/action.ts | 2 +- packages/@ember/-internals/glimmer/lib/utils/managers.ts | 6 +++--- packages/@ember/-internals/metal/lib/computed.ts | 6 +++--- packages/@ember/-internals/metal/lib/mixin.ts | 2 +- packages/@ember/-internals/routing/lib/system/route.ts | 4 ++-- packages/@ember/-internals/routing/lib/system/router.ts | 8 ++++---- packages/@ember/-internals/runtime/lib/copy.js | 2 +- .../@ember/-internals/views/lib/mixins/action_support.js | 2 +- .../@ember/-internals/views/lib/mixins/text_support.js | 2 +- .../@ember/-internals/views/lib/mixins/view_support.js | 2 +- .../views/lib/system/jquery_event_deprecation.js | 2 +- packages/@ember/-internals/views/lib/system/utils.ts | 2 +- packages/@ember/polyfills/lib/merge.ts | 2 +- .../lib/plugins/deprecate-send-action.ts | 6 +++--- .../lib/plugins/transform-has-block-syntax.ts | 2 +- packages/ember/index.js | 4 ++-- 20 files changed, 34 insertions(+), 34 deletions(-) diff --git a/lib/index.js b/lib/index.js index 6be64ec350e..7b209f811b4 100644 --- a/lib/index.js +++ b/lib/index.js @@ -281,7 +281,7 @@ module.exports = { if (targets.includes('ie 11')) { this.ui.writeWarnLine( - 'Internet Explorer 11 is listed in your compilation targets, but it will no longer be supported in the next major version of Ember. Please update your targets to remove IE 11 and include new targets that are within the updated support policy. For details on the new browser support policy, see:\n\n - The official documentation: http://emberjs.com/browser-support\n - the deprecation guide: https://emberjs.com/deprecations/v3.x#toc_3-0-browser-support-policy\n' + 'Internet Explorer 11 is listed in your compilation targets, but it will no longer be supported in the next major version of Ember. Please update your targets to remove IE 11 and include new targets that are within the updated support policy. For details on the new browser support policy, see:\n\n - The official documentation: http://emberjs.com/browser-support\n - the deprecation guide: https://deprecations.emberjs.com/v3.x#toc_3-0-browser-support-policy\n' ); } diff --git a/packages/@ember/-internals/console/index.js b/packages/@ember/-internals/console/index.js index 41b97ec62c5..38bda85f0aa 100644 --- a/packages/@ember/-internals/console/index.js +++ b/packages/@ember/-internals/console/index.js @@ -6,7 +6,7 @@ import { LOGGER } from '@ember/deprecated-features'; const DEPRECATION_MESSAGE = 'Use of Ember.Logger is deprecated. Please use `console` for logging.'; const DEPRECATION_ID = 'ember-console.deprecate-logger'; const DEPRECATION_URL = - 'https://emberjs.com/deprecations/v3.x#toc_use-console-rather-than-ember-logger'; + 'https://deprecations.emberjs.com/v3.x#toc_use-console-rather-than-ember-logger'; /** @module ember */ diff --git a/packages/@ember/-internals/glimmer/lib/component.ts b/packages/@ember/-internals/glimmer/lib/component.ts index 369b69a94ab..c5ffd019de8 100644 --- a/packages/@ember/-internals/glimmer/lib/component.ts +++ b/packages/@ember/-internals/glimmer/lib/component.ts @@ -687,7 +687,7 @@ const Component = CoreView.extend( { id: 'ember-views.event-dispatcher.mouseenter-leave-move', until: '4.0.0', - url: 'https://emberjs.com/deprecations/v3.x#toc_component-mouseenter-leave-move', + url: 'https://deprecations.emberjs.com/v3.x#toc_component-mouseenter-leave-move', for: 'ember-source', since: { enabled: '3.13.0-beta.1', @@ -700,7 +700,7 @@ const Component = CoreView.extend( { id: 'ember-views.event-dispatcher.mouseenter-leave-move', until: '4.0.0', - url: 'https://emberjs.com/deprecations/v3.x#toc_component-mouseenter-leave-move', + url: 'https://deprecations.emberjs.com/v3.x#toc_component-mouseenter-leave-move', for: 'ember-source', since: { enabled: '3.13.0-beta.1', @@ -713,7 +713,7 @@ const Component = CoreView.extend( { id: 'ember-views.event-dispatcher.mouseenter-leave-move', until: '4.0.0', - url: 'https://emberjs.com/deprecations/v3.x#toc_component-mouseenter-leave-move', + url: 'https://deprecations.emberjs.com/v3.x#toc_component-mouseenter-leave-move', for: 'ember-source', since: { enabled: '3.13.0-beta.1', diff --git a/packages/@ember/-internals/glimmer/lib/components/abstract-input.ts b/packages/@ember/-internals/glimmer/lib/components/abstract-input.ts index 13096945949..f459d5fb704 100644 --- a/packages/@ember/-internals/glimmer/lib/components/abstract-input.ts +++ b/packages/@ember/-internals/glimmer/lib/components/abstract-input.ts @@ -239,7 +239,7 @@ export function handleDeprecatedFeatures( for: 'ember-source', since: {}, until: '4.0.0', - url: 'https://emberjs.com/deprecations/v3.x#toc_ember-component-send-action', + url: 'https://deprecations.emberjs.com/v3.x#toc_ember-component-send-action', } ); @@ -270,7 +270,7 @@ export function handleDeprecatedFeatures( for: 'ember-source', since: {}, until: '4.0.0', - url: 'https://emberjs.com/deprecations/v3.x#toc_ember-component-send-action', + url: 'https://deprecations.emberjs.com/v3.x#toc_ember-component-send-action', } ); diff --git a/packages/@ember/-internals/glimmer/lib/modifiers/action.ts b/packages/@ember/-internals/glimmer/lib/modifiers/action.ts index f3678a76b96..99d516c26af 100644 --- a/packages/@ember/-internals/glimmer/lib/modifiers/action.ts +++ b/packages/@ember/-internals/glimmer/lib/modifiers/action.ts @@ -223,7 +223,7 @@ class ActionModifierManager implements InternalModifierManager Date: Thu, 13 May 2021 06:22:24 -0700 Subject: [PATCH 07/61] Release notes for v3.27.1 (cherry picked from commit 8e57edd86d2c6a0171340b316b6c436b53efb7f6) --- CHANGELOG.md | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1072ab38dd4..f567da99d34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ - [#19472](https://github.com/emberjs/ember.js/pull/19472) [BUGFIX] Prevent transformation of block params called `attrs` +### v3.27.1 (May 13, 2021) + +- [#19540](https://github.com/emberjs/ember.js/pull/19540) [BUGFIX] Ensure ember-testing is loaded lazily +- [#19541](https://github.com/emberjs/ember.js/pull/19541) [BUGFIX] Add missing metadata for some deprecations enabled in 3.27.0 +- [#19541](https://github.com/emberjs/ember.js/pull/19541) [BUGFIX] Ensure passing `@href` to `` throws an error +- [#19541](https://github.com/emberjs/ember.js/pull/19541) [CLEANUP] Consistently use https://deprecations.emberjs.com/ in deprecation URLs + ### v3.27.0 (May 3, 2021) - [#19309](https://github.com/emberjs/ember.js/pull/19309) / [#19487](https://github.com/emberjs/ember.js/pull/19487) / [#19474](https://github.com/emberjs/ember.js/pull/19474) [FEATURE] Enable `(helper` and `(modifier` helpers per [RFC #432](https://github.com/emberjs/rfcs/blob/master/text/0432-contextual-helpers.md). @@ -14,7 +21,7 @@ - [#19442](https://github.com/emberjs/ember.js/pull/19442) [DEPRECATION] Add deprecation for `Route#render` method per [RFC #418](https://github.com/emberjs/rfcs/blob/master/text/0418-deprecate-route-render-methods.md). - [#19429](https://github.com/emberjs/ember.js/pull/19429) [DEPRECATION] `registerPlugin` / `unregisterPlugin` and legacy class based AST plugins (private APIs) - [#19499](https://github.com/emberjs/ember.js/pull/19499) [DEPRECATION] Deprecate `@foo={{helper}}` per [RFC #496](https://github.com/emberjs/rfcs/blob/master/text/0496-handlebars-strict-mode.md#3-no-implicit-invocation-of-argument-less-helpers). -- [#19499](https://github.com/emberjs/ember.js/pull/19499) [BUGFIX] Update rendering engine to `@glimmer/*` 0.78.2 for fixes including: +- [#19499](https://github.com/emberjs/ember.js/pull/19499) [BUGFIX] Update rendering engine to `@glimmer/*` 0.78.2 for fixes including: - `<:else>` and `<:inverse>` should be aliases (see https://github.com/glimmerjs/glimmer-vm/pull/1296) - Fix nested calls to helpers in dynamic helpers (see https://github.com/glimmerjs/glimmer-vm/pull/1293) - [#19477](https://github.com/emberjs/ember.js/pull/19477) [BUGFIX] Allow `` to override internal assertion @@ -106,7 +113,7 @@ ### v3.24.0 (December 28, 2020) -- [#19224](https://github.com/emberjs/ember.js/pull/19224) [FEATURE] Add `{{page-title}}` helper to route template blueprints to implement [RFC #0654](https://github.com/emberjs/rfcs/blob/master/text/0645-add-ember-page-title-addon.md). +- [#19224](https://github.com/emberjs/ember.js/pull/19224) [FEATURE] Add `{{page-title}}` helper to route template blueprints to implement [RFC #0654](https://github.com/emberjs/rfcs/blob/master/text/0645-add-ember-page-title-addon.md). - [#19133](https://github.com/emberjs/ember.js/pull/19133) [FEATURE / DEPRECATION] Add new options to `deprecate()` for `for` and `since` and deprecate using `deprecate()` without those options per the [Deprecation Staging RFC](https://github.com/emberjs/rfcs/blob/master/text/0649-deprecation-staging.md). - [#19211](https://github.com/emberjs/ember.js/pull/19211) [DEPRECATION] Deprecate `Ember.String.loc` and `{{loc}}` per the [Deprecate Ember String RFC](https://github.com/emberjs/rfcs/blob/master/text/0236-deprecation-ember-string.md). - [#19234](https://github.com/emberjs/ember.js/pull/19234) [DEPRECATION] Deprecate String Prototype extensions per the [Deprecate Ember String RFC](https://github.com/emberjs/rfcs/blob/master/text/0236-deprecation-ember-string.md). @@ -130,7 +137,7 @@ - [#19160](https://github.com/emberjs/ember.js/pull/19160) / [#19182](https://github.com/emberjs/ember.js/pull/19182) [FEATURE] Implements the helper manager feature specified in the [Helper Managers RFC](https://github.com/emberjs/rfcs/blob/master/text/0625-helper-managers.md). - [#19171](https://github.com/emberjs/ember.js/pull/19171) / [#19182](https://github.com/emberjs/ember.js/pull/19182) [FEATURE] Implements `invokeHelper` from the [JavaScript Helper Invocation API RFC](https://github.com/emberjs/rfcs/blob/master/text/0626-invoke-helper.md). -- [#19148](https://github.com/emberjs/ember.js/pull/19148) / [#19119](https://github.com/emberjs/ember.js/pull/19119) Update rendering engine to `@glimmer/*` 0.62.1 +- [#19148](https://github.com/emberjs/ember.js/pull/19148) / [#19119](https://github.com/emberjs/ember.js/pull/19119) Update rendering engine to `@glimmer/*` 0.62.1 - [#19122](https://github.com/emberjs/ember.js/pull/19122) [BUGFIX] Prevents dynamic invocations of string values when referenced directly in angle brackets - [#19136](https://github.com/emberjs/ember.js/pull/19136) [BUGFIX] Update router microlib to improve Transition related debugging - [#19173](https://github.com/emberjs/ember.js/pull/19173) [BUGFIX] Enforce usage of `capabilities` generation. @@ -159,7 +166,7 @@ - [#19062](https://github.com/emberjs/ember.js/pull/19062) / [#19068](https://github.com/emberjs/ember.js/pull/19068) [FEATURE] Add @ember/destroyable feature from the [Destroyables RFC](https://github.com/emberjs/rfcs/blob/master/text/0580-destroyables.md). - [#18984](https://github.com/emberjs/ember.js/pull/18984) / [#19067](https://github.com/emberjs/ember.js/pull/19067) [FEATURE] Add low-level Cache API per [Autotracking Memoization RFC](https://github.com/emberjs/rfcs/blob/master/text/0615-autotracking-memoization.md) - [#19086](https://github.com/emberjs/ember.js/pull/19086) [FEATURE] Pass transition object to activate/deactivate hooks and events -- [#19094](https://github.com/emberjs/ember.js/pull/19094) [BUGFIX] Fix RouterService#isActive() to work with tracking +- [#19094](https://github.com/emberjs/ember.js/pull/19094) [BUGFIX] Fix RouterService#isActive() to work with tracking - [#19163](https://github.com/emberjs/ember.js/pull/19163) [BUGFIX] Use args proxy for modifier managers. - [#19170](https://github.com/emberjs/ember.js/pull/19170) [BUGFIX] Make modifier manager 3.22 accept the resolved value directly. - [#19124](https://github.com/emberjs/ember.js/pull/19124) [BUGFIX] Fix rendering engine usage within a `fastboot` sandbox @@ -182,7 +189,7 @@ - [#18993](https://github.com/emberjs/ember.js/pull/18993) [DEPRECATION] Deprecate `getWithDefault` per [RFC #554](https://github.com/emberjs/rfcs/blob/master/text/0554-deprecate-getwithdefault.md). - [#19087](https://github.com/emberjs/ember.js/pull/19087) [BUGFIX] Generated initializer tests no longer causes a deprecation warning -- [#17571](https://github.com/emberjs/ember.js/pull/17571) [BUGFIX] Avoid tampering `queryParam` argument in RouterService#isActive +- [#17571](https://github.com/emberjs/ember.js/pull/17571) [BUGFIX] Avoid tampering `queryParam` argument in RouterService#isActive ### v3.20.6 (November 11, 2020) @@ -240,7 +247,7 @@ - Fix: Rerender an `{{#each`s block only when the specific item has changed - [#18958](https://github.com/emberjs/ember.js/pull/18958) [BUGFIX] Ensure AST transforms using `in-element` work properly. - [#18960](https://github.com/emberjs/ember.js/pull/18960) [BUGFIX] More assertions for Application lifecycle methods -- [#18919](https://github.com/emberjs/ember.js/pull/18919) [BUGFIX] Add error for modifier manager without capabilities. +- [#18919](https://github.com/emberjs/ember.js/pull/18919) [BUGFIX] Add error for modifier manager without capabilities. - [#18828](https://github.com/emberjs/ember.js/pull/18828) [BUGFIX] Prepend 'TODO: ' to 'Replace this with your real tests' comments in generated tests - [#18353](https://github.com/emberjs/ember.js/pull/18353) [BUGFIX] Improve `fn` & `on` undefined callback message - [#18824](https://github.com/emberjs/ember.js/pull/18824) [CLEANUP] Remove deprecated private `window.ENV` From 87b43a1273f6a534a32f82fa263ca0e58f9ffe0f Mon Sep 17 00:00:00 2001 From: Chris Garrett Date: Tue, 27 Apr 2021 13:41:39 -0700 Subject: [PATCH 08/61] [BUGFIX] Makes the (hash) helper lazy Makes the hash helper's individual keys lazy so that they do not eagerly incur costs. (cherry picked from commit 7d334cf5d50270ef51a8dcd0f858ab4b2ef298bd) --- package.json | 26 +- .../-internals/glimmer/lib/syntax/outlet.ts | 21 +- yarn.lock | 252 +++++++++--------- 3 files changed, 159 insertions(+), 140 deletions(-) diff --git a/package.json b/package.json index a2cc94b6acc..b09cd2ea000 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "@babel/plugin-transform-block-scoping": "^7.8.3", "@babel/plugin-transform-object-assign": "^7.8.3", "@ember/edition-utils": "^1.2.0", - "@glimmer/vm-babel-plugins": "0.78.2", + "@glimmer/vm-babel-plugins": "0.79.1", "babel-plugin-debug-macros": "^0.3.3", "babel-plugin-filter-imports": "^4.0.0", "broccoli-concat": "^4.2.4", @@ -75,19 +75,19 @@ }, "devDependencies": { "@babel/preset-env": "^7.9.5", - "@glimmer/compiler": "0.78.2", - "@glimmer/destroyable": "0.78.2", + "@glimmer/compiler": "0.79.1", + "@glimmer/destroyable": "0.79.1", "@glimmer/env": "^0.1.7", - "@glimmer/global-context": "0.78.2", - "@glimmer/interfaces": "0.78.2", - "@glimmer/manager": "0.78.2", - "@glimmer/node": "0.78.2", - "@glimmer/opcode-compiler": "0.78.2", - "@glimmer/owner": "0.78.2", - "@glimmer/program": "0.78.2", - "@glimmer/reference": "0.78.2", - "@glimmer/runtime": "0.78.2", - "@glimmer/validator": "0.78.2", + "@glimmer/global-context": "0.79.1", + "@glimmer/interfaces": "0.79.1", + "@glimmer/manager": "0.79.1", + "@glimmer/node": "0.79.1", + "@glimmer/opcode-compiler": "0.79.1", + "@glimmer/owner": "0.79.1", + "@glimmer/program": "0.79.1", + "@glimmer/reference": "0.79.1", + "@glimmer/runtime": "0.79.1", + "@glimmer/validator": "0.79.1", "@simple-dom/document": "^1.4.0", "@types/qunit": "^2.11.1", "@types/rsvp": "^4.0.3", diff --git a/packages/@ember/-internals/glimmer/lib/syntax/outlet.ts b/packages/@ember/-internals/glimmer/lib/syntax/outlet.ts index d5050b03a3a..166fde44465 100644 --- a/packages/@ember/-internals/glimmer/lib/syntax/outlet.ts +++ b/packages/@ember/-internals/glimmer/lib/syntax/outlet.ts @@ -98,7 +98,26 @@ export const outletHelper = internalHelper( if (state !== null) { let named = dict(); - named.model = childRefFromParts(outletRef, ['render', 'model']); + + // Create a ref for the model + let modelRef = childRefFromParts(outletRef, ['render', 'model']); + + // Store the value of the model + let model = valueForRef(modelRef); + + // Create a compute ref which we pass in as the `{{@model}}` reference + // for the outlet. This ref will update and return the value of the + // model _until_ the outlet itself changes. Once the outlet changes, + // dynamic scope also changes, and so the original model ref would not + // provide the correct updated value. So we stop updating and return + // the _last_ model value for that outlet. + named.model = createComputeRef(() => { + if (lastState === state) { + model = valueForRef(modelRef); + } + + return model; + }); if (DEBUG) { named.model = createDebugAliasRef!('@model', named.model); diff --git a/yarn.lock b/yarn.lock index 7eb6a9d5555..08ecc5cf9bf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1588,52 +1588,52 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" -"@glimmer/compiler@0.78.2": - version "0.78.2" - resolved "https://registry.yarnpkg.com/@glimmer/compiler/-/compiler-0.78.2.tgz#b02d4f1027770446637ffcce41bb5dfc71076c82" - integrity sha512-tI0vkwz4qxsTsOOrbJpXZiOQvDwl5dOyPbeq5Z0Fca1byaAPhxPgq+lvuSny0bDYz+T+NGS0B+9MB4yLMnCl7Q== - dependencies: - "@glimmer/interfaces" "0.78.2" - "@glimmer/syntax" "0.78.2" - "@glimmer/util" "0.78.2" - "@glimmer/wire-format" "0.78.2" +"@glimmer/compiler@0.79.1": + version "0.79.1" + resolved "https://registry.yarnpkg.com/@glimmer/compiler/-/compiler-0.79.1.tgz#b169364387e04fe63f18b1433dbbf4c217d1f379" + integrity sha512-gR6Il358TCwQ/u4Q8Z/i/FqvDT21GesphG3jd6BlKdaCrIxoffX0WJlMLLdq+WwH90D2FXnzESCkBUbi3FC4rA== + dependencies: + "@glimmer/interfaces" "0.79.1" + "@glimmer/syntax" "0.79.1" + "@glimmer/util" "0.79.1" + "@glimmer/wire-format" "0.79.1" "@simple-dom/interface" "^1.4.0" -"@glimmer/destroyable@0.78.2": - version "0.78.2" - resolved "https://registry.yarnpkg.com/@glimmer/destroyable/-/destroyable-0.78.2.tgz#13a3eab3397f25b1a52e7dc3f9f81cf7ceec621c" - integrity sha512-cZ+fXp4PPf9CkDV8GY8A8sd5IJ367uEDk99n0DNBLcypeZU0REb8rCIV/GzJoCUcCnT9FzDXuFGgelp23x2tFw== +"@glimmer/destroyable@0.79.1": + version "0.79.1" + resolved "https://registry.yarnpkg.com/@glimmer/destroyable/-/destroyable-0.79.1.tgz#a5e327fa4fc5a8171ab49db90acc7cc9ec686459" + integrity sha512-t69g/x5BTmNupkGTT053aQWD4HbMAkyJVX+kC7cJv1q8V3FS9FMbyhp0wy7iGhbKRrhQ/YQCTFzn75b7kWsSTQ== dependencies: "@glimmer/env" "0.1.7" - "@glimmer/global-context" "0.78.2" - "@glimmer/interfaces" "0.78.2" - "@glimmer/util" "0.78.2" + "@glimmer/global-context" "0.79.1" + "@glimmer/interfaces" "0.79.1" + "@glimmer/util" "0.79.1" -"@glimmer/encoder@0.78.2": - version "0.78.2" - resolved "https://registry.yarnpkg.com/@glimmer/encoder/-/encoder-0.78.2.tgz#39a4f8223cd7819417909d4a7c86c9e31bb1eef5" - integrity sha512-3V+DYqLf5sY8ehV4qaeACqpy8i1pjP0zGlsxiaFb3LdfIbfuzrNxE1JQGvN/60urqhKqGeeIk+e/Y2879voVbw== +"@glimmer/encoder@0.79.1": + version "0.79.1" + resolved "https://registry.yarnpkg.com/@glimmer/encoder/-/encoder-0.79.1.tgz#be86d96be3eb87ccc2745fb286f7d2dc96f8bbde" + integrity sha512-SKnzRb9/+G12yV+SrQ//jfH2fU5W5M9wwJ0TPjCQR5xYY/FfZlWF4yF89436x4Dby4pvbFipTDmU9V2mLwzkjw== dependencies: "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.78.2" - "@glimmer/vm" "0.78.2" + "@glimmer/interfaces" "0.79.1" + "@glimmer/vm" "0.79.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.78.2": - version "0.78.2" - resolved "https://registry.yarnpkg.com/@glimmer/global-context/-/global-context-0.78.2.tgz#3443b000e8617da39202d5319db881ff59a2f248" - integrity sha512-om0ryTEqER1ZZKD9TLBJlPm/M3z9EwHMR22luufPKZ1la8RrDQpGPMh32a8QzWnOyigiv2NXIfuUiSh5OGR/BA== +"@glimmer/global-context@0.79.1": + version "0.79.1" + resolved "https://registry.yarnpkg.com/@glimmer/global-context/-/global-context-0.79.1.tgz#3d74868a143991f771a7680b72081a04528c292f" + integrity sha512-AtfbeLMgksVZ1Df94e2nUjXs4tqwkGlxsBF4P62rDmXI82KxwFFj9Qa1sqWcUIbK1I3FRrYhGKSKroPCS1wiHg== dependencies: "@glimmer/env" "^0.1.7" -"@glimmer/interfaces@0.78.2": - version "0.78.2" - resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.78.2.tgz#4dafd7f7abaf03f5a9b5d2192205ad007550ca36" - integrity sha512-OM1zJHNioKwd+7PM+mt28Ine9QfZLI7bwDOgB1Y+lHEZ0OdAGu6m351RBrXfQEgDCoVSFPQpOtUpWLP/FU3Utw== +"@glimmer/interfaces@0.79.1": + version "0.79.1" + resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.79.1.tgz#c25bb029450e8666d7a4e09da8669437eee237d1" + integrity sha512-Mz7118uYtHAodvuNPQFzJLwCleBsh1bx/7H5LH6liCE720OOz1PD2hhamMntpetuvgkpX8OnVDp99BB7bH3/Hg== dependencies: "@simple-dom/interface" "^1.4.0" @@ -1642,140 +1642,140 @@ resolved "https://registry.yarnpkg.com/@glimmer/low-level/-/low-level-0.78.2.tgz#bca5f666760ce98345e87c5b3e37096e772cb2de" integrity sha512-0S6TWOOd0fzLLysw1pWZN0TgasaHmYs1Sjz9Til1mTByIXU1S+1rhdyr2veSQPO/aRjPuEQyKXZQHvx23Zax6w== -"@glimmer/manager@0.78.2": - version "0.78.2" - resolved "https://registry.yarnpkg.com/@glimmer/manager/-/manager-0.78.2.tgz#5c1d0fc24225f9546b182cab6d8ea800135bf86b" - integrity sha512-mHTtPJXf7uYVOsHSrLQEcv0nxGj9M2Rmks60hWKxk/pdNwt12FzRElMqyyj1j9lSbUj+LOpt9g+IZYu03w4O8g== +"@glimmer/manager@0.79.1": + version "0.79.1" + resolved "https://registry.yarnpkg.com/@glimmer/manager/-/manager-0.79.1.tgz#fb72af7a731eefaf044e3160e5ec684abd89976d" + integrity sha512-JUaaZ009APgVuqdh6o1+l4j/aAAZ3oBdrwhecee4h64xW0WSi0cWwJ4lri13NI7ko3Ig4+dcTdDYLvfeSHFLBA== dependencies: - "@glimmer/destroyable" "0.78.2" + "@glimmer/destroyable" "0.79.1" "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.78.2" - "@glimmer/reference" "0.78.2" - "@glimmer/util" "0.78.2" - "@glimmer/validator" "0.78.2" - -"@glimmer/node@0.78.2": - version "0.78.2" - resolved "https://registry.yarnpkg.com/@glimmer/node/-/node-0.78.2.tgz#a27bd6d5ef188ea4892bc6953a62fc165a173893" - integrity sha512-e5mc63xbvix6qRwGLWrc5zYi0PSN5bUUlx6SWCxItObht7i7TpkylYo3y4bDZc2LqfkTN8e8dIyPqfF2dZsLsQ== - dependencies: - "@glimmer/interfaces" "0.78.2" - "@glimmer/runtime" "0.78.2" - "@glimmer/util" "0.78.2" + "@glimmer/interfaces" "0.79.1" + "@glimmer/reference" "0.79.1" + "@glimmer/util" "0.79.1" + "@glimmer/validator" "0.79.1" + +"@glimmer/node@0.79.1": + version "0.79.1" + resolved "https://registry.yarnpkg.com/@glimmer/node/-/node-0.79.1.tgz#8b511852bdf710867f282208141092f679ac829e" + integrity sha512-CK+M2HfWZ068+MLFZQBCjPuUTdSO8r7x6F8fPX7Te/Yo8KYKO4eSIzkOTAcpXX1t1xMOMzQyDaLXtnftQhaSaw== + dependencies: + "@glimmer/interfaces" "0.79.1" + "@glimmer/runtime" "0.79.1" + "@glimmer/util" "0.79.1" "@simple-dom/document" "^1.4.0" "@simple-dom/interface" "^1.4.0" -"@glimmer/opcode-compiler@0.78.2": - version "0.78.2" - resolved "https://registry.yarnpkg.com/@glimmer/opcode-compiler/-/opcode-compiler-0.78.2.tgz#c5199fa02a7e36dbe62e4387bf37d54b1f2c33c7" - integrity sha512-WEmeMZMt3nD8jcUlAYLuW6xVB0uOBkyGAUHU7SHcldnfdP3GTilyPO3OzRC9ksEHK/bwtFelrbwu5tpPH1RgvQ== +"@glimmer/opcode-compiler@0.79.1": + version "0.79.1" + resolved "https://registry.yarnpkg.com/@glimmer/opcode-compiler/-/opcode-compiler-0.79.1.tgz#e3f567423ef4a66c52b8fcaf90af94b7db97a8ab" + integrity sha512-hWQucLIPclR/nxnU7KeXvQXE061rJcKcgbBjJeZPp+/Dbo8550coyUBaGSRS/mvNx/MFs16jcCcU7P1f+fiZJg== dependencies: - "@glimmer/encoder" "0.78.2" + "@glimmer/encoder" "0.79.1" "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.78.2" - "@glimmer/reference" "0.78.2" - "@glimmer/util" "0.78.2" - "@glimmer/vm" "0.78.2" - "@glimmer/wire-format" "0.78.2" + "@glimmer/interfaces" "0.79.1" + "@glimmer/reference" "0.79.1" + "@glimmer/util" "0.79.1" + "@glimmer/vm" "0.79.1" + "@glimmer/wire-format" "0.79.1" -"@glimmer/owner@0.78.2": - version "0.78.2" - resolved "https://registry.yarnpkg.com/@glimmer/owner/-/owner-0.78.2.tgz#15e0adf8e2fef7045674e67627fa48d4b8df877e" - integrity sha512-02I4O5kgmQasE5vbmRY/3F6ZshPURAWtZgvCR5+YHgGo+Jt1UBMaLLDtbg8ldPDc5muUmonA3ZXIYmm1F4wTSw== +"@glimmer/owner@0.79.1": + version "0.79.1" + resolved "https://registry.yarnpkg.com/@glimmer/owner/-/owner-0.79.1.tgz#fc0fbca08aef9b20c095e26e90c4d58bd6d8a189" + integrity sha512-nYwkKfATwNXdkMfS9Bgyps/TtCnadmpoka59seQAYV2LuwH8tuJfrme2j6mZXkQ7LMoZZY/JPJ94CiwJLfFGvA== dependencies: - "@glimmer/util" "0.78.2" + "@glimmer/util" "0.79.1" -"@glimmer/program@0.78.2": - version "0.78.2" - resolved "https://registry.yarnpkg.com/@glimmer/program/-/program-0.78.2.tgz#c38f2f55005b3c2e8f1a4825aacc2ffd6891d9a1" - integrity sha512-6ZeCSwqnC0mMzfHwbToTX/LC6HeUm2UMAaMri7WIh9ncNetCfKqBXRdFIKepG7fnWEADuCwE/+r6e2Qq2x3dNQ== +"@glimmer/program@0.79.1": + version "0.79.1" + resolved "https://registry.yarnpkg.com/@glimmer/program/-/program-0.79.1.tgz#e0523b8eea8075a50adc39d26d2fb2a284b71088" + integrity sha512-4cvWEnniwoNbCrv6FZUO/xIU+OORCRv7e7DTLjneXwuQbBqxPWUwEutQRTQNAsojfg34q5++fK9okLxkqtoBkA== dependencies: - "@glimmer/encoder" "0.78.2" + "@glimmer/encoder" "0.79.1" "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.78.2" - "@glimmer/manager" "0.78.2" - "@glimmer/opcode-compiler" "0.78.2" - "@glimmer/util" "0.78.2" + "@glimmer/interfaces" "0.79.1" + "@glimmer/manager" "0.79.1" + "@glimmer/opcode-compiler" "0.79.1" + "@glimmer/util" "0.79.1" -"@glimmer/reference@0.78.2": - version "0.78.2" - resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.78.2.tgz#dbffbeb4bc42f64f57104eebab0eb4ef7778d989" - integrity sha512-vUk20mKknDqtQEWfGbDwU9eh+XVztUUuww6V6/UKm8JokBDjGkdt4w74R2wvPIrDZYkfXErZjXwY8Ltu1lBV0A== +"@glimmer/reference@0.79.1": + version "0.79.1" + resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.79.1.tgz#c3b998a815a9f7ab1a60d8a4d4fbf9c242077a89" + integrity sha512-HNzaQRGjNMk7WKzscPBAvQWsP9C5AtHPXj7t+4Na4tnM3DXc81CSqjinJVaXP/M6n22cADkO1uu6m6P5hGuT0w== dependencies: "@glimmer/env" "^0.1.7" - "@glimmer/global-context" "0.78.2" - "@glimmer/interfaces" "0.78.2" - "@glimmer/util" "0.78.2" - "@glimmer/validator" "0.78.2" + "@glimmer/global-context" "0.79.1" + "@glimmer/interfaces" "0.79.1" + "@glimmer/util" "0.79.1" + "@glimmer/validator" "0.79.1" -"@glimmer/runtime@0.78.2": - version "0.78.2" - resolved "https://registry.yarnpkg.com/@glimmer/runtime/-/runtime-0.78.2.tgz#e8d8de5b1c74f2aeaa129b43d264ff36de4de5a1" - integrity sha512-pzndIFJl2ycVAAnaFNm2MLwDTKymn03a+xAtHpsFwEZQ3EE2wQNnEKyBDI5SkNRShD8nkbwodd0N+YwZdGDKHw== +"@glimmer/runtime@0.79.1": + version "0.79.1" + resolved "https://registry.yarnpkg.com/@glimmer/runtime/-/runtime-0.79.1.tgz#22ef9e676b5724d1a599a9eeaf8fbc152e988e2b" + integrity sha512-6kdPfzWy3SfQrbVjQGuwzY5FRC0//N+VqQW7G/bpgvpHuKuYBzBX74alMOXbokTpDwoVky7GAS6hMxhHPDEeIw== dependencies: - "@glimmer/destroyable" "0.78.2" + "@glimmer/destroyable" "0.79.1" "@glimmer/env" "0.1.7" - "@glimmer/global-context" "0.78.2" - "@glimmer/interfaces" "0.78.2" + "@glimmer/global-context" "0.79.1" + "@glimmer/interfaces" "0.79.1" "@glimmer/low-level" "0.78.2" - "@glimmer/owner" "0.78.2" - "@glimmer/program" "0.78.2" - "@glimmer/reference" "0.78.2" - "@glimmer/util" "0.78.2" - "@glimmer/validator" "0.78.2" - "@glimmer/vm" "0.78.2" - "@glimmer/wire-format" "0.78.2" + "@glimmer/owner" "0.79.1" + "@glimmer/program" "0.79.1" + "@glimmer/reference" "0.79.1" + "@glimmer/util" "0.79.1" + "@glimmer/validator" "0.79.1" + "@glimmer/vm" "0.79.1" + "@glimmer/wire-format" "0.79.1" "@simple-dom/interface" "^1.4.0" -"@glimmer/syntax@0.78.2": - version "0.78.2" - resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.78.2.tgz#3be25df8c7b7564d94d204ac0ab0c9717abe9043" - integrity sha512-B6OgBtUFo+K0sA+72sNQOs//TKJIZdAPUAIQGjZWsfGZGpzlFx3kuouKeK1DCtXxRIktqSDpmXFcPNKd1OqbOw== +"@glimmer/syntax@0.79.1": + version "0.79.1" + resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.79.1.tgz#845f19424705e27f4ef8ab1358057c77da8b4fbc" + integrity sha512-dbdK4un1u2GB2i8n7PUOC+nKS6HQuMxFmpiy/GNL8hIvf6i33nqtdAZ7S4UJx65V7weOqLMwhrzhEN3+901I8g== dependencies: - "@glimmer/interfaces" "0.78.2" - "@glimmer/util" "0.78.2" + "@glimmer/interfaces" "0.79.1" + "@glimmer/util" "0.79.1" "@handlebars/parser" "~2.0.0" simple-html-tokenizer "^0.5.10" -"@glimmer/util@0.78.2": - version "0.78.2" - resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.78.2.tgz#d6e7e363d198ef426858a3958170774b4548cce1" - integrity sha512-SqmlzdtXJwAhf5fhflFsoYuM3zk1M/8bamqGXQpCB5I40NpcshpFybY/ZMwIGsYOWEwIo/LDDC1UBZ3gyMPZzA== +"@glimmer/util@0.79.1": + version "0.79.1" + resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.79.1.tgz#35b74f58712bbfcde973947449aac9b08fa38067" + integrity sha512-NNeTAh9NsqZLiG8to8RJzEDrUkf8h3eVBxVtRC63xOb4Pq5fQFv3B5E51ibv83yPvCyD+y/bMnInB1ep5gneYQ== dependencies: "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.78.2" + "@glimmer/interfaces" "0.79.1" "@simple-dom/interface" "^1.4.0" -"@glimmer/validator@0.78.2": - version "0.78.2" - resolved "https://registry.yarnpkg.com/@glimmer/validator/-/validator-0.78.2.tgz#bc7f3cf376789d1090add73bed599e840697fdc8" - integrity sha512-pzdC9uPaQerOoPEeSV9U/oRbZtgTkL+BryGR8R534mhAFfVlzenAa4aavKZEcnIns73MNN/G1l2iYDmjSH/6Hg== +"@glimmer/validator@0.79.1": + version "0.79.1" + resolved "https://registry.yarnpkg.com/@glimmer/validator/-/validator-0.79.1.tgz#2735fc04c5ddb20c8033282a36c53d76b4ec688b" + integrity sha512-S8DXscr6a9N9rNeEfEfvAAEVTs27tFiy0Zk2xF4scq3hazWWwO9AOq8ERw4tY8Ecj9dkZH3JKZmBKZYTfWR13Q== dependencies: "@glimmer/env" "^0.1.7" - "@glimmer/global-context" "0.78.2" + "@glimmer/global-context" "0.79.1" -"@glimmer/vm-babel-plugins@0.78.2": - version "0.78.2" - resolved "https://registry.yarnpkg.com/@glimmer/vm-babel-plugins/-/vm-babel-plugins-0.78.2.tgz#b530a19f54da385c7099a22cf348e9062d186838" - integrity sha512-GSEf16h6OCtKx7PsSvD21cLXZuVc6swW2rSOAvfLeZco1DEWMRgYTwkCkColydKZcQ3gvwbPBeYwTC2K6tlnjg== +"@glimmer/vm-babel-plugins@0.79.1": + version "0.79.1" + resolved "https://registry.yarnpkg.com/@glimmer/vm-babel-plugins/-/vm-babel-plugins-0.79.1.tgz#dfe40bbc6b32e102e72dc2256f1fc1a4a9eb03b9" + integrity sha512-f6nyuumSpaQKsZsRvafnTGlcrcMA9qzqAGehnEMOsfxZJmGz19+qTlMvc1/JTUjX8YztYnH4RHkiLn93H0H8JA== dependencies: babel-plugin-debug-macros "^0.3.4" -"@glimmer/vm@0.78.2": - version "0.78.2" - resolved "https://registry.yarnpkg.com/@glimmer/vm/-/vm-0.78.2.tgz#525589b4d3556eafea84a2b9c6e7aa72698bf5d6" - integrity sha512-x+0qn1B00i8Gcw3ptqEaGsIECG4M1IdmxtLSIr+Kfga/Da/PPLXJYQx+jk924rVCnad2FzxizhyKRxCqPbU+EA== +"@glimmer/vm@0.79.1": + version "0.79.1" + resolved "https://registry.yarnpkg.com/@glimmer/vm/-/vm-0.79.1.tgz#3d14b5abf5a26bb4803d43b5a10383ebcd3e0363" + integrity sha512-hu617ceRYg93bnzJPFAzn5Zks91GOzpqV235t6Q32Ldk4x0srQfk58KYaS6omPj9IvtQzQQjAAeRaFswyPYrig== dependencies: - "@glimmer/interfaces" "0.78.2" - "@glimmer/util" "0.78.2" + "@glimmer/interfaces" "0.79.1" + "@glimmer/util" "0.79.1" -"@glimmer/wire-format@0.78.2": - version "0.78.2" - resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.78.2.tgz#32686633e66fe674ea39910d48e3db9ba524eadb" - integrity sha512-kd8xP9P7oo+F0EijG3/2YwzUXq/AESxPS2hadjmhu2uMZ+QOzgYbeo1xC2Ig7EkXhf1tdxlmVpCS4rwhCsxzXA== +"@glimmer/wire-format@0.79.1": + version "0.79.1" + resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.79.1.tgz#4cb0a0bca7bb629f30565a0cb738550ad447535d" + integrity sha512-YUBGRaD+4R4yyjp09CdEiGH0o/zOo8ZKWs3iwvAewDJpijW33EjCbNyR6yCAK3tQVSAGiQ354BYht77Z7sDXZg== dependencies: - "@glimmer/interfaces" "0.78.2" - "@glimmer/util" "0.78.2" + "@glimmer/interfaces" "0.79.1" + "@glimmer/util" "0.79.1" "@handlebars/parser@~2.0.0": version "2.0.0" From e50dc6e0b91b33cdb6ba4cdb1912c6a188c7b3ff Mon Sep 17 00:00:00 2001 From: Chris Garrett Date: Wed, 19 May 2021 16:27:03 -0700 Subject: [PATCH 09/61] [BUGFIX release] Make {{hash}} object properties settables Makes all {{hash}} object properties settable, but deprecates setting them. (cherry picked from commit ec4c034f974753cc3c291d2d93ecf1ac469e64ed) --- package.json | 26 +- .../-internals/glimmer/lib/environment.ts | 8 + .../tests/integration/helpers/hash-test.js | 76 +++++- yarn.lock | 252 +++++++++--------- 4 files changed, 222 insertions(+), 140 deletions(-) diff --git a/package.json b/package.json index b09cd2ea000..37900e9a9f5 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "@babel/plugin-transform-block-scoping": "^7.8.3", "@babel/plugin-transform-object-assign": "^7.8.3", "@ember/edition-utils": "^1.2.0", - "@glimmer/vm-babel-plugins": "0.79.1", + "@glimmer/vm-babel-plugins": "0.79.2", "babel-plugin-debug-macros": "^0.3.3", "babel-plugin-filter-imports": "^4.0.0", "broccoli-concat": "^4.2.4", @@ -75,19 +75,19 @@ }, "devDependencies": { "@babel/preset-env": "^7.9.5", - "@glimmer/compiler": "0.79.1", - "@glimmer/destroyable": "0.79.1", + "@glimmer/compiler": "0.79.2", + "@glimmer/destroyable": "0.79.2", "@glimmer/env": "^0.1.7", - "@glimmer/global-context": "0.79.1", - "@glimmer/interfaces": "0.79.1", - "@glimmer/manager": "0.79.1", - "@glimmer/node": "0.79.1", - "@glimmer/opcode-compiler": "0.79.1", - "@glimmer/owner": "0.79.1", - "@glimmer/program": "0.79.1", - "@glimmer/reference": "0.79.1", - "@glimmer/runtime": "0.79.1", - "@glimmer/validator": "0.79.1", + "@glimmer/global-context": "0.79.2", + "@glimmer/interfaces": "0.79.2", + "@glimmer/manager": "0.79.2", + "@glimmer/node": "0.79.2", + "@glimmer/opcode-compiler": "0.79.2", + "@glimmer/owner": "0.79.2", + "@glimmer/program": "0.79.2", + "@glimmer/reference": "0.79.2", + "@glimmer/runtime": "0.79.2", + "@glimmer/validator": "0.79.2", "@simple-dom/document": "^1.4.0", "@types/qunit": "^2.11.1", "@types/rsvp": "^4.0.3", diff --git a/packages/@ember/-internals/glimmer/lib/environment.ts b/packages/@ember/-internals/glimmer/lib/environment.ts index 75f2b5b281c..12a91fcb41d 100644 --- a/packages/@ember/-internals/glimmer/lib/environment.ts +++ b/packages/@ember/-internals/glimmer/lib/environment.ts @@ -125,6 +125,14 @@ const VM_DEPRECATION_OVERRIDES: (DeprecationOptions & { enabled: '3.27.0', }, }, + { + id: 'setting-on-hash', + until: '4.4.0', + for: 'ember-source', + since: { + enabled: '3.28.0', + }, + }, ]; const VM_ASSERTION_OVERRIDES: { id: string; message: string }[] = []; diff --git a/packages/@ember/-internals/glimmer/tests/integration/helpers/hash-test.js b/packages/@ember/-internals/glimmer/tests/integration/helpers/hash-test.js index c827f9694df..3cd67140fd5 100644 --- a/packages/@ember/-internals/glimmer/tests/integration/helpers/hash-test.js +++ b/packages/@ember/-internals/glimmer/tests/integration/helpers/hash-test.js @@ -2,7 +2,8 @@ import { RenderingTestCase, moduleFor, runTask } from 'internal-test-helpers'; import { Component } from '../../utils/helpers'; -import { set } from '@ember/-internals/metal'; +import { set, computed } from '@ember/-internals/metal'; +import { HAS_NATIVE_PROXY } from '@ember/-internals/utils'; moduleFor( 'Helpers test: {{hash}}', @@ -186,5 +187,78 @@ moduleFor( this.assertText('Chad Hietala'); } + + ['@test works with computeds']() { + let FooBarComponent = Component.extend({ + fullName: computed('hash.firstName', 'hash.lastName', function () { + return `${this.hash.firstName} ${this.hash.lastName}`; + }), + }); + + this.registerComponent('foo-bar', { + ComponentClass: FooBarComponent, + template: `{{this.fullName}}`, + }); + + this.render(`{{foo-bar hash=(hash firstName=this.firstName lastName=this.lastName)}}`, { + firstName: 'Chad', + lastName: 'Hietala', + }); + + this.assertText('Chad Hietala'); + + runTask(() => this.rerender()); + + this.assertText('Chad Hietala'); + + runTask(() => { + set(this.context, 'firstName', 'Godfrey'); + set(this.context, 'lastName', 'Chan'); + }); + + this.assertText('Godfrey Chan'); + } + + ['@test works when properties are set dynamically']() { + let fooBarInstance; + let FooBarComponent = Component.extend({ + init() { + this._super(); + fooBarInstance = this; + }, + }); + + this.registerComponent('foo-bar', { + ComponentClass: FooBarComponent, + template: `{{this.hash.firstName}} {{this.hash.lastName}}`, + }); + + this.render(`{{foo-bar hash=(hash firstName=this.firstName)}}`, { + firstName: 'Chad', + }); + + this.assertText('Chad '); + + runTask(() => { + if (HAS_NATIVE_PROXY) { + expectDeprecation(() => { + set(fooBarInstance.hash, 'lastName', 'Hietala'); + }, /You set the '.*' property on a {{hash}} object/); + } else { + set(fooBarInstance.hash, 'lastName', 'Hietala'); + } + }); + + this.assertText('Chad Hietala'); + + runTask(() => { + expectDeprecation(() => { + set(fooBarInstance.hash, 'firstName', 'Godfrey'); + set(fooBarInstance.hash, 'lastName', 'Chan'); + }, /You set the '.*' property on a {{hash}} object/); + }); + + this.assertText('Godfrey Chan'); + } } ); diff --git a/yarn.lock b/yarn.lock index 08ecc5cf9bf..5c8aac9ddee 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1588,52 +1588,52 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" -"@glimmer/compiler@0.79.1": - version "0.79.1" - resolved "https://registry.yarnpkg.com/@glimmer/compiler/-/compiler-0.79.1.tgz#b169364387e04fe63f18b1433dbbf4c217d1f379" - integrity sha512-gR6Il358TCwQ/u4Q8Z/i/FqvDT21GesphG3jd6BlKdaCrIxoffX0WJlMLLdq+WwH90D2FXnzESCkBUbi3FC4rA== - dependencies: - "@glimmer/interfaces" "0.79.1" - "@glimmer/syntax" "0.79.1" - "@glimmer/util" "0.79.1" - "@glimmer/wire-format" "0.79.1" +"@glimmer/compiler@0.79.2": + version "0.79.2" + resolved "https://registry.yarnpkg.com/@glimmer/compiler/-/compiler-0.79.2.tgz#b874e59de7ad3317c6c28dd781dbc8c08a5942b4" + integrity sha512-FbN9/lJyRHOmy4bBPqU/TdiPhN/dSIEJA6Y0dyAu03zuHJqBMd5rtHLm1CRdII9dDwU6T6B09aDlsBBAt8FQcA== + dependencies: + "@glimmer/interfaces" "0.79.2" + "@glimmer/syntax" "0.79.2" + "@glimmer/util" "0.79.2" + "@glimmer/wire-format" "0.79.2" "@simple-dom/interface" "^1.4.0" -"@glimmer/destroyable@0.79.1": - version "0.79.1" - resolved "https://registry.yarnpkg.com/@glimmer/destroyable/-/destroyable-0.79.1.tgz#a5e327fa4fc5a8171ab49db90acc7cc9ec686459" - integrity sha512-t69g/x5BTmNupkGTT053aQWD4HbMAkyJVX+kC7cJv1q8V3FS9FMbyhp0wy7iGhbKRrhQ/YQCTFzn75b7kWsSTQ== +"@glimmer/destroyable@0.79.2": + version "0.79.2" + resolved "https://registry.yarnpkg.com/@glimmer/destroyable/-/destroyable-0.79.2.tgz#50b473483d2d45fb3fa12a28719495af683dd695" + integrity sha512-owBXBWHQuLN5lzbG+3yzupnTGQj6ttPAx0KTCiUBfH0BpE7tKx+w52MA87bt5GJRX+RS0g57Z1DLQy2yLavfFQ== dependencies: "@glimmer/env" "0.1.7" - "@glimmer/global-context" "0.79.1" - "@glimmer/interfaces" "0.79.1" - "@glimmer/util" "0.79.1" + "@glimmer/global-context" "0.79.2" + "@glimmer/interfaces" "0.79.2" + "@glimmer/util" "0.79.2" -"@glimmer/encoder@0.79.1": - version "0.79.1" - resolved "https://registry.yarnpkg.com/@glimmer/encoder/-/encoder-0.79.1.tgz#be86d96be3eb87ccc2745fb286f7d2dc96f8bbde" - integrity sha512-SKnzRb9/+G12yV+SrQ//jfH2fU5W5M9wwJ0TPjCQR5xYY/FfZlWF4yF89436x4Dby4pvbFipTDmU9V2mLwzkjw== +"@glimmer/encoder@0.79.2": + version "0.79.2" + resolved "https://registry.yarnpkg.com/@glimmer/encoder/-/encoder-0.79.2.tgz#e3e3ebc85ba210cffdb4c66dd4bdd2e07d864dad" + integrity sha512-MqFWJ4rGcikk27iUOkHc2vtnC+cVO2XBQHk6m+T5LEkLHFEC0JEDSj+POxHoHnkjXi8BxbxUxxOptz85p0LGWg== dependencies: "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.79.1" - "@glimmer/vm" "0.79.1" + "@glimmer/interfaces" "0.79.2" + "@glimmer/vm" "0.79.2" "@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.79.1": - version "0.79.1" - resolved "https://registry.yarnpkg.com/@glimmer/global-context/-/global-context-0.79.1.tgz#3d74868a143991f771a7680b72081a04528c292f" - integrity sha512-AtfbeLMgksVZ1Df94e2nUjXs4tqwkGlxsBF4P62rDmXI82KxwFFj9Qa1sqWcUIbK1I3FRrYhGKSKroPCS1wiHg== +"@glimmer/global-context@0.79.2": + version "0.79.2" + resolved "https://registry.yarnpkg.com/@glimmer/global-context/-/global-context-0.79.2.tgz#970276f1c7c44d34b4bd619709de78b1f46fabaf" + integrity sha512-Cwna7I28+6amQd+n4/6sc8PccI3cyk/fIWoxzOKBTA0AqJp/HetiE2IvLQI97VCx/Rv338IINzIu4JlfymWnXA== dependencies: "@glimmer/env" "^0.1.7" -"@glimmer/interfaces@0.79.1": - version "0.79.1" - resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.79.1.tgz#c25bb029450e8666d7a4e09da8669437eee237d1" - integrity sha512-Mz7118uYtHAodvuNPQFzJLwCleBsh1bx/7H5LH6liCE720OOz1PD2hhamMntpetuvgkpX8OnVDp99BB7bH3/Hg== +"@glimmer/interfaces@0.79.2": + version "0.79.2" + resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.79.2.tgz#387d11f69ced699e2a227ab9095bd9970829cbf5" + integrity sha512-2+CulmZ5XV3Mq2xG4qYPCcA8LVZq76OixdyLHvkGLEvwFx1J2gixcKK0+KNc0dr+Iia6Ebmu9sntulFCRguMgw== dependencies: "@simple-dom/interface" "^1.4.0" @@ -1642,140 +1642,140 @@ resolved "https://registry.yarnpkg.com/@glimmer/low-level/-/low-level-0.78.2.tgz#bca5f666760ce98345e87c5b3e37096e772cb2de" integrity sha512-0S6TWOOd0fzLLysw1pWZN0TgasaHmYs1Sjz9Til1mTByIXU1S+1rhdyr2veSQPO/aRjPuEQyKXZQHvx23Zax6w== -"@glimmer/manager@0.79.1": - version "0.79.1" - resolved "https://registry.yarnpkg.com/@glimmer/manager/-/manager-0.79.1.tgz#fb72af7a731eefaf044e3160e5ec684abd89976d" - integrity sha512-JUaaZ009APgVuqdh6o1+l4j/aAAZ3oBdrwhecee4h64xW0WSi0cWwJ4lri13NI7ko3Ig4+dcTdDYLvfeSHFLBA== +"@glimmer/manager@0.79.2": + version "0.79.2" + resolved "https://registry.yarnpkg.com/@glimmer/manager/-/manager-0.79.2.tgz#6b5a5d393483522636bc4c4b34604246950b7b08" + integrity sha512-1lzO8Ud7cJWmBaM7lru8dJvtgivzE5mEhkd7LwfLc/UPNNCOHY/fkfypPr0/C2nQLksVLnMB28pDsQThqoGmZQ== dependencies: - "@glimmer/destroyable" "0.79.1" + "@glimmer/destroyable" "0.79.2" "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.79.1" - "@glimmer/reference" "0.79.1" - "@glimmer/util" "0.79.1" - "@glimmer/validator" "0.79.1" - -"@glimmer/node@0.79.1": - version "0.79.1" - resolved "https://registry.yarnpkg.com/@glimmer/node/-/node-0.79.1.tgz#8b511852bdf710867f282208141092f679ac829e" - integrity sha512-CK+M2HfWZ068+MLFZQBCjPuUTdSO8r7x6F8fPX7Te/Yo8KYKO4eSIzkOTAcpXX1t1xMOMzQyDaLXtnftQhaSaw== - dependencies: - "@glimmer/interfaces" "0.79.1" - "@glimmer/runtime" "0.79.1" - "@glimmer/util" "0.79.1" + "@glimmer/interfaces" "0.79.2" + "@glimmer/reference" "0.79.2" + "@glimmer/util" "0.79.2" + "@glimmer/validator" "0.79.2" + +"@glimmer/node@0.79.2": + version "0.79.2" + resolved "https://registry.yarnpkg.com/@glimmer/node/-/node-0.79.2.tgz#7ead836a2ff17273ddd37351c9f6470f17a60f1e" + integrity sha512-2NcWC1PzF/Ru8Xr3h8cuGUumauZMLbyTo24wzJDFCruoMIpizbxcBWGVHuFnH1Cdg8e+fu6eICsCaItVvoJNIw== + dependencies: + "@glimmer/interfaces" "0.79.2" + "@glimmer/runtime" "0.79.2" + "@glimmer/util" "0.79.2" "@simple-dom/document" "^1.4.0" "@simple-dom/interface" "^1.4.0" -"@glimmer/opcode-compiler@0.79.1": - version "0.79.1" - resolved "https://registry.yarnpkg.com/@glimmer/opcode-compiler/-/opcode-compiler-0.79.1.tgz#e3f567423ef4a66c52b8fcaf90af94b7db97a8ab" - integrity sha512-hWQucLIPclR/nxnU7KeXvQXE061rJcKcgbBjJeZPp+/Dbo8550coyUBaGSRS/mvNx/MFs16jcCcU7P1f+fiZJg== +"@glimmer/opcode-compiler@0.79.2": + version "0.79.2" + resolved "https://registry.yarnpkg.com/@glimmer/opcode-compiler/-/opcode-compiler-0.79.2.tgz#997fc9cb559512afc7eb059d80e27ca58009a715" + integrity sha512-sXqzgYfK06ZSHzvVq0ChTx8C/2+A33E3se53wfODXZ88XAGyalTX9U2tHbfKIk3tgOUuMncNfT02NFRDZ/KnmA== dependencies: - "@glimmer/encoder" "0.79.1" + "@glimmer/encoder" "0.79.2" "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.79.1" - "@glimmer/reference" "0.79.1" - "@glimmer/util" "0.79.1" - "@glimmer/vm" "0.79.1" - "@glimmer/wire-format" "0.79.1" + "@glimmer/interfaces" "0.79.2" + "@glimmer/reference" "0.79.2" + "@glimmer/util" "0.79.2" + "@glimmer/vm" "0.79.2" + "@glimmer/wire-format" "0.79.2" -"@glimmer/owner@0.79.1": - version "0.79.1" - resolved "https://registry.yarnpkg.com/@glimmer/owner/-/owner-0.79.1.tgz#fc0fbca08aef9b20c095e26e90c4d58bd6d8a189" - integrity sha512-nYwkKfATwNXdkMfS9Bgyps/TtCnadmpoka59seQAYV2LuwH8tuJfrme2j6mZXkQ7LMoZZY/JPJ94CiwJLfFGvA== +"@glimmer/owner@0.79.2": + version "0.79.2" + resolved "https://registry.yarnpkg.com/@glimmer/owner/-/owner-0.79.2.tgz#562805781e235388a17f15c69ae72e834d680325" + integrity sha512-W5ZejPXyKWeCJF+6+Rv3+mkCJ56eLv+gtesggaVosbXwgL6QnUySjOdvTOwZ++HUYm6WCLognnO+XNzV25oHcQ== dependencies: - "@glimmer/util" "0.79.1" + "@glimmer/util" "0.79.2" -"@glimmer/program@0.79.1": - version "0.79.1" - resolved "https://registry.yarnpkg.com/@glimmer/program/-/program-0.79.1.tgz#e0523b8eea8075a50adc39d26d2fb2a284b71088" - integrity sha512-4cvWEnniwoNbCrv6FZUO/xIU+OORCRv7e7DTLjneXwuQbBqxPWUwEutQRTQNAsojfg34q5++fK9okLxkqtoBkA== +"@glimmer/program@0.79.2": + version "0.79.2" + resolved "https://registry.yarnpkg.com/@glimmer/program/-/program-0.79.2.tgz#755c50144ddc9b8aacf47082347552ec86207217" + integrity sha512-w2xI7Wz7CHx1HS49c6yZToa7XX29vhO+ydWJabMWqoaktvOTBFKZPfwVLIS7mjIe3rwQVose+VIUmbQ1IzwCQg== dependencies: - "@glimmer/encoder" "0.79.1" + "@glimmer/encoder" "0.79.2" "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.79.1" - "@glimmer/manager" "0.79.1" - "@glimmer/opcode-compiler" "0.79.1" - "@glimmer/util" "0.79.1" + "@glimmer/interfaces" "0.79.2" + "@glimmer/manager" "0.79.2" + "@glimmer/opcode-compiler" "0.79.2" + "@glimmer/util" "0.79.2" -"@glimmer/reference@0.79.1": - version "0.79.1" - resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.79.1.tgz#c3b998a815a9f7ab1a60d8a4d4fbf9c242077a89" - integrity sha512-HNzaQRGjNMk7WKzscPBAvQWsP9C5AtHPXj7t+4Na4tnM3DXc81CSqjinJVaXP/M6n22cADkO1uu6m6P5hGuT0w== +"@glimmer/reference@0.79.2": + version "0.79.2" + resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.79.2.tgz#070c16268dc22341aa6ffd30b6dee88cd9cf63d4" + integrity sha512-OobgRrcegj88E8peRHnb1KilCemEK2hF89diUkpnQAO7rOTQknnbyzxO3UgVgm/arEcW4+Ga6T+sirumJ5bKIA== dependencies: "@glimmer/env" "^0.1.7" - "@glimmer/global-context" "0.79.1" - "@glimmer/interfaces" "0.79.1" - "@glimmer/util" "0.79.1" - "@glimmer/validator" "0.79.1" + "@glimmer/global-context" "0.79.2" + "@glimmer/interfaces" "0.79.2" + "@glimmer/util" "0.79.2" + "@glimmer/validator" "0.79.2" -"@glimmer/runtime@0.79.1": - version "0.79.1" - resolved "https://registry.yarnpkg.com/@glimmer/runtime/-/runtime-0.79.1.tgz#22ef9e676b5724d1a599a9eeaf8fbc152e988e2b" - integrity sha512-6kdPfzWy3SfQrbVjQGuwzY5FRC0//N+VqQW7G/bpgvpHuKuYBzBX74alMOXbokTpDwoVky7GAS6hMxhHPDEeIw== +"@glimmer/runtime@0.79.2": + version "0.79.2" + resolved "https://registry.yarnpkg.com/@glimmer/runtime/-/runtime-0.79.2.tgz#93d0285db9d19313a0d477548e4d4af880701bcc" + integrity sha512-FFjDVR1JQaczO+wIRudhCwAeRKUjXB+ZqhOskSEboGbVjSq4v9nxooYVf+np5SEpwPNvlqX6lEW6H7/nfusv0Q== dependencies: - "@glimmer/destroyable" "0.79.1" + "@glimmer/destroyable" "0.79.2" "@glimmer/env" "0.1.7" - "@glimmer/global-context" "0.79.1" - "@glimmer/interfaces" "0.79.1" + "@glimmer/global-context" "0.79.2" + "@glimmer/interfaces" "0.79.2" "@glimmer/low-level" "0.78.2" - "@glimmer/owner" "0.79.1" - "@glimmer/program" "0.79.1" - "@glimmer/reference" "0.79.1" - "@glimmer/util" "0.79.1" - "@glimmer/validator" "0.79.1" - "@glimmer/vm" "0.79.1" - "@glimmer/wire-format" "0.79.1" + "@glimmer/owner" "0.79.2" + "@glimmer/program" "0.79.2" + "@glimmer/reference" "0.79.2" + "@glimmer/util" "0.79.2" + "@glimmer/validator" "0.79.2" + "@glimmer/vm" "0.79.2" + "@glimmer/wire-format" "0.79.2" "@simple-dom/interface" "^1.4.0" -"@glimmer/syntax@0.79.1": - version "0.79.1" - resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.79.1.tgz#845f19424705e27f4ef8ab1358057c77da8b4fbc" - integrity sha512-dbdK4un1u2GB2i8n7PUOC+nKS6HQuMxFmpiy/GNL8hIvf6i33nqtdAZ7S4UJx65V7weOqLMwhrzhEN3+901I8g== +"@glimmer/syntax@0.79.2": + version "0.79.2" + resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.79.2.tgz#fcd6e742860ca39230043969fb04644d5cc6a5c9" + integrity sha512-65ZXxIM38EMKESWgvTU31ouZiQAELRO/LmOfzTJZlYH5LhSAZWSQ7tatYXDrcjPoiDojLO0a16WccZggM1etmg== dependencies: - "@glimmer/interfaces" "0.79.1" - "@glimmer/util" "0.79.1" + "@glimmer/interfaces" "0.79.2" + "@glimmer/util" "0.79.2" "@handlebars/parser" "~2.0.0" simple-html-tokenizer "^0.5.10" -"@glimmer/util@0.79.1": - version "0.79.1" - resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.79.1.tgz#35b74f58712bbfcde973947449aac9b08fa38067" - integrity sha512-NNeTAh9NsqZLiG8to8RJzEDrUkf8h3eVBxVtRC63xOb4Pq5fQFv3B5E51ibv83yPvCyD+y/bMnInB1ep5gneYQ== +"@glimmer/util@0.79.2": + version "0.79.2" + resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.79.2.tgz#7c8e1684f1ad48430b7ed64a2319051b5975ccf9" + integrity sha512-jELDUEoNx0CCHboHFdinQu8W5ye5a7kW6fyR4Pb0zN4PPHKybOjieE6jf5l60R0pBGyqU8W8/S+CeiNgM/AU8g== dependencies: "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.79.1" + "@glimmer/interfaces" "0.79.2" "@simple-dom/interface" "^1.4.0" -"@glimmer/validator@0.79.1": - version "0.79.1" - resolved "https://registry.yarnpkg.com/@glimmer/validator/-/validator-0.79.1.tgz#2735fc04c5ddb20c8033282a36c53d76b4ec688b" - integrity sha512-S8DXscr6a9N9rNeEfEfvAAEVTs27tFiy0Zk2xF4scq3hazWWwO9AOq8ERw4tY8Ecj9dkZH3JKZmBKZYTfWR13Q== +"@glimmer/validator@0.79.2": + version "0.79.2" + resolved "https://registry.yarnpkg.com/@glimmer/validator/-/validator-0.79.2.tgz#b132673925ce79842b4c4ef1ecbf170aa3c0daa7" + integrity sha512-BtSp/izgnhZHPC2onEKa4H+v6ovaq6snwLQcWHPtoenVpn5Y7KbwSy6qSuW5+NaW+XaO3ryvJbZYlDB3dDGuTw== dependencies: "@glimmer/env" "^0.1.7" - "@glimmer/global-context" "0.79.1" + "@glimmer/global-context" "0.79.2" -"@glimmer/vm-babel-plugins@0.79.1": - version "0.79.1" - resolved "https://registry.yarnpkg.com/@glimmer/vm-babel-plugins/-/vm-babel-plugins-0.79.1.tgz#dfe40bbc6b32e102e72dc2256f1fc1a4a9eb03b9" - integrity sha512-f6nyuumSpaQKsZsRvafnTGlcrcMA9qzqAGehnEMOsfxZJmGz19+qTlMvc1/JTUjX8YztYnH4RHkiLn93H0H8JA== +"@glimmer/vm-babel-plugins@0.79.2": + version "0.79.2" + resolved "https://registry.yarnpkg.com/@glimmer/vm-babel-plugins/-/vm-babel-plugins-0.79.2.tgz#8fa4af60c5089977690ee501c7b358c90b8d6bc5" + integrity sha512-c5XQQwM8iogT1mdE/U2+UuGsiFmhP4d53lgXOAq1DQ2/AMFlAXa5djMVETDUlncvLLlo6S3Iaj/FvpqTxwqn2g== dependencies: babel-plugin-debug-macros "^0.3.4" -"@glimmer/vm@0.79.1": - version "0.79.1" - resolved "https://registry.yarnpkg.com/@glimmer/vm/-/vm-0.79.1.tgz#3d14b5abf5a26bb4803d43b5a10383ebcd3e0363" - integrity sha512-hu617ceRYg93bnzJPFAzn5Zks91GOzpqV235t6Q32Ldk4x0srQfk58KYaS6omPj9IvtQzQQjAAeRaFswyPYrig== +"@glimmer/vm@0.79.2": + version "0.79.2" + resolved "https://registry.yarnpkg.com/@glimmer/vm/-/vm-0.79.2.tgz#cbebf74fae0cd413486f7a4ca31715eb8ab9a39d" + integrity sha512-4Bbg7eDLymuV7wiM0GVbIYnQMZxo/Dn+PF1+w5mWUjHqH+ajNKNARJVt3+w+M1tg5Q/nblBVHshNzYwFaugagA== dependencies: - "@glimmer/interfaces" "0.79.1" - "@glimmer/util" "0.79.1" + "@glimmer/interfaces" "0.79.2" + "@glimmer/util" "0.79.2" -"@glimmer/wire-format@0.79.1": - version "0.79.1" - resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.79.1.tgz#4cb0a0bca7bb629f30565a0cb738550ad447535d" - integrity sha512-YUBGRaD+4R4yyjp09CdEiGH0o/zOo8ZKWs3iwvAewDJpijW33EjCbNyR6yCAK3tQVSAGiQ354BYht77Z7sDXZg== +"@glimmer/wire-format@0.79.2": + version "0.79.2" + resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.79.2.tgz#adb88d25752e00f0f9d3f609c1ab458ca2cac932" + integrity sha512-jYiEbRtHGs2auQWOmEEDbT3p9zTqAVUzKkpWzoc9u6fEC8/QfcT3FuLW7S3YjLzauPiIlOQyDVeC5IvhyZag9w== dependencies: - "@glimmer/interfaces" "0.79.1" - "@glimmer/util" "0.79.1" + "@glimmer/interfaces" "0.79.2" + "@glimmer/util" "0.79.2" "@handlebars/parser@~2.0.0": version "2.0.0" From 6eb573c7c9a683d814ffd373b001103774cea4c3 Mon Sep 17 00:00:00 2001 From: The Game Date: Wed, 5 May 2021 12:24:22 +0100 Subject: [PATCH 10/61] [DOC release] fix passing params to named blocks examples (cherry picked from commit e19e975913fc825e69f519acce9f781bcbdc670e) --- .../@ember/-internals/glimmer/lib/glimmer-component-docs.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@ember/-internals/glimmer/lib/glimmer-component-docs.ts b/packages/@ember/-internals/glimmer/lib/glimmer-component-docs.ts index ec4399d774b..5be0786f4ea 100644 --- a/packages/@ember/-internals/glimmer/lib/glimmer-component-docs.ts +++ b/packages/@ember/-internals/glimmer/lib/glimmer-component-docs.ts @@ -163,7 +163,7 @@ You can also pass parameters to named blocks: ```app/templates/components/person-profile.hbs -

{{yield to="title" @person.name}}

+

{{yield @person.name to="title"}}

{{yield @person.signature}} ``` @@ -184,7 +184,7 @@ ```app/templates/components/person-profile.hbs

{{#if (has-block "title")}} - {{yield to="title" @person.name}} + {{yield @person.name to="title"}} {{else}} {{@person.name}} {{/if}} From 3b1d38c2394a28210f035c0f0cbbc8deb5a80997 Mon Sep 17 00:00:00 2001 From: Ilya Radchenko Date: Thu, 6 May 2021 13:31:58 -0400 Subject: [PATCH 11/61] fix computed deprecation import path (cherry picked from commit 692c3b8b13c2a75f52e63ea4c0789050cf9d7284) --- packages/@ember/object/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@ember/object/index.js b/packages/@ember/object/index.js index 9c6bb11faed..f2fe18b27f9 100644 --- a/packages/@ember/object/index.js +++ b/packages/@ember/object/index.js @@ -61,7 +61,7 @@ if (DEBUG) { Object.defineProperty(computed, key, { get() { deprecate( - `Using \`computed.${key}\` has been deprecated. Instead, import the value directly from @ember/object/computed:\n\n import { ${key} } from '@ember/runloop';`, + `Using \`computed.${key}\` has been deprecated. Instead, import the value directly from @ember/object/computed:\n\n import { ${key} } from '@ember/object/computed';`, false, { id: 'deprecated-run-loop-and-computed-dot-access', From 01608b77cb8e6dc57a2040037ebf66842d89d50d Mon Sep 17 00:00:00 2001 From: Jonas Metzener Date: Wed, 12 May 2021 09:37:15 +0200 Subject: [PATCH 12/61] [BUGFIX] pass module prefix to initializer test blueprints (cherry picked from commit c69365b0574a9a16cad18d1ef27669fd11680a4a) --- .../__testType__/__path__/__name__-test.js | 19 ++++++++++++------- .../__testType__/__path__/__name__-test.js | 19 ++++++++++++------- .../fixtures/initializer-test/rfc232.js | 19 ++++++++++++------- .../instance-initializer-test/rfc232.js | 19 ++++++++++++------- 4 files changed, 48 insertions(+), 28 deletions(-) diff --git a/blueprints/initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js b/blueprints/initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js index b5bd4650aee..4fe80c2b1d9 100644 --- a/blueprints/initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js +++ b/blueprints/initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js @@ -1,27 +1,32 @@ import Application from '@ember/application'; +import config from '<%= modulePrefix %>/config/environment'; import { initialize } from '<%= modulePrefix %>/initializers/<%= dasherizedModuleName %>'; import { module, test } from 'qunit'; import Resolver from 'ember-resolver'; <% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop';<% } %> -module('<%= friendlyTestName %>', function(hooks) { - hooks.beforeEach(function() { - this.TestApplication = class TestApplication extends Application {} +module('<%= friendlyTestName %>', function (hooks) { + hooks.beforeEach(function () { + this.TestApplication = class TestApplication extends Application { + modulePrefix = config.modulePrefix; + podModulePrefix = config.podModulePrefix; + Resolver = Resolver; + }; this.TestApplication.initializer({ name: 'initializer under test', - initialize + initialize, }); - this.application = this.TestApplication.create({ autoboot: false, Resolver }); + this.application = this.TestApplication.create({ autoboot: false }); }); - hooks.afterEach(function() { + hooks.afterEach(function () { <% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>run(this.application, 'destroy');<% } %> }); // TODO: Replace this with your real tests. - test('it works', async function(assert) { + test('it works', async function (assert) { await this.application.boot(); assert.ok(true); diff --git a/blueprints/instance-initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js b/blueprints/instance-initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js index 9e09050e437..e200288b65b 100644 --- a/blueprints/instance-initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js +++ b/blueprints/instance-initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js @@ -1,27 +1,32 @@ import Application from '@ember/application'; +import config from '<%= modulePrefix %>/config/environment'; import { initialize } from '<%= modulePrefix %>/instance-initializers/<%= dasherizedModuleName %>'; import { module, test } from 'qunit'; import Resolver from 'ember-resolver'; <% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop';<% } %> -module('<%= friendlyTestName %>', function(hooks) { - hooks.beforeEach(function() { - this.TestApplication = class TestApplication extends Application {} +module('<%= friendlyTestName %>', function (hooks) { + hooks.beforeEach(function () { + this.TestApplication = class TestApplication extends Application { + modulePrefix = config.modulePrefix; + podModulePrefix = config.podModulePrefix; + Resolver = Resolver; + }; this.TestApplication.instanceInitializer({ name: 'initializer under test', - initialize + initialize, }); - this.application = this.TestApplication.create({ autoboot: false, Resolver }); + this.application = this.TestApplication.create({ autoboot: false }); this.instance = this.application.buildInstance(); }); - hooks.afterEach(function() { + hooks.afterEach(function () { <% if (destroyAppExists) { %>destroyApp(this.instance);<% } else { %>run(this.instance, 'destroy');<% } %> <% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>run(this.application, 'destroy');<% } %> }); // TODO: Replace this with your real tests. - test('it works', async function(assert) { + test('it works', async function (assert) { await this.instance.boot(); assert.ok(true); diff --git a/node-tests/fixtures/initializer-test/rfc232.js b/node-tests/fixtures/initializer-test/rfc232.js index 709ea9aaf46..78ef00434d4 100644 --- a/node-tests/fixtures/initializer-test/rfc232.js +++ b/node-tests/fixtures/initializer-test/rfc232.js @@ -1,27 +1,32 @@ import Application from '@ember/application'; +import config from 'my-app/config/environment'; import { initialize } from 'my-app/initializers/foo'; import { module, test } from 'qunit'; import Resolver from 'ember-resolver'; import { run } from '@ember/runloop'; -module('Unit | Initializer | foo', function(hooks) { - hooks.beforeEach(function() { - this.TestApplication = class TestApplication extends Application {} +module('Unit | Initializer | foo', function (hooks) { + hooks.beforeEach(function () { + this.TestApplication = class TestApplication extends Application { + modulePrefix = config.modulePrefix; + podModulePrefix = config.podModulePrefix; + Resolver = Resolver; + }; this.TestApplication.initializer({ name: 'initializer under test', - initialize + initialize, }); - this.application = this.TestApplication.create({ autoboot: false, Resolver }); + this.application = this.TestApplication.create({ autoboot: false }); }); - hooks.afterEach(function() { + hooks.afterEach(function () { run(this.application, 'destroy'); }); // TODO: Replace this with your real tests. - test('it works', async function(assert) { + test('it works', async function (assert) { await this.application.boot(); assert.ok(true); diff --git a/node-tests/fixtures/instance-initializer-test/rfc232.js b/node-tests/fixtures/instance-initializer-test/rfc232.js index 64814eda522..03654f52dcf 100644 --- a/node-tests/fixtures/instance-initializer-test/rfc232.js +++ b/node-tests/fixtures/instance-initializer-test/rfc232.js @@ -1,27 +1,32 @@ import Application from '@ember/application'; +import config from 'my-app/config/environment'; import { initialize } from 'my-app/instance-initializers/foo'; import { module, test } from 'qunit'; import Resolver from 'ember-resolver'; import { run } from '@ember/runloop'; -module('Unit | Instance Initializer | foo', function(hooks) { - hooks.beforeEach(function() { - this.TestApplication = class TestApplication extends Application {} +module('Unit | Instance Initializer | foo', function (hooks) { + hooks.beforeEach(function () { + this.TestApplication = class TestApplication extends Application { + modulePrefix = config.modulePrefix; + podModulePrefix = config.podModulePrefix; + Resolver = Resolver; + }; this.TestApplication.instanceInitializer({ name: 'initializer under test', - initialize + initialize, }); - this.application = this.TestApplication.create({ autoboot: false, Resolver }); + this.application = this.TestApplication.create({ autoboot: false }); this.instance = this.application.buildInstance(); }); - hooks.afterEach(function() { + hooks.afterEach(function () { run(this.instance, 'destroy'); run(this.application, 'destroy'); }); // TODO: Replace this with your real tests. - test('it works', async function(assert) { + test('it works', async function (assert) { await this.instance.boot(); assert.ok(true); From 65a75d074ac94146dd07f71021a4362fb7cb6327 Mon Sep 17 00:00:00 2001 From: Bert De Block Date: Wed, 12 May 2021 20:34:46 +0200 Subject: [PATCH 13/61] Use explicit this in helper-test blueprints (cherry picked from commit 844c2f493ee40ba47f2a67bc7e2d9afd725068f9) --- .../__root__/__testType__/__collection__/__name__-test.js | 2 +- .../__root__/__testType__/__collection__/__name__-test.js | 2 +- .../__root__/__testType__/__collection__/__name__-test.js | 2 +- .../__root__/__testType__/__collection__/__name__-test.js | 2 +- .../__root__/__testType__/__collection__/__name__-test.js | 2 +- node-tests/fixtures/helper-test/integration.js | 2 +- node-tests/fixtures/helper-test/mocha-0.12.js | 2 +- node-tests/fixtures/helper-test/mocha-rfc232.js | 2 +- node-tests/fixtures/helper-test/mocha.js | 2 +- node-tests/fixtures/helper-test/rfc232.js | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/blueprints/helper-test/mocha-0.12-files/__root__/__testType__/__collection__/__name__-test.js b/blueprints/helper-test/mocha-0.12-files/__root__/__testType__/__collection__/__name__-test.js index 5e27688598d..051de3a18f5 100644 --- a/blueprints/helper-test/mocha-0.12-files/__root__/__testType__/__collection__/__name__-test.js +++ b/blueprints/helper-test/mocha-0.12-files/__root__/__testType__/__collection__/__name__-test.js @@ -19,7 +19,7 @@ describe('<%= friendlyTestName %>', function() { // `); this.set('inputValue', '1234'); - this.render(hbs`{{<%= dasherizedModuleName %> inputValue}}`); + this.render(hbs`{{<%= dasherizedModuleName %> this.inputValue}}`); expect(this.$().text().trim()).to.equal('1234'); }); diff --git a/blueprints/helper-test/mocha-files/__root__/__testType__/__collection__/__name__-test.js b/blueprints/helper-test/mocha-files/__root__/__testType__/__collection__/__name__-test.js index 0e9276ae197..89d55cf614c 100644 --- a/blueprints/helper-test/mocha-files/__root__/__testType__/__collection__/__name__-test.js +++ b/blueprints/helper-test/mocha-files/__root__/__testType__/__collection__/__name__-test.js @@ -19,7 +19,7 @@ describeComponent('<%= dasherizedModuleName %>', 'helper:<%= dasherizedModuleNam // `); this.set('inputValue', '1234'); - this.render(hbs`{{<%= dasherizedModuleName %> inputValue}}`); + this.render(hbs`{{<%= dasherizedModuleName %> this.inputValue}}`); expect(this.$().text().trim()).to.equal('1234'); }); diff --git a/blueprints/helper-test/mocha-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js b/blueprints/helper-test/mocha-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js index 62a21879351..9b6702f1fd8 100644 --- a/blueprints/helper-test/mocha-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js +++ b/blueprints/helper-test/mocha-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js @@ -11,7 +11,7 @@ describe('<%= friendlyTestName %>', function() { it('renders', async function() { this.set('inputValue', '1234'); - await render(hbs`{{<%= dasherizedModuleName %> inputValue}}`); + await render(hbs`{{<%= dasherizedModuleName %> this.inputValue}}`); expect(this.element.textContent.trim()).to.equal('1234'); }); diff --git a/blueprints/helper-test/qunit-files/__root__/__testType__/__collection__/__name__-test.js b/blueprints/helper-test/qunit-files/__root__/__testType__/__collection__/__name__-test.js index 2182592ebcd..6bef509e111 100644 --- a/blueprints/helper-test/qunit-files/__root__/__testType__/__collection__/__name__-test.js +++ b/blueprints/helper-test/qunit-files/__root__/__testType__/__collection__/__name__-test.js @@ -9,7 +9,7 @@ moduleForComponent('<%= dasherizedModuleName %>', 'helper:<%= dasherizedModuleNa test('it renders', function(assert) { this.set('inputValue', '1234'); - this.render(hbs`{{<%= dasherizedModuleName %> inputValue}}`); + this.render(hbs`{{<%= dasherizedModuleName %> this.inputValue}}`); assert.equal(this.$().text().trim(), '1234'); });<% } else if (testType == 'unit') { %> diff --git a/blueprints/helper-test/qunit-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js b/blueprints/helper-test/qunit-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js index 4ba1b477266..baf3d449ad1 100644 --- a/blueprints/helper-test/qunit-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js +++ b/blueprints/helper-test/qunit-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js @@ -10,7 +10,7 @@ module('<%= friendlyTestName %>', function(hooks) { test('it renders', async function(assert) { this.set('inputValue', '1234'); - await render(hbs`{{<%= dasherizedModuleName %> inputValue}}`); + await render(hbs`{{<%= dasherizedModuleName %> this.inputValue}}`); assert.dom(this.element).hasText('1234'); }); diff --git a/node-tests/fixtures/helper-test/integration.js b/node-tests/fixtures/helper-test/integration.js index ad4f7e3782b..9abe683c279 100644 --- a/node-tests/fixtures/helper-test/integration.js +++ b/node-tests/fixtures/helper-test/integration.js @@ -9,7 +9,7 @@ moduleForComponent('foo/bar-baz', 'helper:foo/bar-baz', { test('it renders', function(assert) { this.set('inputValue', '1234'); - this.render(hbs`{{foo/bar-baz inputValue}}`); + this.render(hbs`{{foo/bar-baz this.inputValue}}`); assert.equal(this.$().text().trim(), '1234'); }); diff --git a/node-tests/fixtures/helper-test/mocha-0.12.js b/node-tests/fixtures/helper-test/mocha-0.12.js index d2eb4578af0..b78ee50dc92 100644 --- a/node-tests/fixtures/helper-test/mocha-0.12.js +++ b/node-tests/fixtures/helper-test/mocha-0.12.js @@ -19,7 +19,7 @@ describe('Integration | Helper | foo/bar-baz', function() { // `); this.set('inputValue', '1234'); - this.render(hbs`{{foo/bar-baz inputValue}}`); + this.render(hbs`{{foo/bar-baz this.inputValue}}`); expect(this.$().text().trim()).to.equal('1234'); }); diff --git a/node-tests/fixtures/helper-test/mocha-rfc232.js b/node-tests/fixtures/helper-test/mocha-rfc232.js index 9944e574437..2337d5c74f2 100644 --- a/node-tests/fixtures/helper-test/mocha-rfc232.js +++ b/node-tests/fixtures/helper-test/mocha-rfc232.js @@ -11,7 +11,7 @@ describe('Integration | Helper | foo/bar-baz', function() { it('renders', async function() { this.set('inputValue', '1234'); - await render(hbs`{{foo/bar-baz inputValue}}`); + await render(hbs`{{foo/bar-baz this.inputValue}}`); expect(this.element.textContent.trim()).to.equal('1234'); }); diff --git a/node-tests/fixtures/helper-test/mocha.js b/node-tests/fixtures/helper-test/mocha.js index bece512a42d..9e3c985f0e6 100644 --- a/node-tests/fixtures/helper-test/mocha.js +++ b/node-tests/fixtures/helper-test/mocha.js @@ -19,7 +19,7 @@ describeComponent('foo/bar-baz', 'helper:foo/bar-baz', // `); this.set('inputValue', '1234'); - this.render(hbs`{{foo/bar-baz inputValue}}`); + this.render(hbs`{{foo/bar-baz this.inputValue}}`); expect(this.$().text().trim()).to.equal('1234'); }); diff --git a/node-tests/fixtures/helper-test/rfc232.js b/node-tests/fixtures/helper-test/rfc232.js index e1b7290a2f3..c39592e478c 100644 --- a/node-tests/fixtures/helper-test/rfc232.js +++ b/node-tests/fixtures/helper-test/rfc232.js @@ -10,7 +10,7 @@ module('Integration | Helper | foo/bar-baz', function(hooks) { test('it renders', async function(assert) { this.set('inputValue', '1234'); - await render(hbs`{{foo/bar-baz inputValue}}`); + await render(hbs`{{foo/bar-baz this.inputValue}}`); assert.dom(this.element).hasText('1234'); }); From ec0c86ea56b6da7cbcf4edd4c35b554bad9adf97 Mon Sep 17 00:00:00 2001 From: Godfrey Chan Date: Mon, 24 May 2021 23:33:40 -0700 Subject: [PATCH 14/61] [BUGFIX release] Improve class based tranform deprecation message (cherry picked from commit e28a201b9ccfb16f93089cea9207fca9b552d98c) --- .../lib/system/compile-options.ts | 30 +++++++++++-------- .../tests/system/compile_options_test.js | 6 ++-- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/packages/ember-template-compiler/lib/system/compile-options.ts b/packages/ember-template-compiler/lib/system/compile-options.ts index 1f4c3e67964..87832571e09 100644 --- a/packages/ember-template-compiler/lib/system/compile-options.ts +++ b/packages/ember-template-compiler/lib/system/compile-options.ts @@ -82,11 +82,16 @@ interface LegacyPlugin { export type LegacyPluginClass = new (env: ASTPluginEnvironment) => LegacyPlugin; -function wrapLegacyPluginIfNeeded(_plugin: PluginFunc | LegacyPluginClass): PluginFunc { - let plugin = _plugin; - if (_plugin.prototype && _plugin.prototype.transform) { +function isLegacyPluginClass(plugin: PluginFunc | LegacyPluginClass): plugin is LegacyPluginClass { + return plugin.prototype && typeof plugin.prototype.transform === 'function'; +} + +function wrapLegacyPluginIfNeeded(plugin: PluginFunc | LegacyPluginClass): PluginFunc { + if (isLegacyPluginClass(plugin)) { + const Plugin = plugin; + deprecate( - 'Using class based template compilation plugins is deprecated, please update to the functional style', + `Using class based template compilation plugins is deprecated, please update to the functional style: ${Plugin.name}`, false, { id: 'template-compiler.registerPlugin', @@ -102,28 +107,29 @@ function wrapLegacyPluginIfNeeded(_plugin: PluginFunc | LegacyPluginClass): Plug let pluginInstantiated = false; return { - name: _plugin.constructor && _plugin.constructor.name, + name: plugin.name, visitor: { Program(node: AST.Program): AST.Node | void { if (!pluginInstantiated) { pluginInstantiated = true; - let plugin = new (_plugin as LegacyPluginClass)(env); + let instance = new Plugin(env); - plugin.syntax = env.syntax; + instance.syntax = env.syntax; - return plugin.transform(node); + return instance.transform(node); } }, }, }; }; - pluginFunc.__raw = _plugin as LegacyPluginClass; - plugin = pluginFunc; - } + pluginFunc.__raw = Plugin; - return plugin as PluginFunc; + return pluginFunc; + } else { + return plugin; + } } export function registerPlugin(type: string, _plugin: PluginFunc | LegacyPluginClass): void { 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 921d3f2387a..2b75b69f36d 100644 --- a/packages/ember-template-compiler/tests/system/compile_options_test.js +++ b/packages/ember-template-compiler/tests/system/compile_options_test.js @@ -124,7 +124,7 @@ moduleFor( class extends CustomPluginsTests { beforeEach() { expectDeprecation( - 'Using class based template compilation plugins is deprecated, please update to the functional style' + `Using class based template compilation plugins is deprecated, please update to the functional style: ${LegacyCustomTransform.name}` ); expectDeprecation( 'registerPlugin is deprecated, please pass plugins directly via `compile` and/or `precompile`.' @@ -141,7 +141,7 @@ moduleFor( ['@test custom registered plugins are deduplicated'](assert) { expectDeprecation( - 'Using class based template compilation plugins is deprecated, please update to the functional style' + `Using class based template compilation plugins is deprecated, please update to the functional style: ${LegacyCustomTransform.name}` ); expectDeprecation( 'registerPlugin is deprecated, please pass plugins directly via `compile` and/or `precompile`.' @@ -194,7 +194,7 @@ moduleFor( // override so that we can provide custom AST plugins to compile compile(templateString) { expectDeprecation( - 'Using class based template compilation plugins is deprecated, please update to the functional style' + 'Using class based template compilation plugins is deprecated, please update to the functional style: LegacyCustomTransform' ); return compile(templateString, { plugins: { From c70dd5100ef0d7d0257b2a69990275b64f9f023f Mon Sep 17 00:00:00 2001 From: Godfrey Chan Date: Tue, 25 May 2021 01:57:43 -0700 Subject: [PATCH 15/61] [BUGFIX release] Refine Ember Global deprecation message Example message: ``` Usage of the Ember Global is deprecated. You should import the Ember module or the specific API instead. See https://deprecations.emberjs.com/v3.x/#toc_ember-global for details. Usages of the Ember Global may be caused by an outdated ember-cli-babel dependency. The following steps may help: * Upgrade your `devDependencies` on `ember-cli-babel` to `^7.26.6`. * Upgrade the following addons to the latest version: * active-model-adapter * ember-animated * ember-async-await-helper * ember-attacher * ember-cli-showdown * ember-freestyle * ember-md5 ### Important ### In order to avoid repeatedly showing the same deprecation messages, no further deprecation messages will be shown for usages of the Ember Global until ember-cli-babel is upgraded to v7.26.6 or above. To see all instances of this deprecation message at runtime, set the `EMBER_GLOBAL_DEPRECATIONS` environment variable to "all", e.g. `EMBER_GLOBAL_DEPRECATIONS=all ember test`. ### Details ### Prior to v7.26.6, ember-cli-babel sometimes transpiled imports into the equivalent Ember Global API, potentially triggering this deprecation message even when you did not directly reference the Ember Global. The following outdated versions are found in your project: * ember-cli-babel@6.11.0, currently used by: * ember-md5@6.11.0 * Depends on ember-cli-babel@6.11.0 * ember-cli-babel@6.18.0, currently used by: * active-model-adapter@6.18.0 * Depends on ember-cli-babel@^6.8.2 * ember-angle-bracket-invocation-polyfill@6.18.0 * Depends on ember-cli-babel@^6.17.0 * Added by ember-animated@0.11.0 * ember-async-await-helper@6.18.0 * Depends on ember-cli-babel@^6.16.0 * ember-cli-deploy-bugsnag@6.18.0 (Dormant) * Depends on ember-cli-babel@^6.16.0 * ember-cli-showdown@6.18.0 * Depends on ember-cli-babel@^6.8.1 * ember-inflector@6.18.0 * Depends on ember-cli-babel@^6.0.0 * Added by active-model-adapter@2.2.0 * ember-maybe-import-regenerator@6.18.0 (Dormant) * Depends on ember-cli-babel@^6.0.0-beta.4 * Added by ember-animated@0.11.0 * ember-named-arguments-polyfill@6.18.0 (Dormant) * Depends on ember-cli-babel@^6.6.0 * Added by ember-animated@0.11.0 * ember-raf-scheduler@6.18.0 * Depends on ember-cli-babel@^6.6.0 * Added by ember-attacher@1.2.3 > ember-popper@0.11.3 * ember-runtime-enumerable-includes-polyfill@6.18.0 (Dormant) * Depends on ember-cli-babel@^6.9.0 * Added by ember-freestyle@0.12.11 * ember-cli-babel@7.26.5, currently used by: * @embroider/macros@7.26.5 (Compatible) * Depends on ember-cli-babel@^7.23.0 * Added by ember-cli-mirage@2.2.0 * Added by ember-exam@6.1.0 * direwolf (your app) * Depends on ember-cli-babel@7.26.5 * ember-attacher@7.26.5 (Compatible) * Depends on ember-cli-babel@^7.23.0 * ember-fetch@7.26.5 (Compatible) * Depends on ember-cli-babel@^7.23.0 * ember-freestyle@7.26.5 (Compatible) * Depends on ember-cli-babel@^7.23.0 * ember-inflector@7.26.5 (Compatible) * Depends on ember-cli-babel@^7.23.0 * Added by ember-data@3.26.0 * Added by ember-cli-mirage@2.2.0 * ember-source@7.26.5 (Dormant) * Depends on ember-cli-babel@^7.23.0 * qunit-dom@7.26.5 (Dormant) * Depends on ember-cli-babel@^7.23.0 Note: Addons marked as "Dormant" does not appear to have any JavaScript files. Therefore, even if they are using an old version ember-cli-babel, they are unlikely to be the cuplrit of this deprecation and can likely be ignored. Note: Addons marked as "Compatible" are already compatible with ember-cli-babel@7.26.6. Try upgrading your `devDependencies` on `ember-cli-babel` to `^7.26.6`. ``` (cherry picked from commit bb9d96e5cf10d02681c54be426586328206a68c2) --- lib/index.js | 249 +++++++++++++++++- packages/@ember/-internals/bootstrap/index.js | 34 +-- 2 files changed, 267 insertions(+), 16 deletions(-) diff --git a/lib/index.js b/lib/index.js index 7b209f811b4..580469b2275 100644 --- a/lib/index.js +++ b/lib/index.js @@ -10,6 +10,7 @@ const buildStripClassCallcheckPlugin = require('./build-strip-class-callcheck-pl const injectBabelHelpers = require('./transforms/inject-babel-helpers').injectBabelHelpers; const debugTree = require('broccoli-debug').buildDebugCallback('ember-source:addon'); const vmBabelPlugins = require('@glimmer/vm-babel-plugins'); +const semver = require('semver'); const PRE_BUILT_TARGETS = [ 'last 1 Chrome versions', @@ -40,6 +41,17 @@ add( path.join(__dirname, '..', 'dist', 'ember-template-compiler.js') ); +function* walkAddonTree(project, pathToAddon = []) { + for (let addon of project.addons) { + yield [addon, pathToAddon]; + yield* walkAddonTree(addon, [...pathToAddon, `${addon.name}@${addon.pkg.version}`]); + } +} + +function requirementFor(pkg, deps = {}) { + return deps[pkg]; +} + module.exports = { init() { this._super.init && this._super.init.apply(this, arguments); @@ -64,11 +76,14 @@ module.exports = { name: 'ember-source', paths, absolutePaths, + _bootstrapEmber: "require('@ember/-internals/bootstrap').default();", _jqueryIntegrationEnabled: true, included() { this._super.included.apply(this, arguments); + this._issueGlobalsDeprecation(); + const { has } = require('@ember/edition-utils'); let optionalFeatures = this.project.addons.find((a) => a.name === '@ember/optional-features'); @@ -244,7 +259,7 @@ module.exports = { return new MergeTrees([ concatBundle(emberFiles, { outputFile: 'ember.js', - footer: "require('@ember/-internals/bootstrap');", + footer: this._bootstrapEmber, }), concatBundle(emberTestingFiles, { @@ -309,4 +324,236 @@ module.exports = { return debugTree(new MergeTrees([ember, templateCompiler, jquery]), 'vendor:final'); }, + + _issueGlobalsDeprecation() { + if (process.env.EMBER_ENV === 'production') { + return; + } + + let isYarnProject = ((root) => { + try { + // eslint-disable-next-line node/no-unpublished-require + return require('ember-cli/lib/utilities/is-yarn-project')(root); + } catch { + return undefined; + } + })(this.project.root); + + let groupedByTopLevelAddon = Object.create(null); + let groupedByVersion = Object.create(null); + let projectInfo; + + for (let [addon, pathToAddon] of walkAddonTree(this.project)) { + let version = addon.pkg.version; + + if (addon.name === 'ember-cli-babel' && semver.lt(version, '7.26.6')) { + let info; + + if (addon.parent === this.project) { + let requirement = requirementFor('ember-cli-babel', this.project.pkg.devDependencies); + let compatible = semver.satisfies('7.26.6', requirement); + + info = projectInfo = { + parent: `${this.project.name()} (your app)`, + version, + requirement, + compatible, + dormant: false, + path: pathToAddon, + }; + } else { + let requirement = requirementFor('ember-cli-babel', addon.parent.pkg.dependencies); + let compatible = semver.satisfies('7.26.6', requirement); + let dormant = addon.parent._fileSystemInfo + ? addon.parent._fileSystemInfo().hasJSFiles === false + : false; + + let topLevelAddon = addon.parent; + + while (topLevelAddon.parent !== this.project) { + topLevelAddon = topLevelAddon.parent; + } + + info = { + parent: `${addon.parent.name}@${addon.pkg.version}`, + version, + requirement, + compatible, + dormant, + path: pathToAddon, + }; + + let addons = groupedByTopLevelAddon[topLevelAddon.name] || []; + groupedByTopLevelAddon[topLevelAddon.name] = [...addons, info]; + } + + let group = groupedByVersion[version] || Object.create(null); + groupedByVersion[version] = group; + + let addons = group[info.parent] || []; + group[info.parent] = [...addons, info]; + } + } + + if (Object.keys(groupedByVersion).length === 0) { + return; + } + + let dormantTopLevelAddons = []; + let compatibleTopLevelAddons = []; + let incompatibleTopLevelAddons = []; + + for (let addon of Object.keys(groupedByTopLevelAddon)) { + let group = groupedByTopLevelAddon[addon]; + + if (group.every((info) => info.dormant)) { + dormantTopLevelAddons.push(addon); + } else if (group.every((info) => info.compatible)) { + compatibleTopLevelAddons.push(addon); + } else { + incompatibleTopLevelAddons.push(addon); + } + } + + let message = + 'Usage of the Ember Global is deprecated. ' + + 'You should import the Ember module or the specific API instead.\n\n' + + 'See https://deprecations.emberjs.com/v3.x/#toc_ember-global for details.\n\n' + + 'Usages of the Ember Global may be caused by an outdated ember-cli-babel dependency. ' + + 'The following steps may help:\n\n'; + + let hasActionableSteps = false; + + if (projectInfo) { + message += '* Upgrade your `devDependencies` on `ember-cli-babel` to `^7.26.6`.\n'; + hasActionableSteps = true; + } else if (compatibleTopLevelAddons.length > 0) { + // Only show the compatible addons if the project itself is up-to-date, because updating the + // project's own dependency on ember-cli-babel to latest may also get these addons to use it + // as well. Otherwise, there is an unnecessary copy in the tree and it needs to be deduped. + if (isYarnProject === true) { + message += + '* Run `npx yarn-deduplicate --packages ember-cli-babel` followed by `yarn install`.\n'; + } else if (isYarnProject === false) { + message += '* Run `npm dedupe`.\n'; + } else { + message += + '* If using yarn, run `npx yarn-deduplicate --packages ember-cli-babel` followed by `yarn install`.\n' + + '* If using npm, run `npm dedupe`.\n'; + } + + hasActionableSteps = true; + } + + if (incompatibleTopLevelAddons.length > 0) { + message += '* Upgrade the following addons to the latest version:\n'; + + for (let addon of incompatibleTopLevelAddons) { + message += ` * ${addon}\n`; + } + + hasActionableSteps = true; + } + + if (!hasActionableSteps) { + // Only show the dormant addons if there are nothing else to do because they are unlikely to + // be the problem. + message += '* Upgrade the following addons to the latest version, if available:\n'; + + for (let addon of dormantTopLevelAddons) { + message += ` * ${addon}\n`; + } + } + + if (hasActionableSteps && process.env.EMBER_GLOBAL_DEPRECATIONS !== 'all') { + message += + '\n### Important ###\n\n' + + 'In order to avoid repeatedly showing the same deprecation messages, ' + + 'no further deprecation messages will be shown for usages of the Ember Global ' + + 'until ember-cli-babel is upgraded to v7.26.6 or above.\n\n' + + 'To see all instances of this deprecation message at runtime, ' + + 'set the `EMBER_GLOBAL_DEPRECATIONS` environment variable to "all", ' + + 'e.g. `EMBER_GLOBAL_DEPRECATIONS=all ember test`.\n'; + } + + message += + '\n### Details ###\n\n' + + 'Prior to v7.26.6, ember-cli-babel sometimes transpiled imports into the equivalent Ember Global API, ' + + 'potentially triggering this deprecation message even when you did not directly reference the Ember Global.\n\n' + + 'The following outdated versions are found in your project:\n'; + + let hasDormantAddons = false; + let hasCompatibleAddons = false; + + for (let version of Object.keys(groupedByVersion).sort(semver.compare)) { + message += `\n* ember-cli-babel@${version}, currently used by:\n`; + + for (let parent of Object.keys(groupedByVersion[version]).sort()) { + let info = groupedByVersion[version][parent][0]; + + message += ` * ${parent}`; + + if (info.dormant) { + message += ' (Dormant)\n'; + hasDormantAddons = true; + } else if (info.compatible) { + message += ' (Compatible)\n'; + hasCompatibleAddons = true; + } else { + message += '\n'; + } + + message += ` * Depends on ember-cli-babel@${groupedByVersion[version][parent][0].requirement}\n`; + + for (let info of groupedByVersion[version][parent]) { + let adddedBy = info.path.slice(0, -1); + + if (adddedBy.length) { + message += ` * Added by ${adddedBy.join(' > ')}\n`; + } + + if (info.compatible) { + hasCompatibleAddons = true; + } + } + } + } + + if (hasDormantAddons) { + message += + '\nNote: Addons marked as "Dormant" does not appear to have any JavaScript files. ' + + 'Therefore, even if they are using an old version ember-cli-babel, they are ' + + 'unlikely to be the cuplrit of this deprecation and can likely be ignored.\n'; + } + + if (hasCompatibleAddons) { + message += `\nNote: Addons marked as "Compatible" are already compatible with ember-cli-babel@7.26.6. `; + + if (projectInfo) { + message += 'Try upgrading your `devDependencies` on `ember-cli-babel` to `^7.26.6`.\n'; + } else { + if (isYarnProject === true) { + message += + 'Try running `npx yarn-deduplicate --packages ember-cli-babel` followed by `yarn install`.\n'; + } else if (isYarnProject === false) { + message += 'Try running `npm dedupe`.\n'; + } else { + message += + 'If using yarn, try running `npx yarn-deduplicate --packages ember-cli-babel` followed by `yarn install`.' + + 'If using npm, try running `npm dedupe`.\n'; + } + } + } + + if (hasActionableSteps) { + this.ui.writeWarnLine('[DEPRECATION] ' + message); + } + + this._bootstrapEmber = ` + require('@ember/-internals/bootstrap').default( + ${JSON.stringify(message)}, + ${hasActionableSteps && process.env.EMBER_GLOBAL_DEPRECATIONS !== 'all'} + ); + `; + }, }; diff --git a/packages/@ember/-internals/bootstrap/index.js b/packages/@ember/-internals/bootstrap/index.js index 431992b2e55..05e70d3a721 100644 --- a/packages/@ember/-internals/bootstrap/index.js +++ b/packages/@ember/-internals/bootstrap/index.js @@ -2,8 +2,12 @@ import require from 'require'; import { context } from '@ember/-internals/environment'; import { deprecate } from '@ember/debug'; -(function () { +const DEFAULT_MESSAGE = + 'Usage of the Ember Global is deprecated. You should import the Ember module or the specific API instead.'; + +export default function bootstrap(message = DEFAULT_MESSAGE, once = false) { let Ember; + let disabled = false; function defineEmber(key) { Object.defineProperty(context.exports, key, { @@ -14,19 +18,19 @@ import { deprecate } from '@ember/debug'; Ember = require('ember').default; } - deprecate( - 'Usage of the Ember Global is deprecated. You should import the Ember module or the specific API instead.', - false, - { - id: 'ember-global', - until: '4.0.0', - url: 'https://deprecations.emberjs.com/v3.x/#toc_ember-global', - for: 'ember-source', - since: { - enabled: '3.27.0', - }, - } - ); + deprecate(message, disabled, { + id: 'ember-global', + until: '4.0.0', + url: 'https://deprecations.emberjs.com/v3.x/#toc_ember-global', + for: 'ember-source', + since: { + enabled: '3.27.0', + }, + }); + + if (once) { + disabled = true; + } return Ember; }, @@ -43,4 +47,4 @@ import { deprecate } from '@ember/debug'; // eslint-disable-next-line no-undef module.exports = Ember = require('ember').default; } -})(); +} From edb4e1d1be8291e1efe4ec97bddf130e1b681e30 Mon Sep 17 00:00:00 2001 From: Godfrey Chan Date: Wed, 26 May 2021 14:37:13 -0700 Subject: [PATCH 16/61] [BUGFIX release] Improve computed.* and run.* deprecation message Show details about outdated ember-cli-babel and only show the first instance by default. Example message: ``` Using `computed.reads` has been deprecated. Instead, import the value directly from @ember/object/computed: import { reads } from '@ember/object/computed'; These usages may be caused by an outdated ember-cli-babel dependency. The following steps may help: * Upgrade the following addons to the latest version: * active-model-adapter * ember-animated * ember-async-await-helper * ember-attacher * ember-cli-showdown * ember-md5 ### Important ### In order to avoid repeatedly showing the same deprecation messages, no further deprecation messages will be shown for theses deprecated usages until ember-cli-babel is upgraded to v7.26.6 or above. To see all instances of this deprecation message, set the `EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS` environment variable to "all", e.g. `EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS=all ember test`. ### Details ### Prior to v7.26.6, ember-cli-babel sometimes transpiled imports into the equivalent Ember Global API, potentially triggering this deprecation message indirectly, even when you did not observe these deprecated usages in your code. The following outdated versions are found in your project: * ember-cli-babel@6.11.0, currently used by: * ember-md5@6.11.0 * Depends on ember-cli-babel@6.11.0 * ember-cli-babel@6.18.0, currently used by: * active-model-adapter@6.18.0 * Depends on ember-cli-babel@^6.8.2 * ember-angle-bracket-invocation-polyfill@6.18.0 * Depends on ember-cli-babel@^6.17.0 * Added by ember-animated@0.11.0 * ember-async-await-helper@6.18.0 * Depends on ember-cli-babel@^6.16.0 * ember-cli-deploy-bugsnag@6.18.0 (Dormant) * Depends on ember-cli-babel@^6.16.0 * ember-cli-showdown@6.18.0 * Depends on ember-cli-babel@^6.8.1 * ember-inflector@6.18.0 * Depends on ember-cli-babel@^6.0.0 * Added by active-model-adapter@2.2.0 * ember-maybe-import-regenerator@6.18.0 (Dormant) * Depends on ember-cli-babel@^6.0.0-beta.4 * Added by ember-animated@0.11.0 * ember-named-arguments-polyfill@6.18.0 (Dormant) * Depends on ember-cli-babel@^6.6.0 * Added by ember-animated@0.11.0 * ember-raf-scheduler@6.18.0 * Depends on ember-cli-babel@^6.6.0 * Added by ember-attacher@1.2.3 > ember-popper@0.11.3 * ember-runtime-enumerable-includes-polyfill@6.18.0 (Dormant) * Depends on ember-cli-babel@^6.9.0 * Added by ember-freestyle@0.12.11 Note: Addons marked as "Dormant" does not appear to have any JavaScript files. Therefore, even if they are using an old version ember-cli-babel, they are unlikely to be the cuplrit of this deprecation and can likely be ignored. ``` (cherry picked from commit 7a8ab95eeeee95680974b2bdb04031b96e4ee7a4) --- lib/index.js | 153 +++++++++++++++++++++---------- packages/@ember/object/index.js | 32 ++++--- packages/@ember/runloop/index.js | 54 ++++++----- 3 files changed, 154 insertions(+), 85 deletions(-) diff --git a/lib/index.js b/lib/index.js index 580469b2275..6bb6a231626 100644 --- a/lib/index.js +++ b/lib/index.js @@ -415,101 +415,86 @@ module.exports = { } } - let message = - 'Usage of the Ember Global is deprecated. ' + - 'You should import the Ember module or the specific API instead.\n\n' + - 'See https://deprecations.emberjs.com/v3.x/#toc_ember-global for details.\n\n' + - 'Usages of the Ember Global may be caused by an outdated ember-cli-babel dependency. ' + - 'The following steps may help:\n\n'; + let suggestions = 'The following steps may help:\n\n'; - let hasActionableSteps = false; + let hasActionableSuggestions = false; if (projectInfo) { - message += '* Upgrade your `devDependencies` on `ember-cli-babel` to `^7.26.6`.\n'; - hasActionableSteps = true; + suggestions += '* Upgrade your `devDependencies` on `ember-cli-babel` to `^7.26.6`.\n'; + hasActionableSuggestions = true; } else if (compatibleTopLevelAddons.length > 0) { // Only show the compatible addons if the project itself is up-to-date, because updating the // project's own dependency on ember-cli-babel to latest may also get these addons to use it // as well. Otherwise, there is an unnecessary copy in the tree and it needs to be deduped. if (isYarnProject === true) { - message += + suggestions += '* Run `npx yarn-deduplicate --packages ember-cli-babel` followed by `yarn install`.\n'; } else if (isYarnProject === false) { - message += '* Run `npm dedupe`.\n'; + suggestions += '* Run `npm dedupe`.\n'; } else { - message += + suggestions += '* If using yarn, run `npx yarn-deduplicate --packages ember-cli-babel` followed by `yarn install`.\n' + '* If using npm, run `npm dedupe`.\n'; } - hasActionableSteps = true; + hasActionableSuggestions = true; } if (incompatibleTopLevelAddons.length > 0) { - message += '* Upgrade the following addons to the latest version:\n'; + suggestions += '* Upgrade the following addons to the latest version:\n'; for (let addon of incompatibleTopLevelAddons) { - message += ` * ${addon}\n`; + suggestions += ` * ${addon}\n`; } - hasActionableSteps = true; + hasActionableSuggestions = true; } - if (!hasActionableSteps) { + if (!hasActionableSuggestions) { // Only show the dormant addons if there are nothing else to do because they are unlikely to // be the problem. - message += '* Upgrade the following addons to the latest version, if available:\n'; + suggestions += '* Upgrade the following addons to the latest version, if available:\n'; for (let addon of dormantTopLevelAddons) { - message += ` * ${addon}\n`; + suggestions += ` * ${addon}\n`; } } - if (hasActionableSteps && process.env.EMBER_GLOBAL_DEPRECATIONS !== 'all') { - message += - '\n### Important ###\n\n' + - 'In order to avoid repeatedly showing the same deprecation messages, ' + - 'no further deprecation messages will be shown for usages of the Ember Global ' + - 'until ember-cli-babel is upgraded to v7.26.6 or above.\n\n' + - 'To see all instances of this deprecation message at runtime, ' + - 'set the `EMBER_GLOBAL_DEPRECATIONS` environment variable to "all", ' + - 'e.g. `EMBER_GLOBAL_DEPRECATIONS=all ember test`.\n'; - } - - message += + let details = '\n### Details ###\n\n' + 'Prior to v7.26.6, ember-cli-babel sometimes transpiled imports into the equivalent Ember Global API, ' + - 'potentially triggering this deprecation message even when you did not directly reference the Ember Global.\n\n' + + 'potentially triggering this deprecation message indirectly, ' + + 'even when you did not observe these deprecated usages in your code.\n\n' + 'The following outdated versions are found in your project:\n'; let hasDormantAddons = false; let hasCompatibleAddons = false; for (let version of Object.keys(groupedByVersion).sort(semver.compare)) { - message += `\n* ember-cli-babel@${version}, currently used by:\n`; + details += `\n* ember-cli-babel@${version}, currently used by:\n`; for (let parent of Object.keys(groupedByVersion[version]).sort()) { let info = groupedByVersion[version][parent][0]; - message += ` * ${parent}`; + details += ` * ${parent}`; if (info.dormant) { - message += ' (Dormant)\n'; + details += ' (Dormant)\n'; hasDormantAddons = true; } else if (info.compatible) { - message += ' (Compatible)\n'; + details += ' (Compatible)\n'; hasCompatibleAddons = true; } else { - message += '\n'; + details += '\n'; } - message += ` * Depends on ember-cli-babel@${groupedByVersion[version][parent][0].requirement}\n`; + details += ` * Depends on ember-cli-babel@${groupedByVersion[version][parent][0].requirement}\n`; for (let info of groupedByVersion[version][parent]) { let adddedBy = info.path.slice(0, -1); if (adddedBy.length) { - message += ` * Added by ${adddedBy.join(' > ')}\n`; + details += ` * Added by ${adddedBy.join(' > ')}\n`; } if (info.compatible) { @@ -520,40 +505,110 @@ module.exports = { } if (hasDormantAddons) { - message += + details += '\nNote: Addons marked as "Dormant" does not appear to have any JavaScript files. ' + 'Therefore, even if they are using an old version ember-cli-babel, they are ' + 'unlikely to be the cuplrit of this deprecation and can likely be ignored.\n'; } if (hasCompatibleAddons) { - message += `\nNote: Addons marked as "Compatible" are already compatible with ember-cli-babel@7.26.6. `; + details += `\nNote: Addons marked as "Compatible" are already compatible with ember-cli-babel@7.26.6. `; if (projectInfo) { - message += 'Try upgrading your `devDependencies` on `ember-cli-babel` to `^7.26.6`.\n'; + details += 'Try upgrading your `devDependencies` on `ember-cli-babel` to `^7.26.6`.\n'; } else { if (isYarnProject === true) { - message += + details += 'Try running `npx yarn-deduplicate --packages ember-cli-babel` followed by `yarn install`.\n'; } else if (isYarnProject === false) { - message += 'Try running `npm dedupe`.\n'; + details += 'Try running `npm dedupe`.\n'; } else { - message += + details += 'If using yarn, try running `npx yarn-deduplicate --packages ember-cli-babel` followed by `yarn install`.' + 'If using npm, try running `npm dedupe`.\n'; } } } - if (hasActionableSteps) { - this.ui.writeWarnLine('[DEPRECATION] ' + message); + let globalMessage = + 'Usage of the Ember Global is deprecated. ' + + 'You should import the Ember module or the specific API instead.\n\n' + + 'See https://deprecations.emberjs.com/v3.x/#toc_ember-global for details.\n\n' + + 'Usages of the Ember Global may be caused by an outdated ember-cli-babel dependency. ' + + suggestions; + + if (hasActionableSuggestions && process.env.EMBER_GLOBAL_DEPRECATIONS !== 'all') { + globalMessage += + '\n### Important ###\n\n' + + 'In order to avoid repeatedly showing the same deprecation messages, ' + + 'no further deprecation messages will be shown for usages of the Ember Global ' + + 'until ember-cli-babel is upgraded to v7.26.6 or above.\n\n' + + 'To see all instances of this deprecation message, ' + + 'set the `EMBER_GLOBAL_DEPRECATIONS` environment variable to "all", ' + + 'e.g. `EMBER_GLOBAL_DEPRECATIONS=all ember test`.\n'; + } + + globalMessage += details; + + if (hasActionableSuggestions) { + this.ui.writeWarnLine('[DEPRECATION] ' + globalMessage); } + let onDotAccess = `(dotKey, importKey, module) => { + let message = + \`Using \\\`\${dotKey}\\\` has been deprecated. Instead, import the value directly from \${module}:\\n\\n\` + + \` import { \${importKey} } from '\${module}';\\n\\n\` + + 'These usages may be caused by an outdated ember-cli-babel dependency. ' + + ${JSON.stringify(suggestions)}; + + if (${ + hasActionableSuggestions && + process.env.EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS !== 'all' + }) { + message += + '\\n### Important ###\\n\\n' + + 'In order to avoid repeatedly showing the same deprecation messages, ' + + 'no further deprecation messages will be shown for theses deprecated usages ' + + 'until ember-cli-babel is upgraded to v7.26.6 or above.\\n\\n' + + 'To see all instances of this deprecation message, ' + + 'set the \`EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS\` environment variable to "all", ' + + 'e.g. \`EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS=all ember test\`.\\n'; + } + + message += ${JSON.stringify(details)}; + + return message; + }`; + this._bootstrapEmber = ` require('@ember/-internals/bootstrap').default( - ${JSON.stringify(message)}, - ${hasActionableSteps && process.env.EMBER_GLOBAL_DEPRECATIONS !== 'all'} + ${JSON.stringify(globalMessage)}, + ${hasActionableSuggestions && process.env.EMBER_GLOBAL_DEPRECATIONS !== 'all'} ); + + { + let disabled = false; + + let once = ${ + hasActionableSuggestions && + process.env.EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS !== 'all' + }; + + let _onDotAccess = ${onDotAccess}; + + let onDotAccess = (...args) => { + if (disabled) { + return null; + } else { + disabled = once; + return _onDotAccess(...args); + } + }; + + require('@ember/object')._onDotAccess(onDotAccess); + + require('@ember/runloop')._onDotAccess(onDotAccess); + } `; }, }; diff --git a/packages/@ember/object/index.js b/packages/@ember/object/index.js index f2fe18b27f9..af4dd9d5735 100644 --- a/packages/@ember/object/index.js +++ b/packages/@ember/object/index.js @@ -55,23 +55,31 @@ import { uniq, } from '@ember/object/computed'; +export let _onDotAccess; + // eslint-disable-next-line no-undef if (DEBUG) { + let _callback = (dotKey, importKey, module) => { + return `Using \`${dotKey}\` has been deprecated. Instead, import the value directly from ${module}:\n\n import { ${importKey} } from '${module}';`; + }; + + _onDotAccess = (callback) => { + _callback = callback; + }; + let defineDeprecatedComputedFunc = (key, func) => { Object.defineProperty(computed, key, { get() { - deprecate( - `Using \`computed.${key}\` has been deprecated. Instead, import the value directly from @ember/object/computed:\n\n import { ${key} } from '@ember/object/computed';`, - false, - { - id: 'deprecated-run-loop-and-computed-dot-access', - until: '4.0.0', - for: 'ember-source', - since: { - enabled: '3.27.0', - }, - } - ); + let message = _callback(`computed.${key}`, key, '@ember/object/computed'); + + deprecate(message, message === null, { + id: 'deprecated-run-loop-and-computed-dot-access', + until: '4.0.0', + for: 'ember-source', + since: { + enabled: '3.27.0', + }, + }); return func; }, diff --git a/packages/@ember/runloop/index.js b/packages/@ember/runloop/index.js index d3ae2d1e780..6ce847c96db 100644 --- a/packages/@ember/runloop/index.js +++ b/packages/@ember/runloop/index.js @@ -743,23 +743,31 @@ export function throttle() { export let _deprecatedGlobalGetCurrentRunLoop; +export let _onDotAccess; + // eslint-disable-next-line no-undef if (DEBUG) { + let _callback = (dotKey, importKey, module) => { + return `Using \`${dotKey}\` has been deprecated. Instead, import the value directly from ${module}:\n\n import { ${importKey} } from '${module}';`; + }; + + _onDotAccess = (callback) => { + _callback = callback; + }; + let defineDeprecatedRunloopFunc = (key, func) => { Object.defineProperty(run, key, { get() { - deprecate( - `Using \`run.${key}\` has been deprecated. Instead, import the value directly from @ember/runloop:\n\n import { ${key} } from '@ember/runloop';`, - false, - { - id: 'deprecated-run-loop-and-computed-dot-access', - until: '4.0.0', - for: 'ember-source', - since: { - enabled: '3.27.0', - }, - } - ); + let message = _callback(`run.${key}`, key, '@ember/runloop'); + + deprecate(message, message === null, { + id: 'deprecated-run-loop-and-computed-dot-access', + until: '4.0.0', + for: 'ember-source', + since: { + enabled: '3.27.0', + }, + }); return func; }, @@ -767,18 +775,16 @@ if (DEBUG) { }; _deprecatedGlobalGetCurrentRunLoop = () => { - deprecate( - `Using \`run.currentRunLoop\` has been deprecated. Instead, import the getCurrentRunLoop() directly from @ember/runloop:\n\n import { getCurrentRunLoop } from '@ember/runloop';`, - false, - { - id: 'deprecated-run-loop-and-computed-dot-access', - until: '4.0.0', - for: 'ember-source', - since: { - enabled: '3.27.0', - }, - } - ); + let message = _callback('run.currentRunLoop', 'getCurrentRunLoop', '@ember/runloop'); + + deprecate(message, message === null, { + id: 'deprecated-run-loop-and-computed-dot-access', + until: '4.0.0', + for: 'ember-source', + since: { + enabled: '3.27.0', + }, + }); return _getCurrentRunLoop(); }; From d9a66ae9f8dcb71a7f885d5e129289fcc6d0b911 Mon Sep 17 00:00:00 2001 From: Godfrey Chan Date: Wed, 26 May 2021 16:02:33 -0700 Subject: [PATCH 17/61] Downlevel for IE11 (cherry picked from commit 72c3fd71609b4b07502def8fe103b98d69912b7d) --- lib/index.js | 70 +++++++++++++++++++++++++--------------------------- 1 file changed, 34 insertions(+), 36 deletions(-) diff --git a/lib/index.js b/lib/index.js index 6bb6a231626..8f0ff2ffc36 100644 --- a/lib/index.js +++ b/lib/index.js @@ -554,31 +554,31 @@ module.exports = { this.ui.writeWarnLine('[DEPRECATION] ' + globalMessage); } - let onDotAccess = `(dotKey, importKey, module) => { - let message = - \`Using \\\`\${dotKey}\\\` has been deprecated. Instead, import the value directly from \${module}:\\n\\n\` + - \` import { \${importKey} } from '\${module}';\\n\\n\` + - 'These usages may be caused by an outdated ember-cli-babel dependency. ' + - ${JSON.stringify(suggestions)}; - - if (${ - hasActionableSuggestions && - process.env.EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS !== 'all' - }) { - message += - '\\n### Important ###\\n\\n' + - 'In order to avoid repeatedly showing the same deprecation messages, ' + - 'no further deprecation messages will be shown for theses deprecated usages ' + - 'until ember-cli-babel is upgraded to v7.26.6 or above.\\n\\n' + - 'To see all instances of this deprecation message, ' + - 'set the \`EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS\` environment variable to "all", ' + - 'e.g. \`EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS=all ember test\`.\\n'; - } + let onDotAccess = `function (dotKey, importKey, module) { + var message = + 'Using \`' + dotKey + '\` has been deprecated. Instead, import the value directly from ' + module + ':\\n\\n' + + ' import { ' + importKey + ' } from \\'' + module + '\\';\\n\\n' + + 'These usages may be caused by an outdated ember-cli-babel dependency. ' + + ${JSON.stringify(suggestions)}; + + if (${ + hasActionableSuggestions && + process.env.EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS !== 'all' + }) { + message += + '\\n### Important ###\\n\\n' + + 'In order to avoid repeatedly showing the same deprecation messages, ' + + 'no further deprecation messages will be shown for theses deprecated usages ' + + 'until ember-cli-babel is upgraded to v7.26.6 or above.\\n\\n' + + 'To see all instances of this deprecation message, ' + + 'set the \`EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS\` environment variable to "all", ' + + 'e.g. \`EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS=all ember test\`.\\n'; + } - message += ${JSON.stringify(details)}; + message += ${JSON.stringify(details)}; - return message; - }`; + return message; + }`; this._bootstrapEmber = ` require('@ember/-internals/bootstrap').default( @@ -586,29 +586,27 @@ module.exports = { ${hasActionableSuggestions && process.env.EMBER_GLOBAL_DEPRECATIONS !== 'all'} ); - { - let disabled = false; - - let once = ${ - hasActionableSuggestions && - process.env.EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS !== 'all' - }; - - let _onDotAccess = ${onDotAccess}; - - let onDotAccess = (...args) => { + (function(disabled, once, _onDotAccess) { + var onDotAccess = function () { if (disabled) { return null; } else { disabled = once; - return _onDotAccess(...args); + return _onDotAccess.apply(undefined, arguments); } }; require('@ember/object')._onDotAccess(onDotAccess); require('@ember/runloop')._onDotAccess(onDotAccess); - } + })( + false, + ${ + hasActionableSuggestions && + process.env.EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS !== 'all' + }, + ${onDotAccess} + ); `; }, }; From c54ed9eb02ee6b853c6e1f4ac5203d5a5808b039 Mon Sep 17 00:00:00 2001 From: Chris Thoburn Date: Mon, 5 Apr 2021 23:22:45 -0700 Subject: [PATCH 18/61] fix: lookup/register and singleton flag behavior (cherry picked from commit 1d49ea9740a921ffef27c0fd08af09216f32e2e0) --- .../-internals/container/lib/container.ts | 7 +- .../container/tests/container_test.js | 244 ++++++++++++++---- 2 files changed, 191 insertions(+), 60 deletions(-) diff --git a/packages/@ember/-internals/container/lib/container.ts b/packages/@ember/-internals/container/lib/container.ts index 464cee719f6..0c26834bfdb 100644 --- a/packages/@ember/-internals/container/lib/container.ts +++ b/packages/@ember/-internals/container/lib/container.ts @@ -272,7 +272,7 @@ function isInstantiatable(container: Container, fullName: string) { function lookup(container: Container, fullName: string, options: LookupOptions = {}) { let normalizedName = fullName; - if (options.singleton !== false) { + if (options.singleton === true || (options.singleton === undefined && isSingleton(container, fullName))) { let cached = container.cache[normalizedName]; if (cached !== undefined) { return cached; @@ -335,7 +335,7 @@ function isSingletonInstance( return ( singleton !== false && instantiate !== false && - isSingleton(container, fullName) && + (singleton === true || isSingleton(container, fullName)) && isInstantiatable(container, fullName) ); } @@ -359,7 +359,7 @@ function isFactoryInstance( ) { return ( instantiate !== false && - (singleton !== false || isSingleton(container, fullName)) && + (singleton === false || !isSingleton(container, fullName)) && isInstantiatable(container, fullName) ); } @@ -379,6 +379,7 @@ function instantiateFactory( // SomeClass { singleton: true, instantiate: true } | { singleton: true } | { instantiate: true } | {} // By default majority of objects fall into this case if (isSingletonInstance(container, fullName, options)) { + let instance = (container.cache[normalizedName] = factoryManager.create() as CacheMember); // if this lookup happened _during_ destruction (emits a deprecation, but diff --git a/packages/@ember/-internals/container/tests/container_test.js b/packages/@ember/-internals/container/tests/container_test.js index f97ebbb6204..787819b3ba4 100644 --- a/packages/@ember/-internals/container/tests/container_test.js +++ b/packages/@ember/-internals/container/tests/container_test.js @@ -5,6 +5,193 @@ import { DEBUG } from '@glimmer/env'; import { Registry } from '..'; import { factory, moduleFor, AbstractTestCase, runTask } from 'internal-test-helpers'; +moduleFor('Container.lookup', class extends AbstractTestCase { + + ['@test lookup returns a fresh instance if singleton: false is passed as an option']( + assert + ) { + let registry = new Registry(); + let container = registry.container(); + let PostController = factory(); + + registry.register('controller:post', PostController); + + let postController1 = container.lookup('controller:post'); + let postController2 = container.lookup('controller:post', { + singleton: false, + }); + let postController3 = container.lookup('controller:post', { + singleton: false, + }); + let postController4 = container.lookup('controller:post'); + + assert.equal( + postController1.toString(), + postController4.toString(), + 'Singleton factories looked up normally return the same value' + ); + assert.notEqual( + postController1.toString(), + postController2.toString(), + 'Singleton factories are not equal to factories looked up with singleton: false' + ); + assert.notEqual( + postController2.toString(), + postController3.toString(), + 'Two factories looked up with singleton: false are not equal' + ); + assert.notEqual( + postController3.toString(), + postController4.toString(), + 'A singleton factory looked up after a factory called with singleton: false is not equal' + ); + + assert.ok( + postController1 instanceof PostController, + 'All instances are instances of the registered factory' + ); + assert.ok( + postController2 instanceof PostController, + 'All instances are instances of the registered factory' + ); + assert.ok( + postController3 instanceof PostController, + 'All instances are instances of the registered factory' + ); + assert.ok( + postController4 instanceof PostController, + 'All instances are instances of the registered factory' + ); + } + + ['@test lookup returns a fresh instance if singleton: false is passed as an option to lookup']( + assert + ) { + class TestFactory { + constructor(opts) { + Object.assign(this, opts); + } + static create(opts) { + return new this(opts); + } + } + + let registry = new Registry(); + let container = registry.container(); + registry.register('thing:test/obj', TestFactory); + + let instance1 = container.lookup('thing:test/obj'); + let instance2 = container.lookup('thing:test/obj', { + singleton: false, + }); + let instance3 = container.lookup('thing:test/obj', { + singleton: false, + }); + let instance4 = container.lookup('thing:test/obj'); + + assert.ok(instance1 === instance4, 'factories looked up up without singleton: false are the same instance'); + assert.ok(instance1 !== instance2, 'factories looked up with singleton: false are a different instance'); + assert.ok(instance2 !== instance3, 'factories looked up with singleton: false are a different instance'); + assert.ok(instance3 !== instance4, 'factories looked up after a call to singleton: false is a different instance'); + assert.ok( + instance1 instanceof TestFactory, + 'All instances are instances of the registered factory' + ); + assert.ok( + instance2 instanceof TestFactory, + 'All instances are instances of the registered factory' + ); + assert.ok( + instance3 instanceof TestFactory, + 'All instances are instances of the registered factory' + ); + assert.ok( + instance4 instanceof TestFactory, + 'All instances are instances of the registered factory' + ); + } + + ['@test lookup returns a fresh instance if singleton: false is passed as an option to register']( + assert + ) { + class TestFactory { + constructor(opts) { + Object.assign(this, opts); + } + static create(opts) { + return new this(opts); + } + } + + let registry = new Registry(); + let container = registry.container(); + registry.register('thing:test/obj', TestFactory, { singleton: false }); + + let instance1 = container.lookup('thing:test/obj'); + let instance2 = container.lookup('thing:test/obj'); + let instance3 = container.lookup('thing:test/obj'); + + assert.ok(instance1 !== instance2, 'each lookup is a different instance'); + assert.ok(instance2 !== instance3, 'each lookup is a different instance'); + assert.ok(instance1 !== instance3, 'each lookup is a different instance'); + assert.ok( + instance1 instanceof TestFactory, + 'All instances are instances of the registered factory' + ); + assert.ok( + instance2 instanceof TestFactory, + 'All instances are instances of the registered factory' + ); + assert.ok( + instance3 instanceof TestFactory, + 'All instances are instances of the registered factory' + ); + } + + ['@test lookup returns a singleton instance if singleton: true is passed as an option even if registered as singleton: false']( + assert + ) { + class TestFactory { + constructor(opts) { + Object.assign(this, opts); + } + static create(opts) { + return new this(opts); + } + } + + let registry = new Registry(); + let container = registry.container(); + registry.register('thing:test/obj', TestFactory, { singleton: false }); + + let instance1 = container.lookup('thing:test/obj'); + let instance2 = container.lookup('thing:test/obj', { singleton: true }); + let instance3 = container.lookup('thing:test/obj', { singleton: true }); + let instance4 = container.lookup('thing:test/obj'); + + assert.ok(instance1 !== instance2, 'each lookup is a different instance'); + assert.ok(instance2 === instance3, 'each singleton: true lookup is the same instance'); + assert.ok(instance3 !== instance4, 'each lookup is a different instance'); + assert.ok(instance1 !== instance4, 'each lookup is a different instance'); + assert.ok( + instance1 instanceof TestFactory, + 'All instances are instances of the registered factory' + ); + assert.ok( + instance2 instanceof TestFactory, + 'All instances are instances of the registered factory' + ); + assert.ok( + instance3 instanceof TestFactory, + 'All instances are instances of the registered factory' + ); + assert.ok( + instance4 instanceof TestFactory, + 'All instances are instances of the registered factory' + ); + } +}); + moduleFor( 'Container', class extends AbstractTestCase { @@ -45,63 +232,6 @@ moduleFor( ); } - ['@test A registered factory returns a fresh instance if singleton: false is passed as an option']( - assert - ) { - let registry = new Registry(); - let container = registry.container(); - let PostController = factory(); - - registry.register('controller:post', PostController); - - let postController1 = container.lookup('controller:post'); - let postController2 = container.lookup('controller:post', { - singleton: false, - }); - let postController3 = container.lookup('controller:post', { - singleton: false, - }); - let postController4 = container.lookup('controller:post'); - - assert.equal( - postController1.toString(), - postController4.toString(), - 'Singleton factories looked up normally return the same value' - ); - assert.notEqual( - postController1.toString(), - postController2.toString(), - 'Singleton factories are not equal to factories looked up with singleton: false' - ); - assert.notEqual( - postController2.toString(), - postController3.toString(), - 'Two factories looked up with singleton: false are not equal' - ); - assert.notEqual( - postController3.toString(), - postController4.toString(), - 'A singleton factory looked up after a factory called with singleton: false is not equal' - ); - - assert.ok( - postController1 instanceof PostController, - 'All instances are instances of the registered factory' - ); - assert.ok( - postController2 instanceof PostController, - 'All instances are instances of the registered factory' - ); - assert.ok( - postController3 instanceof PostController, - 'All instances are instances of the registered factory' - ); - assert.ok( - postController4 instanceof PostController, - 'All instances are instances of the registered factory' - ); - } - ["@test A factory type with a registered injection's instances receive that injection"]( assert ) { From 02b4e2e08432e1410537d572cb109ac3064b3cfd Mon Sep 17 00:00:00 2001 From: Chris Thoburn Date: Mon, 5 Apr 2021 23:30:59 -0700 Subject: [PATCH 19/61] fix lint (cherry picked from commit 6706b17e9a71895dc3b371cb9885647eff2bd241) --- .../-internals/container/lib/container.ts | 6 +- .../container/tests/container_test.js | 364 +++++++++--------- 2 files changed, 192 insertions(+), 178 deletions(-) diff --git a/packages/@ember/-internals/container/lib/container.ts b/packages/@ember/-internals/container/lib/container.ts index 0c26834bfdb..091203bec0b 100644 --- a/packages/@ember/-internals/container/lib/container.ts +++ b/packages/@ember/-internals/container/lib/container.ts @@ -272,7 +272,10 @@ function isInstantiatable(container: Container, fullName: string) { function lookup(container: Container, fullName: string, options: LookupOptions = {}) { let normalizedName = fullName; - if (options.singleton === true || (options.singleton === undefined && isSingleton(container, fullName))) { + if ( + options.singleton === true || + (options.singleton === undefined && isSingleton(container, fullName)) + ) { let cached = container.cache[normalizedName]; if (cached !== undefined) { return cached; @@ -379,7 +382,6 @@ function instantiateFactory( // SomeClass { singleton: true, instantiate: true } | { singleton: true } | { instantiate: true } | {} // By default majority of objects fall into this case if (isSingletonInstance(container, fullName, options)) { - let instance = (container.cache[normalizedName] = factoryManager.create() as CacheMember); // if this lookup happened _during_ destruction (emits a deprecation, but diff --git a/packages/@ember/-internals/container/tests/container_test.js b/packages/@ember/-internals/container/tests/container_test.js index 787819b3ba4..4fc52d28452 100644 --- a/packages/@ember/-internals/container/tests/container_test.js +++ b/packages/@ember/-internals/container/tests/container_test.js @@ -5,192 +5,204 @@ import { DEBUG } from '@glimmer/env'; import { Registry } from '..'; import { factory, moduleFor, AbstractTestCase, runTask } from 'internal-test-helpers'; -moduleFor('Container.lookup', class extends AbstractTestCase { - - ['@test lookup returns a fresh instance if singleton: false is passed as an option']( - assert - ) { - let registry = new Registry(); - let container = registry.container(); - let PostController = factory(); - - registry.register('controller:post', PostController); - - let postController1 = container.lookup('controller:post'); - let postController2 = container.lookup('controller:post', { - singleton: false, - }); - let postController3 = container.lookup('controller:post', { - singleton: false, - }); - let postController4 = container.lookup('controller:post'); - - assert.equal( - postController1.toString(), - postController4.toString(), - 'Singleton factories looked up normally return the same value' - ); - assert.notEqual( - postController1.toString(), - postController2.toString(), - 'Singleton factories are not equal to factories looked up with singleton: false' - ); - assert.notEqual( - postController2.toString(), - postController3.toString(), - 'Two factories looked up with singleton: false are not equal' - ); - assert.notEqual( - postController3.toString(), - postController4.toString(), - 'A singleton factory looked up after a factory called with singleton: false is not equal' - ); - - assert.ok( - postController1 instanceof PostController, - 'All instances are instances of the registered factory' - ); - assert.ok( - postController2 instanceof PostController, - 'All instances are instances of the registered factory' - ); - assert.ok( - postController3 instanceof PostController, - 'All instances are instances of the registered factory' - ); - assert.ok( - postController4 instanceof PostController, - 'All instances are instances of the registered factory' - ); - } +moduleFor( + 'Container.lookup', + class extends AbstractTestCase { + ['@test lookup returns a fresh instance if singleton: false is passed as an option'](assert) { + let registry = new Registry(); + let container = registry.container(); + let PostController = factory(); - ['@test lookup returns a fresh instance if singleton: false is passed as an option to lookup']( - assert - ) { - class TestFactory { - constructor(opts) { - Object.assign(this, opts); - } - static create(opts) { - return new this(opts); - } - } + registry.register('controller:post', PostController); - let registry = new Registry(); - let container = registry.container(); - registry.register('thing:test/obj', TestFactory); - - let instance1 = container.lookup('thing:test/obj'); - let instance2 = container.lookup('thing:test/obj', { - singleton: false, - }); - let instance3 = container.lookup('thing:test/obj', { - singleton: false, - }); - let instance4 = container.lookup('thing:test/obj'); - - assert.ok(instance1 === instance4, 'factories looked up up without singleton: false are the same instance'); - assert.ok(instance1 !== instance2, 'factories looked up with singleton: false are a different instance'); - assert.ok(instance2 !== instance3, 'factories looked up with singleton: false are a different instance'); - assert.ok(instance3 !== instance4, 'factories looked up after a call to singleton: false is a different instance'); - assert.ok( - instance1 instanceof TestFactory, - 'All instances are instances of the registered factory' - ); - assert.ok( - instance2 instanceof TestFactory, - 'All instances are instances of the registered factory' - ); - assert.ok( - instance3 instanceof TestFactory, - 'All instances are instances of the registered factory' - ); - assert.ok( - instance4 instanceof TestFactory, - 'All instances are instances of the registered factory' - ); - } + let postController1 = container.lookup('controller:post'); + let postController2 = container.lookup('controller:post', { + singleton: false, + }); + let postController3 = container.lookup('controller:post', { + singleton: false, + }); + let postController4 = container.lookup('controller:post'); - ['@test lookup returns a fresh instance if singleton: false is passed as an option to register']( - assert - ) { - class TestFactory { - constructor(opts) { - Object.assign(this, opts); - } - static create(opts) { - return new this(opts); - } - } + assert.equal( + postController1.toString(), + postController4.toString(), + 'Singleton factories looked up normally return the same value' + ); + assert.notEqual( + postController1.toString(), + postController2.toString(), + 'Singleton factories are not equal to factories looked up with singleton: false' + ); + assert.notEqual( + postController2.toString(), + postController3.toString(), + 'Two factories looked up with singleton: false are not equal' + ); + assert.notEqual( + postController3.toString(), + postController4.toString(), + 'A singleton factory looked up after a factory called with singleton: false is not equal' + ); - let registry = new Registry(); - let container = registry.container(); - registry.register('thing:test/obj', TestFactory, { singleton: false }); - - let instance1 = container.lookup('thing:test/obj'); - let instance2 = container.lookup('thing:test/obj'); - let instance3 = container.lookup('thing:test/obj'); - - assert.ok(instance1 !== instance2, 'each lookup is a different instance'); - assert.ok(instance2 !== instance3, 'each lookup is a different instance'); - assert.ok(instance1 !== instance3, 'each lookup is a different instance'); - assert.ok( - instance1 instanceof TestFactory, - 'All instances are instances of the registered factory' - ); - assert.ok( - instance2 instanceof TestFactory, - 'All instances are instances of the registered factory' - ); - assert.ok( - instance3 instanceof TestFactory, - 'All instances are instances of the registered factory' - ); - } + assert.ok( + postController1 instanceof PostController, + 'All instances are instances of the registered factory' + ); + assert.ok( + postController2 instanceof PostController, + 'All instances are instances of the registered factory' + ); + assert.ok( + postController3 instanceof PostController, + 'All instances are instances of the registered factory' + ); + assert.ok( + postController4 instanceof PostController, + 'All instances are instances of the registered factory' + ); + } - ['@test lookup returns a singleton instance if singleton: true is passed as an option even if registered as singleton: false']( - assert - ) { - class TestFactory { - constructor(opts) { - Object.assign(this, opts); + ['@test lookup returns a fresh instance if singleton: false is passed as an option to lookup']( + assert + ) { + class TestFactory { + constructor(opts) { + Object.assign(this, opts); + } + static create(opts) { + return new this(opts); + } } - static create(opts) { - return new this(opts); + + let registry = new Registry(); + let container = registry.container(); + registry.register('thing:test/obj', TestFactory); + + let instance1 = container.lookup('thing:test/obj'); + let instance2 = container.lookup('thing:test/obj', { + singleton: false, + }); + let instance3 = container.lookup('thing:test/obj', { + singleton: false, + }); + let instance4 = container.lookup('thing:test/obj'); + + assert.ok( + instance1 === instance4, + 'factories looked up up without singleton: false are the same instance' + ); + assert.ok( + instance1 !== instance2, + 'factories looked up with singleton: false are a different instance' + ); + assert.ok( + instance2 !== instance3, + 'factories looked up with singleton: false are a different instance' + ); + assert.ok( + instance3 !== instance4, + 'factories looked up after a call to singleton: false is a different instance' + ); + assert.ok( + instance1 instanceof TestFactory, + 'All instances are instances of the registered factory' + ); + assert.ok( + instance2 instanceof TestFactory, + 'All instances are instances of the registered factory' + ); + assert.ok( + instance3 instanceof TestFactory, + 'All instances are instances of the registered factory' + ); + assert.ok( + instance4 instanceof TestFactory, + 'All instances are instances of the registered factory' + ); + } + + ['@test lookup returns a fresh instance if singleton: false is passed as an option to register']( + assert + ) { + class TestFactory { + constructor(opts) { + Object.assign(this, opts); + } + static create(opts) { + return new this(opts); + } } + + let registry = new Registry(); + let container = registry.container(); + registry.register('thing:test/obj', TestFactory, { singleton: false }); + + let instance1 = container.lookup('thing:test/obj'); + let instance2 = container.lookup('thing:test/obj'); + let instance3 = container.lookup('thing:test/obj'); + + assert.ok(instance1 !== instance2, 'each lookup is a different instance'); + assert.ok(instance2 !== instance3, 'each lookup is a different instance'); + assert.ok(instance1 !== instance3, 'each lookup is a different instance'); + assert.ok( + instance1 instanceof TestFactory, + 'All instances are instances of the registered factory' + ); + assert.ok( + instance2 instanceof TestFactory, + 'All instances are instances of the registered factory' + ); + assert.ok( + instance3 instanceof TestFactory, + 'All instances are instances of the registered factory' + ); } - let registry = new Registry(); - let container = registry.container(); - registry.register('thing:test/obj', TestFactory, { singleton: false }); - - let instance1 = container.lookup('thing:test/obj'); - let instance2 = container.lookup('thing:test/obj', { singleton: true }); - let instance3 = container.lookup('thing:test/obj', { singleton: true }); - let instance4 = container.lookup('thing:test/obj'); - - assert.ok(instance1 !== instance2, 'each lookup is a different instance'); - assert.ok(instance2 === instance3, 'each singleton: true lookup is the same instance'); - assert.ok(instance3 !== instance4, 'each lookup is a different instance'); - assert.ok(instance1 !== instance4, 'each lookup is a different instance'); - assert.ok( - instance1 instanceof TestFactory, - 'All instances are instances of the registered factory' - ); - assert.ok( - instance2 instanceof TestFactory, - 'All instances are instances of the registered factory' - ); - assert.ok( - instance3 instanceof TestFactory, - 'All instances are instances of the registered factory' - ); - assert.ok( - instance4 instanceof TestFactory, - 'All instances are instances of the registered factory' - ); + ['@test lookup returns a singleton instance if singleton: true is passed as an option even if registered as singleton: false']( + assert + ) { + class TestFactory { + constructor(opts) { + Object.assign(this, opts); + } + static create(opts) { + return new this(opts); + } + } + + let registry = new Registry(); + let container = registry.container(); + registry.register('thing:test/obj', TestFactory, { singleton: false }); + + let instance1 = container.lookup('thing:test/obj'); + let instance2 = container.lookup('thing:test/obj', { singleton: true }); + let instance3 = container.lookup('thing:test/obj', { singleton: true }); + let instance4 = container.lookup('thing:test/obj'); + + assert.ok(instance1 !== instance2, 'each lookup is a different instance'); + assert.ok(instance2 === instance3, 'each singleton: true lookup is the same instance'); + assert.ok(instance3 !== instance4, 'each lookup is a different instance'); + assert.ok(instance1 !== instance4, 'each lookup is a different instance'); + assert.ok( + instance1 instanceof TestFactory, + 'All instances are instances of the registered factory' + ); + assert.ok( + instance2 instanceof TestFactory, + 'All instances are instances of the registered factory' + ); + assert.ok( + instance3 instanceof TestFactory, + 'All instances are instances of the registered factory' + ); + assert.ok( + instance4 instanceof TestFactory, + 'All instances are instances of the registered factory' + ); + } } -}); +); moduleFor( 'Container', From df6636a7c8aa4a08461540fc292288671c5c5d81 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Thu, 27 May 2021 10:40:16 -0400 Subject: [PATCH 20/61] Add v3.27.2 to CHANGELOG.md. --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f567da99d34..33ae1dedbe1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,16 @@ - [#19472](https://github.com/emberjs/ember.js/pull/19472) [BUGFIX] Prevent transformation of block params called `attrs` +### v3.27.2 (May 27, 2021) + +- [#19511](https://github.com/emberjs/ember.js/pull/19511) / [#19548](https://github.com/emberjs/ember.js/pull/19548) [BUGFIX] Makes the (hash) helper lazy +- [#19530](https://github.com/emberjs/ember.js/pull/19530) [DOC] fix passing params to named blocks examples +- [#19536](https://github.com/emberjs/ember.js/pull/19536) [BUGFIX] Fix `computed.*` deprecation message to include the correct import path +- [#19544](https://github.com/emberjs/ember.js/pull/19544) [BUGFIX] Use explicit this in helper test blueprints +- [#19555](https://github.com/emberjs/ember.js/pull/19555) [BUGFIX] Improve class based tranform deprecation message +- [#19557](https://github.com/emberjs/ember.js/pull/19557) [BUGFIX] Refine Ember Global deprecation message +- [#19564](https://github.com/emberjs/ember.js/pull/19564) [BUGFIX] Improve computed.* and run.* deprecation message (IE11) + ### v3.27.1 (May 13, 2021) - [#19540](https://github.com/emberjs/ember.js/pull/19540) [BUGFIX] Ensure ember-testing is loaded lazily From c203d79cc01bfbaedd08ac4161fbb22c32ae5abc Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Thu, 27 May 2021 10:45:09 -0400 Subject: [PATCH 21/61] Add v3.28.0-beta.2 to CHANGELOG.md. --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 33ae1dedbe1..00fcb41871b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Ember Changelog +### v3.28.0-beta.2 (May 27, 2021) + +- [#19511](https://github.com/emberjs/ember.js/pull/19511) / [#19548](https://github.com/emberjs/ember.js/pull/19548) [BUGFIX] Makes the (hash) helper lazy +- [#19530](https://github.com/emberjs/ember.js/pull/19530) [DOC] fix passing params to named blocks examples +- [#19536](https://github.com/emberjs/ember.js/pull/19536) [BUGFIX] Fix `computed.*` deprecation message to include the correct import path +- [#19544](https://github.com/emberjs/ember.js/pull/19544) [BUGFIX] Use explicit this in helper test blueprints +- [#19555](https://github.com/emberjs/ember.js/pull/19555) [BUGFIX] Improve class based tranform deprecation message +- [#19557](https://github.com/emberjs/ember.js/pull/19557) [BUGFIX] Refine Ember Global deprecation message +- [#19564](https://github.com/emberjs/ember.js/pull/19564) [BUGFIX] Improve computed.* and run.* deprecation message (IE11) +- [#19491](https://github.com/emberjs/ember.js/pull/19491) [BUGFIX] Fix `owner.lookup` `owner.register` behavior with `singleton: true` option + ### v3.28.0-beta.1 (May 3, 2021) - [#19472](https://github.com/emberjs/ember.js/pull/19472) [BUGFIX] Prevent transformation of block params called `attrs` From 5f368b0a29e31cbdf904c5d430a337135e914ac0 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Thu, 27 May 2021 10:45:25 -0400 Subject: [PATCH 22/61] 3.28.0-beta.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 37900e9a9f5..e5b0eee5e34 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ember-source", - "version": "3.28.0-beta.1", + "version": "3.28.0-beta.2", "description": "A JavaScript framework for creating ambitious web applications", "keywords": [ "ember-addon" From a4099ea0926bdb25ec2dc05e5fd0f8b5cfca5db8 Mon Sep 17 00:00:00 2001 From: Chris Garrett Date: Thu, 27 May 2021 07:57:32 -0700 Subject: [PATCH 23/61] [BUGFIX lts] Ensures that computed can depend on dynamic hash keys Ensures that computeds can depend on dynamic hash keys that did not exist on the original hash. (cherry picked from commit 628a928fa24cbfef3a26c72f69fac9687d66dc9f) --- package.json | 26 +- .../tests/integration/helpers/hash-test.js | 54 ++++ yarn.lock | 252 +++++++++--------- 3 files changed, 193 insertions(+), 139 deletions(-) diff --git a/package.json b/package.json index e5b0eee5e34..47a71e7d066 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "@babel/plugin-transform-block-scoping": "^7.8.3", "@babel/plugin-transform-object-assign": "^7.8.3", "@ember/edition-utils": "^1.2.0", - "@glimmer/vm-babel-plugins": "0.79.2", + "@glimmer/vm-babel-plugins": "0.79.3", "babel-plugin-debug-macros": "^0.3.3", "babel-plugin-filter-imports": "^4.0.0", "broccoli-concat": "^4.2.4", @@ -75,19 +75,19 @@ }, "devDependencies": { "@babel/preset-env": "^7.9.5", - "@glimmer/compiler": "0.79.2", - "@glimmer/destroyable": "0.79.2", + "@glimmer/compiler": "0.79.3", + "@glimmer/destroyable": "0.79.3", "@glimmer/env": "^0.1.7", - "@glimmer/global-context": "0.79.2", - "@glimmer/interfaces": "0.79.2", - "@glimmer/manager": "0.79.2", - "@glimmer/node": "0.79.2", - "@glimmer/opcode-compiler": "0.79.2", - "@glimmer/owner": "0.79.2", - "@glimmer/program": "0.79.2", - "@glimmer/reference": "0.79.2", - "@glimmer/runtime": "0.79.2", - "@glimmer/validator": "0.79.2", + "@glimmer/global-context": "0.79.3", + "@glimmer/interfaces": "0.79.3", + "@glimmer/manager": "0.79.3", + "@glimmer/node": "0.79.3", + "@glimmer/opcode-compiler": "0.79.3", + "@glimmer/owner": "0.79.3", + "@glimmer/program": "0.79.3", + "@glimmer/reference": "0.79.3", + "@glimmer/runtime": "0.79.3", + "@glimmer/validator": "0.79.3", "@simple-dom/document": "^1.4.0", "@types/qunit": "^2.11.1", "@types/rsvp": "^4.0.3", diff --git a/packages/@ember/-internals/glimmer/tests/integration/helpers/hash-test.js b/packages/@ember/-internals/glimmer/tests/integration/helpers/hash-test.js index 3cd67140fd5..9b3cd24b1a1 100644 --- a/packages/@ember/-internals/glimmer/tests/integration/helpers/hash-test.js +++ b/packages/@ember/-internals/glimmer/tests/integration/helpers/hash-test.js @@ -219,6 +219,60 @@ moduleFor( this.assertText('Godfrey Chan'); } + ['@test works with computeds on non-defined properties']() { + let instance; + + let FooBarComponent = Component.extend({ + init() { + this._super(...arguments); + + if (HAS_NATIVE_PROXY) { + expectDeprecation(() => { + set(this.hash, 'lastName', 'Hietala'); + }, /You set the '.*' property on a {{hash}} object/); + } else { + set(this.hash, 'lastName', 'Hietala'); + } + + instance = this; + }, + + fullName: computed('hash.firstName', 'hash.lastName', function () { + return `${this.hash.firstName} ${this.hash.lastName}`; + }), + }); + + this.registerComponent('foo-bar', { + ComponentClass: FooBarComponent, + template: `{{this.fullName}}`, + }); + + this.render(`{{foo-bar hash=(hash firstName=this.firstName)}}`, { + firstName: 'Chad', + lastName: 'Hietala', + }); + + this.assertText('Chad Hietala'); + + runTask(() => this.rerender()); + + this.assertText('Chad Hietala'); + + runTask(() => { + set(this.context, 'firstName', 'Godfrey'); + + if (HAS_NATIVE_PROXY) { + expectDeprecation(() => { + set(instance.hash, 'lastName', 'Chan'); + }, /You set the '.*' property on a {{hash}} object/); + } else { + set(instance.hash, 'lastName', 'Chan'); + } + }); + + this.assertText('Godfrey Chan'); + } + ['@test works when properties are set dynamically']() { let fooBarInstance; let FooBarComponent = Component.extend({ diff --git a/yarn.lock b/yarn.lock index 5c8aac9ddee..c0988a35c33 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1588,52 +1588,52 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" -"@glimmer/compiler@0.79.2": - version "0.79.2" - resolved "https://registry.yarnpkg.com/@glimmer/compiler/-/compiler-0.79.2.tgz#b874e59de7ad3317c6c28dd781dbc8c08a5942b4" - integrity sha512-FbN9/lJyRHOmy4bBPqU/TdiPhN/dSIEJA6Y0dyAu03zuHJqBMd5rtHLm1CRdII9dDwU6T6B09aDlsBBAt8FQcA== - dependencies: - "@glimmer/interfaces" "0.79.2" - "@glimmer/syntax" "0.79.2" - "@glimmer/util" "0.79.2" - "@glimmer/wire-format" "0.79.2" +"@glimmer/compiler@0.79.3": + version "0.79.3" + resolved "https://registry.yarnpkg.com/@glimmer/compiler/-/compiler-0.79.3.tgz#fc68770fe50df0eab0aee0331f40ff26a8ce4763" + integrity sha512-eGuZg/6C9ITUZJswpiIElfTQ9P9zQoZccrwfFyoc6QQRcwPCGkfgLpbAjnOCHON/HNsq8Aa+2iswJzAuVyz4QA== + dependencies: + "@glimmer/interfaces" "0.79.3" + "@glimmer/syntax" "0.79.3" + "@glimmer/util" "0.79.3" + "@glimmer/wire-format" "0.79.3" "@simple-dom/interface" "^1.4.0" -"@glimmer/destroyable@0.79.2": - version "0.79.2" - resolved "https://registry.yarnpkg.com/@glimmer/destroyable/-/destroyable-0.79.2.tgz#50b473483d2d45fb3fa12a28719495af683dd695" - integrity sha512-owBXBWHQuLN5lzbG+3yzupnTGQj6ttPAx0KTCiUBfH0BpE7tKx+w52MA87bt5GJRX+RS0g57Z1DLQy2yLavfFQ== +"@glimmer/destroyable@0.79.3": + version "0.79.3" + resolved "https://registry.yarnpkg.com/@glimmer/destroyable/-/destroyable-0.79.3.tgz#a4ee01a5ef7f9e0a5e62668fb992d721c193acd4" + integrity sha512-vAvXi/eh6ca0Upqzqg+y/dsiFzHsh4La1J8oCSv33BXhbjoVWp+V++FaEYoGy4E8/gaDdt9fW8xZOvgBSoIBZw== dependencies: "@glimmer/env" "0.1.7" - "@glimmer/global-context" "0.79.2" - "@glimmer/interfaces" "0.79.2" - "@glimmer/util" "0.79.2" + "@glimmer/global-context" "0.79.3" + "@glimmer/interfaces" "0.79.3" + "@glimmer/util" "0.79.3" -"@glimmer/encoder@0.79.2": - version "0.79.2" - resolved "https://registry.yarnpkg.com/@glimmer/encoder/-/encoder-0.79.2.tgz#e3e3ebc85ba210cffdb4c66dd4bdd2e07d864dad" - integrity sha512-MqFWJ4rGcikk27iUOkHc2vtnC+cVO2XBQHk6m+T5LEkLHFEC0JEDSj+POxHoHnkjXi8BxbxUxxOptz85p0LGWg== +"@glimmer/encoder@0.79.3": + version "0.79.3" + resolved "https://registry.yarnpkg.com/@glimmer/encoder/-/encoder-0.79.3.tgz#7f4d957b8c948d04b8594c20ba131701a1bf9453" + integrity sha512-BpZqJOPpIYQyDGR/OtgE9jbjNd47DBo5L/CJmQ1PYZ11QUM5DMUHuxpIxWKKT2JpzYJfPE2xdvYrhJrCUC0Zfg== dependencies: "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.79.2" - "@glimmer/vm" "0.79.2" + "@glimmer/interfaces" "0.79.3" + "@glimmer/vm" "0.79.3" "@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.79.2": - version "0.79.2" - resolved "https://registry.yarnpkg.com/@glimmer/global-context/-/global-context-0.79.2.tgz#970276f1c7c44d34b4bd619709de78b1f46fabaf" - integrity sha512-Cwna7I28+6amQd+n4/6sc8PccI3cyk/fIWoxzOKBTA0AqJp/HetiE2IvLQI97VCx/Rv338IINzIu4JlfymWnXA== +"@glimmer/global-context@0.79.3": + version "0.79.3" + resolved "https://registry.yarnpkg.com/@glimmer/global-context/-/global-context-0.79.3.tgz#e50fcfa598a6d9e58a9fba1586efed6d789fe24b" + integrity sha512-Aotq1fbYKk8CElF4x1nYJWGufXu7CS/iYUfrpX9v1zIjZMw52tfk1xTlNyRCpM1SCHuUL32QEskGAPDLsIYkVw== dependencies: "@glimmer/env" "^0.1.7" -"@glimmer/interfaces@0.79.2": - version "0.79.2" - resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.79.2.tgz#387d11f69ced699e2a227ab9095bd9970829cbf5" - integrity sha512-2+CulmZ5XV3Mq2xG4qYPCcA8LVZq76OixdyLHvkGLEvwFx1J2gixcKK0+KNc0dr+Iia6Ebmu9sntulFCRguMgw== +"@glimmer/interfaces@0.79.3": + version "0.79.3" + resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.79.3.tgz#4e0a3ff9cf0b60bdab1a4d420f641ab540d4fc85" + integrity sha512-EFiNKwehbxm1xRsfnNu/5nu8Rw+0IYINL/Hciwl/28T8an7FOxftpy/iXXSaWvIsnPyBHqH1ufwsKYY6KXyNzg== dependencies: "@simple-dom/interface" "^1.4.0" @@ -1642,140 +1642,140 @@ resolved "https://registry.yarnpkg.com/@glimmer/low-level/-/low-level-0.78.2.tgz#bca5f666760ce98345e87c5b3e37096e772cb2de" integrity sha512-0S6TWOOd0fzLLysw1pWZN0TgasaHmYs1Sjz9Til1mTByIXU1S+1rhdyr2veSQPO/aRjPuEQyKXZQHvx23Zax6w== -"@glimmer/manager@0.79.2": - version "0.79.2" - resolved "https://registry.yarnpkg.com/@glimmer/manager/-/manager-0.79.2.tgz#6b5a5d393483522636bc4c4b34604246950b7b08" - integrity sha512-1lzO8Ud7cJWmBaM7lru8dJvtgivzE5mEhkd7LwfLc/UPNNCOHY/fkfypPr0/C2nQLksVLnMB28pDsQThqoGmZQ== +"@glimmer/manager@0.79.3": + version "0.79.3" + resolved "https://registry.yarnpkg.com/@glimmer/manager/-/manager-0.79.3.tgz#02dc843bd6cbc1d5b32321029a8b250c33edc1fa" + integrity sha512-VhIXX9oxrLABuA34iZrrMxwhbxRJCftPyEXyD2ZNwsr9QugtAg2cYvtIWxlf9RllTACJrSU7Gb+0BPYVG+aaaQ== dependencies: - "@glimmer/destroyable" "0.79.2" + "@glimmer/destroyable" "0.79.3" "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.79.2" - "@glimmer/reference" "0.79.2" - "@glimmer/util" "0.79.2" - "@glimmer/validator" "0.79.2" - -"@glimmer/node@0.79.2": - version "0.79.2" - resolved "https://registry.yarnpkg.com/@glimmer/node/-/node-0.79.2.tgz#7ead836a2ff17273ddd37351c9f6470f17a60f1e" - integrity sha512-2NcWC1PzF/Ru8Xr3h8cuGUumauZMLbyTo24wzJDFCruoMIpizbxcBWGVHuFnH1Cdg8e+fu6eICsCaItVvoJNIw== - dependencies: - "@glimmer/interfaces" "0.79.2" - "@glimmer/runtime" "0.79.2" - "@glimmer/util" "0.79.2" + "@glimmer/interfaces" "0.79.3" + "@glimmer/reference" "0.79.3" + "@glimmer/util" "0.79.3" + "@glimmer/validator" "0.79.3" + +"@glimmer/node@0.79.3": + version "0.79.3" + resolved "https://registry.yarnpkg.com/@glimmer/node/-/node-0.79.3.tgz#536457cc016b5c9788088dac8366fef9c98b7fff" + integrity sha512-iNC+TnEvKPRLFNQ6YJOH10NSAHVa7/aCejD+wR8BeOSBq1bbPQTmuQTluKRIwjDww+Np68SEjQ7Wkzvp2Lnivw== + dependencies: + "@glimmer/interfaces" "0.79.3" + "@glimmer/runtime" "0.79.3" + "@glimmer/util" "0.79.3" "@simple-dom/document" "^1.4.0" "@simple-dom/interface" "^1.4.0" -"@glimmer/opcode-compiler@0.79.2": - version "0.79.2" - resolved "https://registry.yarnpkg.com/@glimmer/opcode-compiler/-/opcode-compiler-0.79.2.tgz#997fc9cb559512afc7eb059d80e27ca58009a715" - integrity sha512-sXqzgYfK06ZSHzvVq0ChTx8C/2+A33E3se53wfODXZ88XAGyalTX9U2tHbfKIk3tgOUuMncNfT02NFRDZ/KnmA== +"@glimmer/opcode-compiler@0.79.3": + version "0.79.3" + resolved "https://registry.yarnpkg.com/@glimmer/opcode-compiler/-/opcode-compiler-0.79.3.tgz#dc27d49d4236060b650e41f16526fd136e7a5d17" + integrity sha512-1SDl6YQ/xYAuYD/P70YHkoKri0YZSG8ELx9n1ZKVr1sB0xv6tiIrYOyhhy+omlmcRSQwWd0XEDp/4eeb7UNjlQ== dependencies: - "@glimmer/encoder" "0.79.2" + "@glimmer/encoder" "0.79.3" "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.79.2" - "@glimmer/reference" "0.79.2" - "@glimmer/util" "0.79.2" - "@glimmer/vm" "0.79.2" - "@glimmer/wire-format" "0.79.2" + "@glimmer/interfaces" "0.79.3" + "@glimmer/reference" "0.79.3" + "@glimmer/util" "0.79.3" + "@glimmer/vm" "0.79.3" + "@glimmer/wire-format" "0.79.3" -"@glimmer/owner@0.79.2": - version "0.79.2" - resolved "https://registry.yarnpkg.com/@glimmer/owner/-/owner-0.79.2.tgz#562805781e235388a17f15c69ae72e834d680325" - integrity sha512-W5ZejPXyKWeCJF+6+Rv3+mkCJ56eLv+gtesggaVosbXwgL6QnUySjOdvTOwZ++HUYm6WCLognnO+XNzV25oHcQ== +"@glimmer/owner@0.79.3": + version "0.79.3" + resolved "https://registry.yarnpkg.com/@glimmer/owner/-/owner-0.79.3.tgz#0c8aeea009bf2e01653e8419754d7b8ea57607c2" + integrity sha512-vEybTpdeiaDHqRX8TaNAIz7fNlE0lii4kPTxl04me8H3YAE3nKluUxgoChWMRcgakGJ8bCzVa7p215Ap/6ULtg== dependencies: - "@glimmer/util" "0.79.2" + "@glimmer/util" "0.79.3" -"@glimmer/program@0.79.2": - version "0.79.2" - resolved "https://registry.yarnpkg.com/@glimmer/program/-/program-0.79.2.tgz#755c50144ddc9b8aacf47082347552ec86207217" - integrity sha512-w2xI7Wz7CHx1HS49c6yZToa7XX29vhO+ydWJabMWqoaktvOTBFKZPfwVLIS7mjIe3rwQVose+VIUmbQ1IzwCQg== +"@glimmer/program@0.79.3": + version "0.79.3" + resolved "https://registry.yarnpkg.com/@glimmer/program/-/program-0.79.3.tgz#f77b8e81842a7b3cf8a1063fc3167d2cd82d9724" + integrity sha512-vIhBlnpt+czkgJhm/OrVcrxbwxgEue6H8UMSoc5vdNiJDHUWOrYdJhr1mh1DGgvM0qqPySKJhgjo3apmA5sW+w== dependencies: - "@glimmer/encoder" "0.79.2" + "@glimmer/encoder" "0.79.3" "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.79.2" - "@glimmer/manager" "0.79.2" - "@glimmer/opcode-compiler" "0.79.2" - "@glimmer/util" "0.79.2" + "@glimmer/interfaces" "0.79.3" + "@glimmer/manager" "0.79.3" + "@glimmer/opcode-compiler" "0.79.3" + "@glimmer/util" "0.79.3" -"@glimmer/reference@0.79.2": - version "0.79.2" - resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.79.2.tgz#070c16268dc22341aa6ffd30b6dee88cd9cf63d4" - integrity sha512-OobgRrcegj88E8peRHnb1KilCemEK2hF89diUkpnQAO7rOTQknnbyzxO3UgVgm/arEcW4+Ga6T+sirumJ5bKIA== +"@glimmer/reference@0.79.3": + version "0.79.3" + resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.79.3.tgz#4c3eed5e2c810c43145a68cb2fa4f337f0b154b8" + integrity sha512-c++SMUVBzpTxd7W9LF2GvCwYIiLPbdrh6kmqOEprH9v/jt4gJkagSBCl84/t6m4NPOYIql19NpK3QqfVSxTDIA== dependencies: "@glimmer/env" "^0.1.7" - "@glimmer/global-context" "0.79.2" - "@glimmer/interfaces" "0.79.2" - "@glimmer/util" "0.79.2" - "@glimmer/validator" "0.79.2" + "@glimmer/global-context" "0.79.3" + "@glimmer/interfaces" "0.79.3" + "@glimmer/util" "0.79.3" + "@glimmer/validator" "0.79.3" -"@glimmer/runtime@0.79.2": - version "0.79.2" - resolved "https://registry.yarnpkg.com/@glimmer/runtime/-/runtime-0.79.2.tgz#93d0285db9d19313a0d477548e4d4af880701bcc" - integrity sha512-FFjDVR1JQaczO+wIRudhCwAeRKUjXB+ZqhOskSEboGbVjSq4v9nxooYVf+np5SEpwPNvlqX6lEW6H7/nfusv0Q== +"@glimmer/runtime@0.79.3": + version "0.79.3" + resolved "https://registry.yarnpkg.com/@glimmer/runtime/-/runtime-0.79.3.tgz#1ff2051e22eff68fe27f536059484a7b0a70fdb9" + integrity sha512-3GO48ddGTuQQIe/16Y4hLDiweTVdLCIn7q6fpzHf+B/ieoVhxu8YkyKYgGEex3UHz+C+GkJxW1hru4cfp0APmA== dependencies: - "@glimmer/destroyable" "0.79.2" + "@glimmer/destroyable" "0.79.3" "@glimmer/env" "0.1.7" - "@glimmer/global-context" "0.79.2" - "@glimmer/interfaces" "0.79.2" + "@glimmer/global-context" "0.79.3" + "@glimmer/interfaces" "0.79.3" "@glimmer/low-level" "0.78.2" - "@glimmer/owner" "0.79.2" - "@glimmer/program" "0.79.2" - "@glimmer/reference" "0.79.2" - "@glimmer/util" "0.79.2" - "@glimmer/validator" "0.79.2" - "@glimmer/vm" "0.79.2" - "@glimmer/wire-format" "0.79.2" + "@glimmer/owner" "0.79.3" + "@glimmer/program" "0.79.3" + "@glimmer/reference" "0.79.3" + "@glimmer/util" "0.79.3" + "@glimmer/validator" "0.79.3" + "@glimmer/vm" "0.79.3" + "@glimmer/wire-format" "0.79.3" "@simple-dom/interface" "^1.4.0" -"@glimmer/syntax@0.79.2": - version "0.79.2" - resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.79.2.tgz#fcd6e742860ca39230043969fb04644d5cc6a5c9" - integrity sha512-65ZXxIM38EMKESWgvTU31ouZiQAELRO/LmOfzTJZlYH5LhSAZWSQ7tatYXDrcjPoiDojLO0a16WccZggM1etmg== +"@glimmer/syntax@0.79.3": + version "0.79.3" + resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.79.3.tgz#5beadd53494d0f199b83f016af90fa28c3ecaa8c" + integrity sha512-IERTn/mqRk0pZnddAnYjGUV4e93rRf5scY0dYQl2EFvBHFaOdFQPe3fhSCozx0hZpagg5LCOsbRgsMwL9IT9fw== dependencies: - "@glimmer/interfaces" "0.79.2" - "@glimmer/util" "0.79.2" + "@glimmer/interfaces" "0.79.3" + "@glimmer/util" "0.79.3" "@handlebars/parser" "~2.0.0" simple-html-tokenizer "^0.5.10" -"@glimmer/util@0.79.2": - version "0.79.2" - resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.79.2.tgz#7c8e1684f1ad48430b7ed64a2319051b5975ccf9" - integrity sha512-jELDUEoNx0CCHboHFdinQu8W5ye5a7kW6fyR4Pb0zN4PPHKybOjieE6jf5l60R0pBGyqU8W8/S+CeiNgM/AU8g== +"@glimmer/util@0.79.3": + version "0.79.3" + resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.79.3.tgz#a54f0383d8e83ca43625e289fe1df6c72ccfb938" + integrity sha512-SVHHA6blGzIM6ZMJErqvzqsapYEsN5hXyobJl+lQAAzBKvaExc7VHQfs10267HxA9WlMNLuu83+tYOu+UR67hA== dependencies: "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.79.2" + "@glimmer/interfaces" "0.79.3" "@simple-dom/interface" "^1.4.0" -"@glimmer/validator@0.79.2": - version "0.79.2" - resolved "https://registry.yarnpkg.com/@glimmer/validator/-/validator-0.79.2.tgz#b132673925ce79842b4c4ef1ecbf170aa3c0daa7" - integrity sha512-BtSp/izgnhZHPC2onEKa4H+v6ovaq6snwLQcWHPtoenVpn5Y7KbwSy6qSuW5+NaW+XaO3ryvJbZYlDB3dDGuTw== +"@glimmer/validator@0.79.3": + version "0.79.3" + resolved "https://registry.yarnpkg.com/@glimmer/validator/-/validator-0.79.3.tgz#1edde5e874629b91a04c5af316b9ba91ecb360ed" + integrity sha512-uXUf24RCqj48T2Hgo6ZXfwAGkBgEOQ2W/Bagg83hBv/4TbUWNt03cHq6ga2FPKpqR/T7SvhN9WM4nc5FqIYGCQ== dependencies: "@glimmer/env" "^0.1.7" - "@glimmer/global-context" "0.79.2" + "@glimmer/global-context" "0.79.3" -"@glimmer/vm-babel-plugins@0.79.2": - version "0.79.2" - resolved "https://registry.yarnpkg.com/@glimmer/vm-babel-plugins/-/vm-babel-plugins-0.79.2.tgz#8fa4af60c5089977690ee501c7b358c90b8d6bc5" - integrity sha512-c5XQQwM8iogT1mdE/U2+UuGsiFmhP4d53lgXOAq1DQ2/AMFlAXa5djMVETDUlncvLLlo6S3Iaj/FvpqTxwqn2g== +"@glimmer/vm-babel-plugins@0.79.3": + version "0.79.3" + resolved "https://registry.yarnpkg.com/@glimmer/vm-babel-plugins/-/vm-babel-plugins-0.79.3.tgz#a8e6949f8ecc10786831d188f1001eb80927297f" + integrity sha512-346xmhP7J3wqCFKqIlwcaui/A+iHKm0ZWoaKb4lIkuro7/u5j094eEtdbonGq4eTj+UnDPpmzuqLWodXXxxo1Q== dependencies: babel-plugin-debug-macros "^0.3.4" -"@glimmer/vm@0.79.2": - version "0.79.2" - resolved "https://registry.yarnpkg.com/@glimmer/vm/-/vm-0.79.2.tgz#cbebf74fae0cd413486f7a4ca31715eb8ab9a39d" - integrity sha512-4Bbg7eDLymuV7wiM0GVbIYnQMZxo/Dn+PF1+w5mWUjHqH+ajNKNARJVt3+w+M1tg5Q/nblBVHshNzYwFaugagA== +"@glimmer/vm@0.79.3": + version "0.79.3" + resolved "https://registry.yarnpkg.com/@glimmer/vm/-/vm-0.79.3.tgz#79b0614116d5b3417e6d0a16c0c91fbf521ccbc4" + integrity sha512-JX1Whpm8GGyoZefXj6jJSNBi/qWKYjC5JbHrJ9KALXYCC2JAabVQlOlfRDV4mQOYv7yCzrpM8ZDCycwHTGuJ6A== dependencies: - "@glimmer/interfaces" "0.79.2" - "@glimmer/util" "0.79.2" + "@glimmer/interfaces" "0.79.3" + "@glimmer/util" "0.79.3" -"@glimmer/wire-format@0.79.2": - version "0.79.2" - resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.79.2.tgz#adb88d25752e00f0f9d3f609c1ab458ca2cac932" - integrity sha512-jYiEbRtHGs2auQWOmEEDbT3p9zTqAVUzKkpWzoc9u6fEC8/QfcT3FuLW7S3YjLzauPiIlOQyDVeC5IvhyZag9w== +"@glimmer/wire-format@0.79.3": + version "0.79.3" + resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.79.3.tgz#eac19c32297caa5129f820206b8035b8f77d07f4" + integrity sha512-6izhGKLIeuWbK9FfaM1I+hXYh3EgKpbpbA99SDQav+TMPiFWFy9sos4PyEuywha5p7MZrMDKXip/l49ARG8XHg== dependencies: - "@glimmer/interfaces" "0.79.2" - "@glimmer/util" "0.79.2" + "@glimmer/interfaces" "0.79.3" + "@glimmer/util" "0.79.3" "@handlebars/parser@~2.0.0": version "2.0.0" From a10b4bcd91263a6be23d347469115a8dc0e54ddc Mon Sep 17 00:00:00 2001 From: Bj Tecu Date: Fri, 28 May 2021 17:18:12 -0400 Subject: [PATCH 24/61] Extend transition deprecation (cherry picked from commit 926452f531fb70eddea0fe85ff73843603d39de7) --- packages/@ember/-internals/routing/lib/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@ember/-internals/routing/lib/utils.ts b/packages/@ember/-internals/routing/lib/utils.ts index a4c82de6b52..71c666d244b 100644 --- a/packages/@ember/-internals/routing/lib/utils.ts +++ b/packages/@ember/-internals/routing/lib/utils.ts @@ -254,7 +254,7 @@ export function deprecateTransitionMethods(frameworkClass: string, methodName: s since: { enabled: '3.26.0', }, - until: '4.0.0', + until: '5.0.0', url: 'https://deprecations.emberjs.com/v3.x/#toc_routing-transition-methods', } ); From 055b923621561754ee98baa62421434f3982e29c Mon Sep 17 00:00:00 2001 From: Katie Gengler Date: Tue, 1 Jun 2021 16:18:27 -0400 Subject: [PATCH 25/61] Add v3.28.0-beta.3 to CHANGELOG --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00fcb41871b..8107d58b833 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Ember Changelog +### v3.28.0-beta.3 (June 1, 2021) + +- [#19565](https://github.com/emberjs/ember.js/pull/19565) [BUGFIX] Ensures that computed can depend on dynamic hash keys +- [#19571](https://github.com/emberjs/ember.js/pull/19571) [BUGFIX] Delay until: 5.0.0 the removal of the deprecated transition methods of controller and route from [RFC #674](https://github.com/emberjs/rfcs/blob/master/text/0674-deprecate-transition-methods-of-controller-and-route.md). + ### v3.28.0-beta.2 (May 27, 2021) - [#19511](https://github.com/emberjs/ember.js/pull/19511) / [#19548](https://github.com/emberjs/ember.js/pull/19548) [BUGFIX] Makes the (hash) helper lazy From 20b4effa830b3c02153d74fa63133e6877ea99b0 Mon Sep 17 00:00:00 2001 From: Katie Gengler Date: Tue, 1 Jun 2021 16:19:08 -0400 Subject: [PATCH 26/61] Release v3.28.0-beta.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 47a71e7d066..e72601d6e20 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ember-source", - "version": "3.28.0-beta.2", + "version": "3.28.0-beta.3", "description": "A JavaScript framework for creating ambitious web applications", "keywords": [ "ember-addon" From a920b457c564f75f480452d6f155ff6a77cdd6df Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Thu, 3 Jun 2021 15:55:44 -0400 Subject: [PATCH 27/61] [BUGFIX release] Fix Embroider compatibility with ember-source@3.27.2+ Fixes a few things: * Ensures that Embroider has a consistent protocol for ensuring the global is bootstrapped * Allows our override code to be transpiled * Ensures that any bootstrapping tweaks force us out of "prebuilt" mode (allowing that customized bootstrap code to actually run) Refactors the work in https://github.com/emberjs/ember.js/pull/19557 to address some of the recent comments there. (cherry picked from commit 5ad6f79eee103e6099e9efd1a2bded9a1e8e2443) --- lib/index.js | 321 +------ lib/overrides.js | 411 +++++++++ package.json | 2 +- packages/@ember/-internals/bootstrap/index.js | 50 - packages/@ember/-internals/bootstrap/index.ts | 64 ++ .../@ember/-internals/overrides/index.d.ts | 12 + packages/@ember/-internals/overrides/index.js | 3 + packages/@ember/object/index.js | 11 +- packages/@ember/runloop/index.js | 13 +- tests/node/fixtures/project.js | 148 +++ tests/node/overrides-test.js | 869 ++++++++++++++++++ 11 files changed, 1537 insertions(+), 367 deletions(-) create mode 100644 lib/overrides.js delete mode 100644 packages/@ember/-internals/bootstrap/index.js create mode 100644 packages/@ember/-internals/bootstrap/index.ts create mode 100644 packages/@ember/-internals/overrides/index.d.ts create mode 100644 packages/@ember/-internals/overrides/index.js create mode 100644 tests/node/fixtures/project.js create mode 100644 tests/node/overrides-test.js diff --git a/lib/index.js b/lib/index.js index 8f0ff2ffc36..ce887fbeb22 100644 --- a/lib/index.js +++ b/lib/index.js @@ -10,7 +10,7 @@ const buildStripClassCallcheckPlugin = require('./build-strip-class-callcheck-pl const injectBabelHelpers = require('./transforms/inject-babel-helpers').injectBabelHelpers; const debugTree = require('broccoli-debug').buildDebugCallback('ember-source:addon'); const vmBabelPlugins = require('@glimmer/vm-babel-plugins'); -const semver = require('semver'); +const Overrides = require('./overrides'); const PRE_BUILT_TARGETS = [ 'last 1 Chrome versions', @@ -41,17 +41,6 @@ add( path.join(__dirname, '..', 'dist', 'ember-template-compiler.js') ); -function* walkAddonTree(project, pathToAddon = []) { - for (let addon of project.addons) { - yield [addon, pathToAddon]; - yield* walkAddonTree(addon, [...pathToAddon, `${addon.name}@${addon.pkg.version}`]); - } -} - -function requirementFor(pkg, deps = {}) { - return deps[pkg]; -} - module.exports = { init() { this._super.init && this._super.init.apply(this, arguments); @@ -76,13 +65,21 @@ module.exports = { name: 'ember-source', paths, absolutePaths, - _bootstrapEmber: "require('@ember/-internals/bootstrap').default();", _jqueryIntegrationEnabled: true, + _overrideTree: undefined, included() { this._super.included.apply(this, arguments); - this._issueGlobalsDeprecation(); + let overrides = Overrides.for(this.project); + + if (overrides.hasOverrides) { + this._overrideTree = overrides.toTree(); + } + + if (overrides.hasBuildTimeWarning) { + this.ui.writeWarnLine('[DEPRECATION] ' + overrides.buildTimeWarning); + } const { has } = require('@ember/edition-utils'); @@ -224,6 +221,10 @@ module.exports = { }, buildEmberBundles(tree, isProduction) { + if (this._overrideTree) { + tree = new MergeTrees([tree, this._overrideTree], { overwrite: true }); + } + let packages = this.transpileTree(new Funnel(tree, { srcDir: 'packages' }), isProduction); let dependencies = this.transpileTree( @@ -259,7 +260,7 @@ module.exports = { return new MergeTrees([ concatBundle(emberFiles, { outputFile: 'ember.js', - footer: this._bootstrapEmber, + footer: `require('@ember/-internals/bootstrap')`, }), concatBundle(emberTestingFiles, { @@ -304,10 +305,13 @@ module.exports = { if ( !isProduction && + // do the running applications targets match our prebuilt assets targets? PRE_BUILT_TARGETS.every((target) => targets.includes(target)) && targets.length === PRE_BUILT_TARGETS.length && // if node is defined in targets we can't reliably use the prebuilt bundles - !targetNode + !targetNode && + // if we have a custom override (e.g. for globals deprecations) we can't use the prebuilt bundles + !this._overrideTree ) { ember = new Funnel(tree, { destDir: 'ember', @@ -324,289 +328,4 @@ module.exports = { return debugTree(new MergeTrees([ember, templateCompiler, jquery]), 'vendor:final'); }, - - _issueGlobalsDeprecation() { - if (process.env.EMBER_ENV === 'production') { - return; - } - - let isYarnProject = ((root) => { - try { - // eslint-disable-next-line node/no-unpublished-require - return require('ember-cli/lib/utilities/is-yarn-project')(root); - } catch { - return undefined; - } - })(this.project.root); - - let groupedByTopLevelAddon = Object.create(null); - let groupedByVersion = Object.create(null); - let projectInfo; - - for (let [addon, pathToAddon] of walkAddonTree(this.project)) { - let version = addon.pkg.version; - - if (addon.name === 'ember-cli-babel' && semver.lt(version, '7.26.6')) { - let info; - - if (addon.parent === this.project) { - let requirement = requirementFor('ember-cli-babel', this.project.pkg.devDependencies); - let compatible = semver.satisfies('7.26.6', requirement); - - info = projectInfo = { - parent: `${this.project.name()} (your app)`, - version, - requirement, - compatible, - dormant: false, - path: pathToAddon, - }; - } else { - let requirement = requirementFor('ember-cli-babel', addon.parent.pkg.dependencies); - let compatible = semver.satisfies('7.26.6', requirement); - let dormant = addon.parent._fileSystemInfo - ? addon.parent._fileSystemInfo().hasJSFiles === false - : false; - - let topLevelAddon = addon.parent; - - while (topLevelAddon.parent !== this.project) { - topLevelAddon = topLevelAddon.parent; - } - - info = { - parent: `${addon.parent.name}@${addon.pkg.version}`, - version, - requirement, - compatible, - dormant, - path: pathToAddon, - }; - - let addons = groupedByTopLevelAddon[topLevelAddon.name] || []; - groupedByTopLevelAddon[topLevelAddon.name] = [...addons, info]; - } - - let group = groupedByVersion[version] || Object.create(null); - groupedByVersion[version] = group; - - let addons = group[info.parent] || []; - group[info.parent] = [...addons, info]; - } - } - - if (Object.keys(groupedByVersion).length === 0) { - return; - } - - let dormantTopLevelAddons = []; - let compatibleTopLevelAddons = []; - let incompatibleTopLevelAddons = []; - - for (let addon of Object.keys(groupedByTopLevelAddon)) { - let group = groupedByTopLevelAddon[addon]; - - if (group.every((info) => info.dormant)) { - dormantTopLevelAddons.push(addon); - } else if (group.every((info) => info.compatible)) { - compatibleTopLevelAddons.push(addon); - } else { - incompatibleTopLevelAddons.push(addon); - } - } - - let suggestions = 'The following steps may help:\n\n'; - - let hasActionableSuggestions = false; - - if (projectInfo) { - suggestions += '* Upgrade your `devDependencies` on `ember-cli-babel` to `^7.26.6`.\n'; - hasActionableSuggestions = true; - } else if (compatibleTopLevelAddons.length > 0) { - // Only show the compatible addons if the project itself is up-to-date, because updating the - // project's own dependency on ember-cli-babel to latest may also get these addons to use it - // as well. Otherwise, there is an unnecessary copy in the tree and it needs to be deduped. - if (isYarnProject === true) { - suggestions += - '* Run `npx yarn-deduplicate --packages ember-cli-babel` followed by `yarn install`.\n'; - } else if (isYarnProject === false) { - suggestions += '* Run `npm dedupe`.\n'; - } else { - suggestions += - '* If using yarn, run `npx yarn-deduplicate --packages ember-cli-babel` followed by `yarn install`.\n' + - '* If using npm, run `npm dedupe`.\n'; - } - - hasActionableSuggestions = true; - } - - if (incompatibleTopLevelAddons.length > 0) { - suggestions += '* Upgrade the following addons to the latest version:\n'; - - for (let addon of incompatibleTopLevelAddons) { - suggestions += ` * ${addon}\n`; - } - - hasActionableSuggestions = true; - } - - if (!hasActionableSuggestions) { - // Only show the dormant addons if there are nothing else to do because they are unlikely to - // be the problem. - suggestions += '* Upgrade the following addons to the latest version, if available:\n'; - - for (let addon of dormantTopLevelAddons) { - suggestions += ` * ${addon}\n`; - } - } - - let details = - '\n### Details ###\n\n' + - 'Prior to v7.26.6, ember-cli-babel sometimes transpiled imports into the equivalent Ember Global API, ' + - 'potentially triggering this deprecation message indirectly, ' + - 'even when you did not observe these deprecated usages in your code.\n\n' + - 'The following outdated versions are found in your project:\n'; - - let hasDormantAddons = false; - let hasCompatibleAddons = false; - - for (let version of Object.keys(groupedByVersion).sort(semver.compare)) { - details += `\n* ember-cli-babel@${version}, currently used by:\n`; - - for (let parent of Object.keys(groupedByVersion[version]).sort()) { - let info = groupedByVersion[version][parent][0]; - - details += ` * ${parent}`; - - if (info.dormant) { - details += ' (Dormant)\n'; - hasDormantAddons = true; - } else if (info.compatible) { - details += ' (Compatible)\n'; - hasCompatibleAddons = true; - } else { - details += '\n'; - } - - details += ` * Depends on ember-cli-babel@${groupedByVersion[version][parent][0].requirement}\n`; - - for (let info of groupedByVersion[version][parent]) { - let adddedBy = info.path.slice(0, -1); - - if (adddedBy.length) { - details += ` * Added by ${adddedBy.join(' > ')}\n`; - } - - if (info.compatible) { - hasCompatibleAddons = true; - } - } - } - } - - if (hasDormantAddons) { - details += - '\nNote: Addons marked as "Dormant" does not appear to have any JavaScript files. ' + - 'Therefore, even if they are using an old version ember-cli-babel, they are ' + - 'unlikely to be the cuplrit of this deprecation and can likely be ignored.\n'; - } - - if (hasCompatibleAddons) { - details += `\nNote: Addons marked as "Compatible" are already compatible with ember-cli-babel@7.26.6. `; - - if (projectInfo) { - details += 'Try upgrading your `devDependencies` on `ember-cli-babel` to `^7.26.6`.\n'; - } else { - if (isYarnProject === true) { - details += - 'Try running `npx yarn-deduplicate --packages ember-cli-babel` followed by `yarn install`.\n'; - } else if (isYarnProject === false) { - details += 'Try running `npm dedupe`.\n'; - } else { - details += - 'If using yarn, try running `npx yarn-deduplicate --packages ember-cli-babel` followed by `yarn install`.' + - 'If using npm, try running `npm dedupe`.\n'; - } - } - } - - let globalMessage = - 'Usage of the Ember Global is deprecated. ' + - 'You should import the Ember module or the specific API instead.\n\n' + - 'See https://deprecations.emberjs.com/v3.x/#toc_ember-global for details.\n\n' + - 'Usages of the Ember Global may be caused by an outdated ember-cli-babel dependency. ' + - suggestions; - - if (hasActionableSuggestions && process.env.EMBER_GLOBAL_DEPRECATIONS !== 'all') { - globalMessage += - '\n### Important ###\n\n' + - 'In order to avoid repeatedly showing the same deprecation messages, ' + - 'no further deprecation messages will be shown for usages of the Ember Global ' + - 'until ember-cli-babel is upgraded to v7.26.6 or above.\n\n' + - 'To see all instances of this deprecation message, ' + - 'set the `EMBER_GLOBAL_DEPRECATIONS` environment variable to "all", ' + - 'e.g. `EMBER_GLOBAL_DEPRECATIONS=all ember test`.\n'; - } - - globalMessage += details; - - if (hasActionableSuggestions) { - this.ui.writeWarnLine('[DEPRECATION] ' + globalMessage); - } - - let onDotAccess = `function (dotKey, importKey, module) { - var message = - 'Using \`' + dotKey + '\` has been deprecated. Instead, import the value directly from ' + module + ':\\n\\n' + - ' import { ' + importKey + ' } from \\'' + module + '\\';\\n\\n' + - 'These usages may be caused by an outdated ember-cli-babel dependency. ' + - ${JSON.stringify(suggestions)}; - - if (${ - hasActionableSuggestions && - process.env.EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS !== 'all' - }) { - message += - '\\n### Important ###\\n\\n' + - 'In order to avoid repeatedly showing the same deprecation messages, ' + - 'no further deprecation messages will be shown for theses deprecated usages ' + - 'until ember-cli-babel is upgraded to v7.26.6 or above.\\n\\n' + - 'To see all instances of this deprecation message, ' + - 'set the \`EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS\` environment variable to "all", ' + - 'e.g. \`EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS=all ember test\`.\\n'; - } - - message += ${JSON.stringify(details)}; - - return message; - }`; - - this._bootstrapEmber = ` - require('@ember/-internals/bootstrap').default( - ${JSON.stringify(globalMessage)}, - ${hasActionableSuggestions && process.env.EMBER_GLOBAL_DEPRECATIONS !== 'all'} - ); - - (function(disabled, once, _onDotAccess) { - var onDotAccess = function () { - if (disabled) { - return null; - } else { - disabled = once; - return _onDotAccess.apply(undefined, arguments); - } - }; - - require('@ember/object')._onDotAccess(onDotAccess); - - require('@ember/runloop')._onDotAccess(onDotAccess); - })( - false, - ${ - hasActionableSuggestions && - process.env.EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS !== 'all' - }, - ${onDotAccess} - ); - `; - }, }; diff --git a/lib/overrides.js b/lib/overrides.js new file mode 100644 index 00000000000..9eb67acaf56 --- /dev/null +++ b/lib/overrides.js @@ -0,0 +1,411 @@ +const createFile = require('broccoli-file-creator'); +const semver = require('semver'); +const validSemverRange = require('semver/ranges/valid'); + +const DEFAULT_OPTIONS = Object.freeze({ + showAllEmberGlobalDeprecations: false, + showAllDotAccessDeprecations: false, +}); + +function* walkAddonTree(project, pathToAddon = []) { + for (let addon of project.addons) { + yield [addon, pathToAddon]; + yield* walkAddonTree(addon, [...pathToAddon, `${addon.name}@${addon.pkg.version}`]); + } +} + +function requirementFor(pkg, deps = {}) { + return deps[pkg]; +} + +const KNWON_DORMANT_ADDONS = Object.freeze([ + 'ember-angle-bracket-invocation-polyfill', + 'ember-fn-helper-polyfill', + 'ember-in-element-polyfill', + 'ember-named-blocks-polyfill', + 'ember-on-modifier', +]); +module.exports = class Overrides { + static for(project, env = process.env) { + if (env.EMBER_ENV === 'production') { + return new Overrides([]); + } else { + return new Overrides(Overrides.addonsInfoFor(project), { + showAllEmberGlobalDeprecations: env.EMBER_GLOBAL_DEPRECATIONS === 'all', + showAllDotAccessDeprecations: + env.EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS === 'all', + }); + } + } + + static *addonsInfoFor(project) { + for (let [addon, pathToAddon] of walkAddonTree(project)) { + let version = addon.pkg.version; + + if (addon.name === 'ember-cli-babel' && semver.lt(version, '7.26.6')) { + if (addon.parent === project) { + let requirement = + requirementFor('ember-cli-babel', project.pkg.dependencies) || + requirementFor('ember-cli-babel', project.pkg.devDependencies); + + let validRange = validSemverRange(requirement); + let compatible = validRange ? semver.satisfies('7.26.6', requirement) : true; + + yield { + parent: `${project.name()} (your app)`, + topLevel: null, + version, + requirement, + compatible, + dormant: false, + path: [], + }; + } else { + let requirement = requirementFor('ember-cli-babel', addon.parent.pkg.dependencies); + let validRange = validSemverRange(requirement); + let compatible = validRange ? semver.satisfies('7.26.6', requirement) : true; + let dormant = + KNWON_DORMANT_ADDONS.includes(addon.parent.name) || + (addon.parent._fileSystemInfo + ? addon.parent._fileSystemInfo().hasJSFiles === false + : false); + + let topLevelAddon = addon.parent; + + while (topLevelAddon.parent !== project) { + topLevelAddon = topLevelAddon.parent; + } + + yield { + parent: `${addon.parent.name}@${addon.parent.pkg.version}`, + topLevel: topLevelAddon.name, + version, + requirement, + compatible, + dormant, + path: pathToAddon, + }; + } + } + } + } + + static printList(list, indent = '') { + let output = ''; + + for (let item of list) { + if (Array.isArray(item)) { + output += `${indent}* ${item[0]}\n`; + output += Overrides.printList(item[1], indent + ' '); + } else { + output += `${indent}* ${item}\n`; + } + } + + return output; + } + + constructor(addonsInfo, options = {}) { + let _addonsInfo = []; + let projectInfo; + let groupedByTopLevel = Object.create(null); + let groupedByVersion = Object.create(null); + + for (let info of addonsInfo) { + _addonsInfo.push(info); + + if (info.topLevel === null) { + projectInfo = info; + } else { + let topLevel = info.topLevel; + let addons = groupedByTopLevel[topLevel] || []; + groupedByTopLevel[topLevel] = [...addons, info]; + } + + let version = info.version; + + let group = groupedByVersion[version] || Object.create(null); + groupedByVersion[version] = group; + + let addons = group[info.parent] || []; + group[info.parent] = [...addons, info]; + } + + let dormantTopLevelAddons = []; + let compatibleTopLevelAddons = []; + let incompatibleTopLevelAddons = []; + + let suggestions = []; + let hasActionableSuggestions = false; + + if (_addonsInfo.length > 0) { + for (let addon of Object.keys(groupedByTopLevel)) { + let group = groupedByTopLevel[addon]; + + if (group.every((info) => info.dormant)) { + dormantTopLevelAddons.push(addon); + } else if (group.every((info) => info.compatible)) { + compatibleTopLevelAddons.push(addon); + } else { + incompatibleTopLevelAddons.push(addon); + } + } + + if (projectInfo) { + suggestions.push('Upgrade your `devDependencies` on `ember-cli-babel` to `^7.26.6`.'); + hasActionableSuggestions = true; + } else if (compatibleTopLevelAddons.length > 0) { + // Only show the compatible addons if the project itself is up-to-date, because updating the + // project's own dependency on ember-cli-babel to latest may also get these addons to use it + // as well. Otherwise, there is an unnecessary copy in the tree and it needs to be deduped. + suggestions.push( + 'If using yarn, run `npx yarn-deduplicate --packages ember-cli-babel` followed by `yarn install`.' + ); + + suggestions.push('If using npm, run `npm dedupe`.'); + + hasActionableSuggestions = true; + } + + if (incompatibleTopLevelAddons.length > 0) { + suggestions.push([ + 'Upgrade the following addons to the latest version:', + incompatibleTopLevelAddons, + ]); + + hasActionableSuggestions = true; + } + + if (!hasActionableSuggestions) { + suggestions.push([ + 'Upgrade the following addons to the latest version, if available:', + dormantTopLevelAddons, + ]); + } + } + + this.addonsInfo = _addonsInfo; + this.projectInfo = projectInfo; + this.groupedByTopLevel = groupedByTopLevel; + this.groupedByVersion = groupedByVersion; + this.dormantTopLevelAddons = dormantTopLevelAddons; + this.compatibleTopLevelAddons = compatibleTopLevelAddons; + this.incompatibleTopLevelAddons = incompatibleTopLevelAddons; + this.suggestions = suggestions; + this.hasActionableSuggestions = hasActionableSuggestions; + this.options = { ...DEFAULT_OPTIONS, ...options }; + } + + get hasOverrides() { + return this.addonsInfo.length > 0; + } + + get hasBuildTimeWarning() { + return this.hasActionableSuggestions; + } + + get hasCompatibleAddons() { + return this.addonsInfo.some((info) => info.compatible); + } + + get hasDormantAddons() { + return this.addonsInfo.some((info) => info.dormant); + } + + get showAllEmberGlobalDeprecations() { + return !this.hasActionableSuggestions || this.options.showAllEmberGlobalDeprecations; + } + + get showAllDotAccessDeprecations() { + return !this.hasActionableSuggestions || this.options.showAllDotAccessDeprecations; + } + + get details() { + let details = + '\n### Details ###\n\n' + + 'Prior to v7.26.6, ember-cli-babel sometimes transpiled imports into the equivalent Ember Global API, ' + + 'potentially triggering this deprecation message indirectly, ' + + 'even when you did not observe these deprecated usages in your code.\n\n' + + 'The following outdated versions are found in your project:\n\n' + + Overrides.printList(this.outdated); + + if (this.hasDormantAddons) { + details += + '\nNote: Addons marked as "Dormant" does not appear to have any JavaScript files. ' + + 'Therefore, even if they are using an old version ember-cli-babel, they are ' + + 'unlikely to be the cuplrit of this deprecation and can likely be ignored.\n'; + } + + if (this.hasCompatibleAddons) { + details += `\nNote: Addons marked as "Compatible" are already compatible with ember-cli-babel@7.26.6. `; + + if (this.projectInfo) { + details += 'Try upgrading your `devDependencies` on `ember-cli-babel` to `^7.26.6`.\n'; + } else { + details += + 'If using yarn, try running `npx yarn-deduplicate --packages ember-cli-babel` followed by `yarn install`.' + + 'If using npm, try running `npm dedupe`.\n'; + } + } + + return details; + } + + get outdated() { + let list = []; + + let groupedByVersion = this.groupedByVersion; + + for (let version of Object.keys(groupedByVersion).sort(semver.compare)) { + let addons = []; + + for (let parent of Object.keys(groupedByVersion[version]).sort()) { + let info = groupedByVersion[version][parent][0]; + let addon; + let details = []; + + if (info.dormant) { + addon = `${parent} (Dormant)`; + } else if (info.compatible) { + addon = `${parent} (Compatible)`; + } else { + addon = parent; + } + + details.push(`Depends on ember-cli-babel@${info.requirement}`); + + for (let info of groupedByVersion[version][parent]) { + let adddedBy = info.path.slice(0, -1); + + if (adddedBy.length) { + details.push(`Added by ${adddedBy.join(' > ')}`); + } + } + + addons.push([addon, details]); + } + + list.push([`ember-cli-babel@${version}, currently used by:`, addons]); + } + + return list; + } + + get globalMessage() { + let message = + 'Usage of the Ember Global is deprecated. ' + + 'You should import the Ember module or the specific API instead.\n\n' + + 'See https://deprecations.emberjs.com/v3.x/#toc_ember-global for details.\n\n' + + 'Usages of the Ember Global may be caused by an outdated ember-cli-babel dependency. ' + + 'The following steps may help:\n\n' + + Overrides.printList(this.suggestions); + + if (!this.showAllEmberGlobalDeprecations) { + message += + '\n### Important ###\n\n' + + 'In order to avoid repeatedly showing the same deprecation messages, ' + + 'no further deprecation messages will be shown for usages of the Ember Global ' + + 'until ember-cli-babel is upgraded to v7.26.6 or above.\n\n' + + 'To see all instances of this deprecation message, ' + + 'set the `EMBER_GLOBAL_DEPRECATIONS` environment variable to "all", ' + + 'e.g. `EMBER_GLOBAL_DEPRECATIONS=all ember test`.\n'; + } + + message += this.details; + + return message; + } + + get buildTimeWarning() { + if (this.hasBuildTimeWarning) { + return `[DEPRECATION] ${this.globalMessage}`; + } else { + return ''; + } + } + + toTree() { + if (this.hasOverrides) { + return createFile('packages/@ember/-internals/overrides/index.js', this.toModule()); + } + } + + toModule() { + return ` + export let onEmberGlobalAccess; + export let onComputedDotAccess; + export let onRunloopDotAccess; + + ${this.toJS()}; + `; + } + + toJS() { + return ` + function once(callback) { + let called = false; + + return (...args) => { + if (called) { + return null; + } else { + called = true; + return callback(...args); + } + }; + } + + ${this.onDotAcces} + + onEmberGlobalAccess = ${this.onEmberGlobalAccess}; + onComputedDotAccess = onDotAccess; + onRunloopDotAccess = onDotAccess; + + if (!${this.showAllEmberGlobalDeprecations}) { + onEmberGlobalAccess = once(onEmberGlobalAccess); + } + + if (!${this.showAllDotAccessDeprecations}) { + onComputedDotAccess = once(onComputedDotAccess); + onRunloopDotAccess = once(onRunloopDotAccess); + } + `; + } + + get onEmberGlobalAccess() { + return ` + function onEmberGlobalAccess() { + return ${JSON.stringify(this.globalMessage)}; + } + `; + } + + get onDotAcces() { + return ` + function onDotAccess(dotKey, importKey, module) { + let message = + 'Using \`' + dotKey + '\` has been deprecated. Instead, import the value directly from ' + module + ':\\n\\n' + + ' import { ' + importKey + ' } from \\'' + module + '\\';\\n\\n' + + 'These usages may be caused by an outdated ember-cli-babel dependency. ' + + 'Usages of the Ember Global may be caused by an outdated ember-cli-babel dependency. ' + + 'The following steps may help:\\n\\n' + + ${JSON.stringify(Overrides.printList(this.suggestions))}; + + if (!${this.showAllDotAccessDeprecations}) { + message += + '\\n### Important ###\\n\\n' + + 'In order to avoid repeatedly showing the same deprecation messages, ' + + 'no further deprecation messages will be shown for theses deprecated usages ' + + 'until ember-cli-babel is upgraded to v7.26.6 or above.\\n\\n' + + 'To see all instances of this deprecation message, ' + + 'set the \`EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS\` environment variable to "all", ' + + 'e.g. \`EMBER_RUNLOOP_AND_COMPUTED_DOT_ACCESS_DEPRECATIONS=all ember test\`.\\n'; + } + + message += ${JSON.stringify(this.details)}; + + return message; + } + `; + } +}; diff --git a/package.json b/package.json index e72601d6e20..fc2e5c85350 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ "babel-plugin-filter-imports": "^4.0.0", "broccoli-concat": "^4.2.4", "broccoli-debug": "^0.6.4", + "broccoli-file-creator": "^2.1.1", "broccoli-funnel": "^2.0.2", "broccoli-merge-trees": "^4.2.0", "chalk": "^4.0.0", @@ -98,7 +99,6 @@ "babel-template": "^6.26.0", "backburner.js": "^2.7.0", "broccoli-babel-transpiler": "^7.8.0", - "broccoli-file-creator": "^2.1.1", "broccoli-persistent-filter": "^2.3.1", "broccoli-plugin": "^4.0.3", "broccoli-rollup": "^2.1.1", diff --git a/packages/@ember/-internals/bootstrap/index.js b/packages/@ember/-internals/bootstrap/index.js deleted file mode 100644 index 05e70d3a721..00000000000 --- a/packages/@ember/-internals/bootstrap/index.js +++ /dev/null @@ -1,50 +0,0 @@ -import require from 'require'; -import { context } from '@ember/-internals/environment'; -import { deprecate } from '@ember/debug'; - -const DEFAULT_MESSAGE = - 'Usage of the Ember Global is deprecated. You should import the Ember module or the specific API instead.'; - -export default function bootstrap(message = DEFAULT_MESSAGE, once = false) { - let Ember; - let disabled = false; - - function defineEmber(key) { - Object.defineProperty(context.exports, key, { - enumerable: true, - configurable: true, - get() { - if (!Ember) { - Ember = require('ember').default; - } - - deprecate(message, disabled, { - id: 'ember-global', - until: '4.0.0', - url: 'https://deprecations.emberjs.com/v3.x/#toc_ember-global', - for: 'ember-source', - since: { - enabled: '3.27.0', - }, - }); - - if (once) { - disabled = true; - } - - return Ember; - }, - }); - } - - // Bootstrap the global - defineEmber('Ember'); - defineEmber('Em'); - - // Bootstrap Node module - // eslint-disable-next-line no-undef - if (typeof module === 'object' && typeof module.require === 'function') { - // eslint-disable-next-line no-undef - module.exports = Ember = require('ember').default; - } -} diff --git a/packages/@ember/-internals/bootstrap/index.ts b/packages/@ember/-internals/bootstrap/index.ts new file mode 100644 index 00000000000..022ef158407 --- /dev/null +++ b/packages/@ember/-internals/bootstrap/index.ts @@ -0,0 +1,64 @@ +import { context } from '@ember/-internals/environment'; +import { onEmberGlobalAccess } from '@ember/-internals/overrides'; +import { deprecate } from '@ember/debug'; +import { DEBUG } from '@glimmer/env'; +import require from 'require'; + +(function bootstrap() { + let Ember: unknown; + + let get = () => { + if (!Ember) { + // tslint:disable-next-line: no-require-imports + Ember = require('ember').default; + } + + return Ember; + }; + + if (DEBUG) { + let defaultHandler = () => { + return 'Usage of the Ember Global is deprecated. You should import the Ember module or the specific API instead.'; + }; + + let handler = onEmberGlobalAccess || defaultHandler; + let _get = get; + + get = () => { + let message = handler(); + + if (message !== null) { + deprecate(message, false, { + id: 'ember-global', + until: '4.0.0', + url: 'https://deprecations.emberjs.com/v3.x/#toc_ember-global', + for: 'ember-source', + since: { + enabled: '3.27.0', + }, + }); + } + + return _get(); + }; + } + + function defineEmber(key: string) { + Object.defineProperty(context.exports, key, { + enumerable: true, + configurable: true, + get, + }); + } + + // Bootstrap the global + defineEmber('Ember'); + defineEmber('Em'); + + // Bootstrap Node module + // eslint-disable-next-line no-undef + if (typeof module === 'object' && typeof module.require === 'function') { + // tslint:disable-next-line: no-require-imports + module.exports = Ember = require('ember').default; + } +})(); diff --git a/packages/@ember/-internals/overrides/index.d.ts b/packages/@ember/-internals/overrides/index.d.ts new file mode 100644 index 00000000000..e52fbb81445 --- /dev/null +++ b/packages/@ember/-internals/overrides/index.d.ts @@ -0,0 +1,12 @@ +type Callback = (...args: TArgs) => TReturn; + +/** + * Returns a deprecation message or null to skip the deprecation. + */ +type Handler = Callback; +type GlobalAccessHandler = Handler<[]>; +type DotAccessHandler = Handler<[dotKey: string, importKey: string, module: string]>; + +export let onEmberGlobalAccess: GlobalAccessHandler | undefined; +export let onComputedDotAccess: DotAccessHandler | undefined; +export let onRunloopDotAccess: DotAccessHandler | undefined; diff --git a/packages/@ember/-internals/overrides/index.js b/packages/@ember/-internals/overrides/index.js new file mode 100644 index 00000000000..35b83669272 --- /dev/null +++ b/packages/@ember/-internals/overrides/index.js @@ -0,0 +1,3 @@ +export let onEmberGlobalAccess; +export let onComputedDotAccess; +export let onRunloopDotAccess; diff --git a/packages/@ember/object/index.js b/packages/@ember/object/index.js index af4dd9d5735..d6ae7fbbf84 100644 --- a/packages/@ember/object/index.js +++ b/packages/@ember/object/index.js @@ -2,6 +2,7 @@ import { DEBUG } from '@glimmer/env'; import { assert, deprecate } from '@ember/debug'; import { assign } from '@ember/polyfills'; import { isElementDescriptor, setClassicDecorator } from '@ember/-internals/metal'; +import { onComputedDotAccess } from '@ember/-internals/overrides'; export { Object as default } from '@ember/-internals/runtime'; @@ -55,22 +56,18 @@ import { uniq, } from '@ember/object/computed'; -export let _onDotAccess; - // eslint-disable-next-line no-undef if (DEBUG) { - let _callback = (dotKey, importKey, module) => { + let defaultHandler = (dotKey, importKey, module) => { return `Using \`${dotKey}\` has been deprecated. Instead, import the value directly from ${module}:\n\n import { ${importKey} } from '${module}';`; }; - _onDotAccess = (callback) => { - _callback = callback; - }; + let handler = onComputedDotAccess || defaultHandler; let defineDeprecatedComputedFunc = (key, func) => { Object.defineProperty(computed, key, { get() { - let message = _callback(`computed.${key}`, key, '@ember/object/computed'); + let message = handler(`computed.${key}`, key, '@ember/object/computed'); deprecate(message, message === null, { id: 'deprecated-run-loop-and-computed-dot-access', diff --git a/packages/@ember/runloop/index.js b/packages/@ember/runloop/index.js index 6ce847c96db..c78ceaa48a5 100644 --- a/packages/@ember/runloop/index.js +++ b/packages/@ember/runloop/index.js @@ -2,6 +2,7 @@ import { DEBUG } from '@glimmer/env'; import { assert, deprecate } from '@ember/debug'; import { onErrorTarget } from '@ember/-internals/error-handling'; import { flushAsyncObservers } from '@ember/-internals/metal'; +import { onRunloopDotAccess } from '@ember/-internals/overrides'; import Backburner from 'backburner'; let currentRunLoop = null; @@ -743,22 +744,18 @@ export function throttle() { export let _deprecatedGlobalGetCurrentRunLoop; -export let _onDotAccess; - // eslint-disable-next-line no-undef if (DEBUG) { - let _callback = (dotKey, importKey, module) => { + let defaultHandler = (dotKey, importKey, module) => { return `Using \`${dotKey}\` has been deprecated. Instead, import the value directly from ${module}:\n\n import { ${importKey} } from '${module}';`; }; - _onDotAccess = (callback) => { - _callback = callback; - }; + let handler = onRunloopDotAccess || defaultHandler; let defineDeprecatedRunloopFunc = (key, func) => { Object.defineProperty(run, key, { get() { - let message = _callback(`run.${key}`, key, '@ember/runloop'); + let message = handler(`run.${key}`, key, '@ember/runloop'); deprecate(message, message === null, { id: 'deprecated-run-loop-and-computed-dot-access', @@ -775,7 +772,7 @@ if (DEBUG) { }; _deprecatedGlobalGetCurrentRunLoop = () => { - let message = _callback('run.currentRunLoop', 'getCurrentRunLoop', '@ember/runloop'); + let message = handler('run.currentRunLoop', 'getCurrentRunLoop', '@ember/runloop'); deprecate(message, message === null, { id: 'deprecated-run-loop-and-computed-dot-access', diff --git a/tests/node/fixtures/project.js b/tests/node/fixtures/project.js new file mode 100644 index 00000000000..bcc867af91c --- /dev/null +++ b/tests/node/fixtures/project.js @@ -0,0 +1,148 @@ +module.exports = class Project { + static withDep(depOptions = {}, projectOptions = {}) { + let addons = projectOptions.addons || []; + + return new Project({ + ...projectOptions, + addons: [...addons, new Addon(depOptions)], + }); + } + + static withTransientDep(transientDepOptions = {}, depOptions = {}, projectOptions = {}) { + let addons = depOptions.addons || []; + + return Project.withDep( + { + ...depOptions, + addons: [ + ...addons, + new Addon({ + name: 'my-nested-addon', + version: '0.1.0', + ...transientDepOptions, + }), + ], + }, + projectOptions + ); + } + + constructor({ + name = 'my-app', + emberCliBabel, + dependencies = {}, + devDependencies = {}, + addons = [], + } = {}) { + this.name = () => name; + this.parent = null; + this.pkg = { + name, + dependencies: { ...dependencies }, + devDependencies: { ...devDependencies }, + }; + this.addons = [...addons]; + + if (typeof emberCliBabel === 'string') { + this.pkg.devDependencies['ember-cli-babel'] = emberCliBabel; + } + + reifyAddons(this); + addMissingAddons(this, this.pkg.devDependencies); + addMissingAddons(this, this.pkg.dependencies); + addMissingDeps(this, true); + } +}; + +class Addon { + constructor({ + parent, + name = 'my-addon', + version = '1.0.0', + emberCliBabel, + dependencies = {}, + addons = [], + hasJSFiles = name !== 'ember-cli-babel', + } = {}) { + this.parent = parent; + this.name = name; + this.pkg = { + name, + version, + dependencies: { ...dependencies }, + devDependencies: {}, + }; + this.addons = [...addons]; + this._fileSystemInfo = () => ({ hasJSFiles }); + + if (typeof emberCliBabel === 'string') { + this.pkg.dependencies['ember-cli-babel'] = emberCliBabel; + } + + reifyAddons(this); + addMissingAddons(this, this.pkg.dependencies); + addMissingDeps(this); + } +} + +// Can only handle the few hardcoded cases +function resolve(requirement) { + if (requirement.startsWith('link:')) { + // Expecting something like "link:1.2.3" + return requirement.slice(5); + } else { + // Only handles "^1.0.0" -> "1.0.0", doesn't work for the general case + return requirement.slice(1); + } +} + +function reifyAddons(parent) { + parent.addons = parent.addons.map((addon) => { + if (addon instanceof Addon) { + addon.parent = parent; + return addon; + } else { + let version = addon.version; + + if (!version) { + if (parent.pkg.devDependencies[addon.name]) { + version = resolve(parent.pkg.devDependencies[addon.name]); + } else if (parent.pkg.dependencies[addon.name]) { + version = resolve(parent.pkg.dependencies[addon.name]); + } + } + + return new Addon({ ...addon, parent, version }); + } + }); +} + +function addMissingAddons(parent, deps) { + for (let [name, requirement] of Object.entries(deps)) { + if (!parent.addons.find((addon) => addon.name === name)) { + parent.addons.push( + new Addon({ + parent, + name, + version: resolve(requirement), + }) + ); + } + } +} + +function addMissingDeps(parent, devDeps = false) { + for (let addon of parent.addons) { + let target = parent.pkg.dependencies; + let isMissing = !(addon.name in target); + + if (devDeps) { + target = parent.pkg.devDependencies; + isMissing = isMissing && !(addon.name in target); + } + + if (isMissing) { + target[addon.name] = `^${addon.pkg.version}`; + } + } +} diff --git a/tests/node/overrides-test.js b/tests/node/overrides-test.js new file mode 100644 index 00000000000..90dc4aebe4e --- /dev/null +++ b/tests/node/overrides-test.js @@ -0,0 +1,869 @@ +'use strict'; + +const Project = require('./fixtures/project'); +const Overrides = require('../../lib/overrides'); + +function cmp(a, b) { + if (a == undefined || a < b) { + return -1; + } else if (b == undefined || a > b) { + return 1; + } else { + return 0; + } +} + +function addonsInfoFor(project) { + if (!(project instanceof Project)) { + project = new Project(project); + } + + let addonsInfo = [...Overrides.addonsInfoFor(project)]; + + addonsInfo.sort((a, b) => cmp(a.topLevel, b.topLevel) || cmp(a.parent, b.parent)); + + return addonsInfo; +} + +function fullExample() { + return { + name: 'direwolf', + devDependencies: { + 'active-model-adapter': '^2.2.0', + 'ember-animated': '^0.11.0', + 'ember-cli-babel': '^7.26.3', + 'ember-fetch': '^8.0.5', + 'ember-source': 'link:3.27.3', + }, + addons: [ + { + name: 'active-model-adapter', + dependencies: { + 'ember-cli-babel': '^6.18.0', + }, + }, + { + name: 'ember-animated', + dependencies: { + 'ember-angle-bracket-invocation-polyfill': '^2.0.0', + 'ember-cli-babel': '^7.26.3', + }, + addons: [ + { + name: 'ember-angle-bracket-invocation-polyfill', + dependencies: { + 'ember-cli-babel': '^6.16.0', + }, + addons: [ + { + name: 'ember-cli-babel', + version: '6.18.0', + }, + ], + }, + { + name: 'ember-cli-babel', + version: '7.26.5', + }, + ], + }, + { + name: 'ember-cli-babel', + version: '7.26.5', + }, + { + name: 'ember-fetch', + hasJSFiles: false, + dependencies: { + 'ember-cli-babel': '^7.26.0', + }, + }, + { + name: 'ember-source', + dependencies: { + 'ember-cli-babel': '^7.26.6', + }, + }, + ], + }; +} + +function infoForApp({ + name = 'direwolf', + version = '7.26.6', + requirement = `^${version}`, + compatible = requirement.startsWith('^7'), +} = {}) { + return { + parent: `${name} (your app)`, + topLevel: null, + version, + requirement, + compatible, + dormant: false, + path: [], + }; +} + +// function info({ +// parent, +// topLevel = parent, +// version = '7.26.6', +// requirement = `^${version}`, +// compatible = requirement.startsWith('^7'), +// dormant = false, +// path = [`${parent}@${version}`], +// } = {}) { +// return { +// parent, +// topLevel, +// version, +// requirement, +// compatible, +// dormant, +// path, +// }; +// } + +function evalJS(overrides) { + return eval(` + (function () { + let onEmberGlobalAccess, onComputedDotAccess, onRunloopDotAccess; + + ${overrides.toJS()} + + return { + onEmberGlobalAccess: onEmberGlobalAccess, + onComputedDotAccess: onComputedDotAccess, + onRunloopDotAccess: onRunloopDotAccess, + }; + })() + `); +} + +QUnit.module('Overrides', function () { + QUnit.module('.addonsInfoFor', function () { + // app + + QUnit.test('it returns old babel added by app', function (assert) { + assert.deepEqual(addonsInfoFor({ emberCliBabel: '^6.0.0' }), [ + { + parent: 'my-app (your app)', + topLevel: null, + version: '6.0.0', + requirement: '^6.0.0', + compatible: false, + dormant: false, + path: [], + }, + ]); + }); + + QUnit.test('it returns old but compatible babel added by app', function (assert) { + assert.deepEqual(addonsInfoFor({ emberCliBabel: '^7.0.0' }), [ + { + parent: 'my-app (your app)', + topLevel: null, + version: '7.0.0', + requirement: '^7.0.0', + compatible: true, + dormant: false, + path: [], + }, + ]); + }); + + QUnit.test('it does not return new babel added by app', function (assert) { + assert.deepEqual(addonsInfoFor({ emberCliBabel: '^7.26.6' }), []); + }); + + // direct dependency + + QUnit.test('it returns old babel added by a dependency', function (assert) { + assert.deepEqual(addonsInfoFor(Project.withDep({ emberCliBabel: '^6.0.0' })), [ + { + parent: 'my-addon@1.0.0', + topLevel: 'my-addon', + version: '6.0.0', + requirement: '^6.0.0', + compatible: false, + dormant: false, + path: ['my-addon@1.0.0'], + }, + ]); + }); + + QUnit.test('it returns old but compatible babel added by a dependency', function (assert) { + assert.deepEqual(addonsInfoFor(Project.withDep({ emberCliBabel: '^7.0.0' })), [ + { + parent: 'my-addon@1.0.0', + topLevel: 'my-addon', + version: '7.0.0', + requirement: '^7.0.0', + compatible: true, + dormant: false, + path: ['my-addon@1.0.0'], + }, + ]); + }); + + QUnit.test('it does not return new babel added by a dependency', function (assert) { + assert.deepEqual(addonsInfoFor(Project.withDep({ emberCliBabel: '^7.26.6' })), []); + }); + + // direct dependency (dormant) + + QUnit.test('it returns old babel added by a dormant dependency', function (assert) { + assert.deepEqual( + addonsInfoFor(Project.withDep({ emberCliBabel: '^6.0.0', hasJSFiles: false })), + [ + { + parent: 'my-addon@1.0.0', + topLevel: 'my-addon', + version: '6.0.0', + requirement: '^6.0.0', + compatible: false, + dormant: true, + path: ['my-addon@1.0.0'], + }, + ] + ); + }); + + QUnit.test('it returns old but compatible babel added by a dormant dependency', function ( + assert + ) { + assert.deepEqual( + addonsInfoFor(Project.withDep({ emberCliBabel: '^7.0.0', hasJSFiles: false })), + [ + { + parent: 'my-addon@1.0.0', + topLevel: 'my-addon', + version: '7.0.0', + requirement: '^7.0.0', + compatible: true, + dormant: true, + path: ['my-addon@1.0.0'], + }, + ] + ); + }); + + QUnit.test('it does not return new babel added by a dormant dependency', function (assert) { + assert.deepEqual( + addonsInfoFor(Project.withDep({ emberCliBabel: '^7.26.6', hasJSFiles: false })), + [] + ); + }); + + // transient dep + + QUnit.test('it returns old babel added by a transient dependency', function (assert) { + assert.deepEqual(addonsInfoFor(Project.withTransientDep({ emberCliBabel: '^6.0.0' })), [ + { + parent: 'my-nested-addon@0.1.0', + topLevel: 'my-addon', + version: '6.0.0', + requirement: '^6.0.0', + compatible: false, + dormant: false, + path: ['my-addon@1.0.0', 'my-nested-addon@0.1.0'], + }, + ]); + }); + + QUnit.test('it returns old but compatible babel added by a transient dependency', function ( + assert + ) { + assert.deepEqual(addonsInfoFor(Project.withTransientDep({ emberCliBabel: '^7.0.0' })), [ + { + parent: 'my-nested-addon@0.1.0', + topLevel: 'my-addon', + version: '7.0.0', + requirement: '^7.0.0', + compatible: true, + dormant: false, + path: ['my-addon@1.0.0', 'my-nested-addon@0.1.0'], + }, + ]); + }); + + QUnit.test('it does not return new babel added by a transient dependency', function (assert) { + assert.deepEqual(addonsInfoFor(Project.withDep({ emberCliBabel: '^7.26.6' })), []); + }); + + // dormant transient dep + + QUnit.test('it returns old babel added by a dormant transient dependency', function (assert) { + assert.deepEqual( + addonsInfoFor(Project.withTransientDep({ emberCliBabel: '^6.0.0', hasJSFiles: false })), + [ + { + parent: 'my-nested-addon@0.1.0', + topLevel: 'my-addon', + version: '6.0.0', + requirement: '^6.0.0', + compatible: false, + dormant: true, + path: ['my-addon@1.0.0', 'my-nested-addon@0.1.0'], + }, + ] + ); + }); + + QUnit.test( + 'it returns old but compatible babel added by a dormant transient dependency', + function (assert) { + assert.deepEqual( + addonsInfoFor(Project.withTransientDep({ emberCliBabel: '^7.0.0', hasJSFiles: false })), + [ + { + parent: 'my-nested-addon@0.1.0', + topLevel: 'my-addon', + version: '7.0.0', + requirement: '^7.0.0', + compatible: true, + dormant: true, + path: ['my-addon@1.0.0', 'my-nested-addon@0.1.0'], + }, + ] + ); + } + ); + + QUnit.test('it does not return new babel added by a dormant transient dependency', function ( + assert + ) { + assert.deepEqual( + addonsInfoFor(Project.withDep({ emberCliBabel: '^7.26.6', hasJSFiles: false })), + [] + ); + }); + + // transient dep through a dormant dep + + QUnit.test( + 'it returns old babel added by a transient dependency through a dormant dependency', + function (assert) { + assert.deepEqual( + addonsInfoFor( + Project.withTransientDep({ emberCliBabel: '^6.0.0' }, { hasJSFiles: false }) + ), + [ + { + parent: 'my-nested-addon@0.1.0', + topLevel: 'my-addon', + version: '6.0.0', + requirement: '^6.0.0', + compatible: false, + dormant: false, + path: ['my-addon@1.0.0', 'my-nested-addon@0.1.0'], + }, + ] + ); + } + ); + + QUnit.test( + 'it returns old but compatible babel added by a transient dependency through a dormant dependency', + function (assert) { + assert.deepEqual( + addonsInfoFor( + Project.withTransientDep({ emberCliBabel: '^7.0.0' }, { hasJSFiles: false }) + ), + [ + { + parent: 'my-nested-addon@0.1.0', + topLevel: 'my-addon', + version: '7.0.0', + requirement: '^7.0.0', + compatible: true, + dormant: false, + path: ['my-addon@1.0.0', 'my-nested-addon@0.1.0'], + }, + ] + ); + } + ); + + QUnit.test( + 'it does not return new babel added by a transient dependency through a dormant dependency', + function (assert) { + assert.deepEqual( + addonsInfoFor(Project.withDep({ emberCliBabel: '^7.26.6' }, { hasJSFiles: false })), + [] + ); + } + ); + + // linked dep + + QUnit.test('it returns old babel added by a linked dependency', function (assert) { + assert.deepEqual( + addonsInfoFor( + new Project({ + devDependencies: { + 'ember-source': 'link:3.27.3', + }, + addons: [ + { + name: 'ember-source', + emberCliBabel: '^6.0.0', + }, + ], + }) + ), + [ + { + parent: 'ember-source@3.27.3', + topLevel: 'ember-source', + version: '6.0.0', + requirement: '^6.0.0', + compatible: false, + dormant: false, + path: ['ember-source@3.27.3'], + }, + ] + ); + }); + + QUnit.test('it returns old but compatible babel added by a linked dependency', function ( + assert + ) { + assert.deepEqual( + addonsInfoFor( + new Project({ + devDependencies: { + 'ember-source': 'link:3.27.3', + }, + addons: [ + { + name: 'ember-source', + emberCliBabel: '^7.0.0', + }, + ], + }) + ), + [ + { + parent: 'ember-source@3.27.3', + topLevel: 'ember-source', + version: '7.0.0', + requirement: '^7.0.0', + compatible: true, + dormant: false, + path: ['ember-source@3.27.3'], + }, + ] + ); + }); + + QUnit.test('it does not return new babel added by a linked dependency', function (assert) { + assert.deepEqual( + addonsInfoFor( + new Project({ + devDependencies: { + 'ember-source': 'link:3.27.3', + }, + addons: [ + { + name: 'ember-source', + emberCliBabel: '^7.26.6', + }, + ], + }) + ), + [] + ); + }); + + // full example + + QUnit.test('full example', function (assert) { + let project = new Project(fullExample()); + + assert.deepEqual(addonsInfoFor(project), [ + { + parent: 'direwolf (your app)', + topLevel: null, + version: '7.26.5', + requirement: '^7.26.3', + compatible: true, + dormant: false, + path: [], + }, + { + parent: 'active-model-adapter@2.2.0', + topLevel: 'active-model-adapter', + version: '6.18.0', + requirement: '^6.18.0', + compatible: false, + dormant: false, + path: ['active-model-adapter@2.2.0'], + }, + { + parent: 'ember-angle-bracket-invocation-polyfill@2.0.0', + topLevel: 'ember-animated', + version: '6.18.0', + requirement: '^6.16.0', + compatible: false, + dormant: true, + path: ['ember-animated@0.11.0', 'ember-angle-bracket-invocation-polyfill@2.0.0'], + }, + { + parent: 'ember-animated@0.11.0', + topLevel: 'ember-animated', + version: '7.26.5', + requirement: '^7.26.3', + compatible: true, + dormant: false, + path: ['ember-animated@0.11.0'], + }, + { + parent: 'ember-fetch@8.0.5', + topLevel: 'ember-fetch', + version: '7.26.0', + requirement: '^7.26.0', + compatible: true, + dormant: true, + path: ['ember-fetch@8.0.5'], + }, + ]); + }); + }); + + QUnit.module('.printList', function () { + QUnit.test('it can print a flat list', function (assert) { + assert.equal( + Overrides.printList(['first', 'second', 'third'], ' '), + `\ + * first + * second + * third +` + ); + }); + + QUnit.test('it can print a nested list', function (assert) { + assert.equal( + Overrides.printList( + [ + 'first', + [ + 'second', + ['second.1', ['second.2', ['second.2.1', 'second.2.2', 'second.2.3']], 'second.3'], + ], + 'third', + ], + ' ' + ), + `\ + * first + * second + * second.1 + * second.2 + * second.2.1 + * second.2.2 + * second.2.3 + * second.3 + * third +` + ); + }); + }); + + QUnit.test('it does nothing when in production', function (assert) { + let project = new Project(fullExample()); + let overrides = Overrides.for(project, { EMBER_ENV: 'production' }); + + assert.strictEqual(overrides.hasOverrides, false, 'hasOverrides'); + assert.strictEqual(overrides.hasBuildTimeWarning, false, 'hasBuildTimeWarning'); + }); + + QUnit.test('it does nothing when everything is on new babel', function (assert) { + let overrides = new Overrides([]); + + assert.strictEqual(overrides.hasOverrides, false, 'hasOverrides'); + assert.strictEqual(overrides.hasBuildTimeWarning, false, 'hasBuildTimeWarning'); + }); + + QUnit.test('when app is on old babel', function (assert) { + let overrides = new Overrides([infoForApp({ version: '6.0.0' })]); + + assert.strictEqual(overrides.hasOverrides, true, 'hasOverrides'); + assert.strictEqual(overrides.hasBuildTimeWarning, true, 'hasBuildTimeWarning'); + assert.strictEqual(overrides.hasActionableSuggestions, true, 'hasActionableSuggestions'); + assert.strictEqual(overrides.hasCompatibleAddons, false, 'hasCompatibleAddons'); + assert.strictEqual(overrides.hasDormantAddons, false, 'hasDormantAddons'); + assert.strictEqual( + overrides.showAllEmberGlobalDeprecations, + false, + 'showAllEmberGlobalDeprecations' + ); + assert.strictEqual( + overrides.showAllDotAccessDeprecations, + false, + 'showAllDotAccessDeprecations' + ); + assert.deepEqual(overrides.suggestions, [ + 'Upgrade your `devDependencies` on `ember-cli-babel` to `^7.26.6`.', + ]); + assert.equal( + overrides.outdated.length, + 1 /* number of different old babel versions */, + 'outdated.length' + ); + assert.ok( + overrides.buildTimeWarning.startsWith( + '[DEPRECATION] Usage of the Ember Global is deprecated.' + ), + 'overrides.buildTimeWarning' + ); + assert.ok( + overrides.globalMessage.startsWith('Usage of the Ember Global is deprecated.'), + 'overrides.globalMessage' + ); + + let { onEmberGlobalAccess, onComputedDotAccess, onRunloopDotAccess } = evalJS(overrides); + + assert.equal( + onEmberGlobalAccess(), + overrides.globalMessage, + 'onEmberGlobalAccess() (first call)' + ); + + assert.strictEqual(onEmberGlobalAccess(), null, 'onEmberGlobalAccess() (second call)'); + + assert.ok( + onComputedDotAccess('computed.reads', 'reads', '@ember/object/computed').startsWith( + 'Using `computed.reads` has been deprecated. ' + + 'Instead, import the value directly from @ember/object/computed:\n\n' + + " import { reads } from '@ember/object/computed';\n\n" + ), + 'onComputedDotAccess() (first call)' + ); + + assert.strictEqual( + onComputedDotAccess('computed.reads', 'reads', '@ember/object/computed'), + null, + 'onComputedDotAccess() (second call)' + ); + + assert.ok( + onRunloopDotAccess('run.next', 'next', '@ember/runloop').startsWith( + 'Using `run.next` has been deprecated. ' + + 'Instead, import the value directly from @ember/runloop:\n\n' + + " import { next } from '@ember/runloop';\n\n" + ), + 'onRunloopDotAccess() (first call)' + ); + + assert.strictEqual( + onRunloopDotAccess('run.next', 'next', '@ember/runloop'), + null, + 'onRunloopDotAccess() (second call)' + ); + }); + + // let project, env; + + // function buildBabel(parent, version) { + // return { + // name: 'ember-cli-babel', + // parent, + // pkg: { + // version, + // }, + // addons: [], + // }; + // } + + // hooks.beforeEach(function () { + // project = { + // name() { + // return 'fake-project'; + // }, + // pkg: { + // dependencies: {}, + // devDependencies: {}, + // }, + // addons: [], + // }; + // env = Object.create(null); + // }); + + // hooks.afterEach(function () {}); + + // QUnit.test('when in production, does nothing', function (assert) { + // env.EMBER_ENV = 'production'; + + // let result = globalDeprecationInfo(project, env); + + // assert.deepEqual(result, { + // globalMessage: '', + // hasActionableSuggestions: false, + // shouldIssueSingleDeprecation: false, + // bootstrap: `require('@ember/-internals/bootstrap').default()`, + // }); + // }); + + // QUnit.test('without addons, does nothing', function (assert) { + // project.addons = []; + // let result = globalDeprecationInfo(project, env); + + // assert.deepEqual(result, { + // globalMessage: '', + // hasActionableSuggestions: false, + // shouldIssueSingleDeprecation: false, + // bootstrap: `require('@ember/-internals/bootstrap').default()`, + // }); + // }); + + // QUnit.test('projects own ember-cli-babel is too old', function (assert) { + // project.pkg.devDependencies = { + // 'ember-cli-babel': '^7.26.0', + // }; + + // project.addons.push({ + // name: 'ember-cli-babel', + // parent: project, + // pkg: { + // version: '7.26.5', + // }, + // addons: [], + // }); + + // let result = globalDeprecationInfo(project, env); + // assert.strictEqual(result.shouldIssueSingleDeprecation, true); + // assert.strictEqual(result.hasActionableSuggestions, true); + // assert.ok( + // result.globalMessage.includes( + // '* Upgrade your `devDependencies` on `ember-cli-babel` to `^7.26.6`' + // ) + // ); + // }); + + // QUnit.test('projects has ember-cli-babel in dependencies', function (assert) { + // project.pkg.dependencies = { + // 'ember-cli-babel': '^7.25.0', + // }; + + // project.addons.push({ + // name: 'ember-cli-babel', + // parent: project, + // pkg: { + // version: '7.26.5', + // }, + // addons: [], + // }); + + // let result = globalDeprecationInfo(project, env); + // assert.strictEqual(result.shouldIssueSingleDeprecation, true); + // assert.strictEqual(result.hasActionableSuggestions, true); + // assert.ok( + // result.globalMessage.includes( + // '* Upgrade your `devDependencies` on `ember-cli-babel` to `^7.26.6`' + // ) + // ); + // }); + // QUnit.test( + // 'projects has no devDependencies, but old ember-cli-babel found in addons array', + // function (assert) { + // project.pkg.devDependencies = {}; + + // project.addons.push({ + // name: 'ember-cli-babel', + // parent: project, + // pkg: { + // version: '7.26.5', + // }, + // addons: [], + // }); + + // let result = globalDeprecationInfo(project, env); + // assert.strictEqual(result.shouldIssueSingleDeprecation, true); + // assert.strictEqual(result.hasActionableSuggestions, true); + // assert.ok( + // result.globalMessage.includes( + // '* Upgrade your `devDependencies` on `ember-cli-babel` to `^7.26.6`' + // ) + // ); + // } + // ); + + // QUnit.test('projects uses linked ember-cli-babel', function (assert) { + // project.pkg.devDependencies = { + // 'ember-cli-babel': 'link:./some/path/here', + // }; + + // let otherAddon = { + // name: 'other-thing-here', + // parent: project, + // pkg: {}, + // addons: [], + // }; + + // otherAddon.addons.push(buildBabel(otherAddon, '7.26.5')); + // project.addons.push(buildBabel(project, '7.26.6'), otherAddon); + + // let result = globalDeprecationInfo(project, env); + // assert.strictEqual(result.shouldIssueSingleDeprecation, true); + // assert.strictEqual(result.hasActionableSuggestions, true); + + // assert.ok( + // result.globalMessage.includes( + // '* If using yarn, run `npx yarn-deduplicate --packages ember-cli-babel`' + // ) + // ); + // assert.ok(result.globalMessage.includes('* If using npm, run `npm dedupe`')); + // }); + + // QUnit.test('projects own ember-cli-babel is up to date', function (assert) { + // project.pkg.devDependencies = { + // 'ember-cli-babel': '^7.26.0', + // }; + + // project.addons.push({ + // name: 'ember-cli-babel', + // parent: project, + // pkg: { + // version: '7.26.6', + // }, + // addons: [], + // }); + + // let result = globalDeprecationInfo(project, env); + // assert.strictEqual(result.shouldIssueSingleDeprecation, false); + // assert.strictEqual(result.hasActionableSuggestions, false); + // assert.notOk( + // result.globalMessage.includes( + // '* Upgrade your `devDependencies` on `ember-cli-babel` to `^7.26.6`' + // ) + // ); + // }); + + // QUnit.test('transient babel that is out of date', function (assert) { + // project.pkg.devDependencies = { + // 'ember-cli-babel': '^7.26.0', + // }; + + // let otherAddon = { + // name: 'other-thing-here', + // parent: project, + // pkg: { + // dependencies: { + // 'ember-cli-babel': '^7.25.0', + // }, + // }, + // addons: [], + // }; + + // otherAddon.addons.push(buildBabel(otherAddon, '7.26.5')); + // project.addons.push(buildBabel(project, '7.26.6'), otherAddon); + + // let result = globalDeprecationInfo(project, env); + // assert.strictEqual(result.shouldIssueSingleDeprecation, true); + // assert.strictEqual(result.hasActionableSuggestions, true); + // assert.ok(result.globalMessage.includes('* other-thing-here@7.26.5 (Compatible)')); + // }); +}); From edbfc03727da12b24ca8a6a0cf9b350c6fc73765 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Thu, 3 Jun 2021 16:23:24 -0400 Subject: [PATCH 28/61] Add v3.27.3 to CHANGELOG.md. --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8107d58b833..26c9223f2a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,12 @@ - [#19472](https://github.com/emberjs/ember.js/pull/19472) [BUGFIX] Prevent transformation of block params called `attrs` +## v3.27.3 (June 3, 2021) + +- [#19565](https://github.com/emberjs/ember.js/pull/19565) [BUGFIX] Ensures that `computed` can depend on dynamic `(hash` keys +- [#19571](https://github.com/emberjs/ember.js/pull/19571) [BUGFIX] Extend `Route.prototype.transitionTo` deprecation until 5.0.0 +- [#19586](https://github.com/emberjs/ember.js/pull/19586) [BUGFIX] Fix Embroider compatibility + ### v3.27.2 (May 27, 2021) - [#19511](https://github.com/emberjs/ember.js/pull/19511) / [#19548](https://github.com/emberjs/ember.js/pull/19548) [BUGFIX] Makes the (hash) helper lazy From e31720c3a4cc218d5ec2f92e67e145920e9f311b Mon Sep 17 00:00:00 2001 From: Katie Gengler Date: Mon, 7 Jun 2021 14:23:54 -0400 Subject: [PATCH 29/61] Add v3.28.0-beta.4 to CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26c9223f2a4..bf7e5c29556 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Ember Changelog +### v3.28.0-beta.4 (June 7, 2021) + +- [#19586](https://github.com/emberjs/ember.js/pull/19586) [BUGFIX] Fix Embroider compatibility + ### v3.28.0-beta.3 (June 1, 2021) - [#19565](https://github.com/emberjs/ember.js/pull/19565) [BUGFIX] Ensures that computed can depend on dynamic hash keys From 2f54b0b27e91a15ca4c6e7d4e715e7ed6fdff8b7 Mon Sep 17 00:00:00 2001 From: Katie Gengler Date: Mon, 7 Jun 2021 14:27:49 -0400 Subject: [PATCH 30/61] Release v3.28.0-beta.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fc2e5c85350..9f7e36c5d26 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ember-source", - "version": "3.28.0-beta.3", + "version": "3.28.0-beta.4", "description": "A JavaScript framework for creating ambitious web applications", "keywords": [ "ember-addon" From 5571a8b9b42948754bea32a987c818c86b491d86 Mon Sep 17 00:00:00 2001 From: Camille TJHOA Date: Wed, 9 Jun 2021 14:35:19 +0000 Subject: [PATCH 31/61] [DOC release] Fix "Dormant" addon warning typo (cherry picked from commit fcf2a64dba1dd2621ac000c1ac733e17142f7cf4) --- lib/overrides.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/overrides.js b/lib/overrides.js index 9eb67acaf56..4eaed77a0c8 100644 --- a/lib/overrides.js +++ b/lib/overrides.js @@ -233,7 +233,7 @@ module.exports = class Overrides { details += '\nNote: Addons marked as "Dormant" does not appear to have any JavaScript files. ' + 'Therefore, even if they are using an old version ember-cli-babel, they are ' + - 'unlikely to be the cuplrit of this deprecation and can likely be ignored.\n'; + 'unlikely to be the culprit of this deprecation and can likely be ignored.\n'; } if (this.hasCompatibleAddons) { From 2392417347f151457c16792541e3da2b78c5e6dc Mon Sep 17 00:00:00 2001 From: Godfrey Chan Date: Wed, 9 Jun 2021 12:54:07 -0700 Subject: [PATCH 32/61] Add CHANGELOG for v3.27.4 (cherry picked from commit fe32020e181de85b4b2e480792f8ad1db3e5eee1) --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf7e5c29556..fa917a03857 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,11 +24,16 @@ - [#19472](https://github.com/emberjs/ember.js/pull/19472) [BUGFIX] Prevent transformation of block params called `attrs` +## v3.27.4 (June 9, 2021) + +- [#19594](https://github.com/emberjs/ember.js/pull/19594) [BUGFIX] Revert lazy hash changes +- [#19596](https://github.com/emberjs/ember.js/pull/19596) [DOC] Fix "Dormant" addon warning typo + ## v3.27.3 (June 3, 2021) - [#19565](https://github.com/emberjs/ember.js/pull/19565) [BUGFIX] Ensures that `computed` can depend on dynamic `(hash` keys - [#19571](https://github.com/emberjs/ember.js/pull/19571) [BUGFIX] Extend `Route.prototype.transitionTo` deprecation until 5.0.0 -- [#19586](https://github.com/emberjs/ember.js/pull/19586) [BUGFIX] Fix Embroider compatibility +- [#19586](https://github.com/emberjs/ember.js/pull/19586) [BUGFIX] Fix Embroider compatibility ### v3.27.2 (May 27, 2021) From 1736bfe426586dfb5b4d38ca5ff4cbaf761a8d36 Mon Sep 17 00:00:00 2001 From: Godfrey Chan Date: Thu, 10 Jun 2021 10:34:04 -0700 Subject: [PATCH 33/61] [BIGFIX release] Fix `` with nested children During bubbling, `event.target` may point to a child element whereas `event.currentTarget` always points to the element where the handler was attached, which is what we want here. Reported in a comment on #19546, though this may be a distinct issue from the original report as it was reported as a default-cancelling parent element interfering with the nested ``, and this is the other way around. (cherry picked from commit 57907a4d7d91aa58b3b3ac1258e639ce221f9492) --- .../glimmer/lib/components/link-to.ts | 2 +- .../components/link-to/routing-angle-test.js | 41 +++++++++++++++++++ .../components/link-to/routing-curly-test.js | 41 +++++++++++++++++++ 3 files changed, 83 insertions(+), 1 deletion(-) diff --git a/packages/@ember/-internals/glimmer/lib/components/link-to.ts b/packages/@ember/-internals/glimmer/lib/components/link-to.ts index 40ee661d959..a139ba18c80 100644 --- a/packages/@ember/-internals/glimmer/lib/components/link-to.ts +++ b/packages/@ember/-internals/glimmer/lib/components/link-to.ts @@ -138,7 +138,7 @@ class LinkTo extends InternalComponent implements DeprecatingInternalComponent { return; } - let element = event.target; + let element = event.currentTarget; assert('[BUG] must be an element', element instanceof HTMLAnchorElement); let isSelf = element.target === '' || element.target === '_self'; diff --git a/packages/@ember/-internals/glimmer/tests/integration/components/link-to/routing-angle-test.js b/packages/@ember/-internals/glimmer/tests/integration/components/link-to/routing-angle-test.js index 60ac6577dac..fa7e4c22561 100644 --- a/packages/@ember/-internals/glimmer/tests/integration/components/link-to/routing-angle-test.js +++ b/packages/@ember/-internals/glimmer/tests/integration/components/link-to/routing-angle-test.js @@ -92,6 +92,47 @@ moduleFor( ); } + async ['@test [GH#19546] it navigates into the named route when containing other elements']( + assert + ) { + this.addTemplate( + 'about', + ` +

About

+ Home + Self + ` + ); + + await this.visit('/about'); + + assert.equal(this.$('h3.about').length, 1, 'The about template was rendered'); + assert.equal( + this.$('#self-link.active').length, + 1, + 'The self-link was rendered with active class' + ); + assert.equal( + this.$('#home-link:not(.active)').length, + 1, + 'The other link was rendered without active class' + ); + + await this.click('#inside'); + + assert.equal(this.$('h3.home').length, 1, 'The home template was rendered'); + assert.equal( + this.$('#self-link.active').length, + 1, + 'The self-link was rendered with active class' + ); + assert.equal( + this.$('#about-link:not(.active)').length, + 1, + 'The other link was rendered without active class' + ); + } + async [`@test [DEPRECATED] it doesn't add an href when the tagName isn't 'a'`](assert) { this.addTemplate( 'index', diff --git a/packages/@ember/-internals/glimmer/tests/integration/components/link-to/routing-curly-test.js b/packages/@ember/-internals/glimmer/tests/integration/components/link-to/routing-curly-test.js index 138a66f7068..2ecf5ae4cf0 100644 --- a/packages/@ember/-internals/glimmer/tests/integration/components/link-to/routing-curly-test.js +++ b/packages/@ember/-internals/glimmer/tests/integration/components/link-to/routing-curly-test.js @@ -92,6 +92,47 @@ moduleFor( ); } + async ['@test [GH#19546] it navigates into the named route when containing other elements']( + assert + ) { + this.addTemplate( + 'about', + ` +

About

+ + + ` + ); + + await this.visit('/about'); + + assert.equal(this.$('h3.about').length, 1, 'The about template was rendered'); + assert.equal( + this.$('#self-link > a.active').length, + 1, + 'The self-link was rendered with active class' + ); + assert.equal( + this.$('#home-link > a:not(.active)').length, + 1, + 'The other link was rendered without active class' + ); + + await this.click('#inside'); + + assert.equal(this.$('h3.home').length, 1, 'The home template was rendered'); + assert.equal( + this.$('#self-link > a.active').length, + 1, + 'The self-link was rendered with active class' + ); + assert.equal( + this.$('#about-link > a:not(.active)').length, + 1, + 'The other link was rendered without active class' + ); + } + async [`@test [DEPRECATED] it doesn't add an href when the tagName isn't 'a'`](assert) { this.addTemplate( 'index', From 428e7a05233e0c508dfbf339ae2f241a71109380 Mon Sep 17 00:00:00 2001 From: Godfrey Chan Date: Thu, 10 Jun 2021 11:52:00 -0700 Subject: [PATCH 34/61] Add CHANGELOG for 3.27.5 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa917a03857..a4e9cd2244b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,10 @@ - [#19472](https://github.com/emberjs/ember.js/pull/19472) [BUGFIX] Prevent transformation of block params called `attrs` +## v3.27.5 (June 10, 2021) + +- [#19597](https://github.com/emberjs/ember.js/pull/19597) [BIGFIX] Fix `` with nested children + ## v3.27.4 (June 9, 2021) - [#19594](https://github.com/emberjs/ember.js/pull/19594) [BUGFIX] Revert lazy hash changes From 7de1e204dc72da3198ad6324039291b94154eeeb Mon Sep 17 00:00:00 2001 From: Katie Gengler Date: Mon, 14 Jun 2021 14:07:26 -0400 Subject: [PATCH 35/61] Add v3.28.0-beta.5 to CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4e9cd2244b..51c3cf06412 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Ember Changelog +### v3.28.0-beta.5 (June 14, 2021) + +- [#19597](https://github.com/emberjs/ember.js/pull/19597) [BUGFIX] Fix `` with nested children + ### v3.28.0-beta.4 (June 7, 2021) - [#19586](https://github.com/emberjs/ember.js/pull/19586) [BUGFIX] Fix Embroider compatibility From e2615171a890a62d3143e5d0caf12cf068af454a Mon Sep 17 00:00:00 2001 From: Katie Gengler Date: Mon, 14 Jun 2021 14:08:32 -0400 Subject: [PATCH 36/61] Release v3.28.0-beta.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9f7e36c5d26..70b53c8eeeb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ember-source", - "version": "3.28.0-beta.4", + "version": "3.28.0-beta.5", "description": "A JavaScript framework for creating ambitious web applications", "keywords": [ "ember-addon" From 2971607540ee06fd097fab0789cd0e360a8fc4b8 Mon Sep 17 00:00:00 2001 From: Chris Garrett Date: Tue, 1 Jun 2021 16:36:34 -0700 Subject: [PATCH 37/61] [BUGFIX lts] Ensure hash objects correctly entangle as dependencies v2 The previous bugfixes to `{{hash}}` caused a change to the semantics of computed properties that depend on a hash. Specifically, because `{{hash}}` objects are now proxies, they are _constant_, never updating again after they are initially created. This is fine if you depend on an individual key in a hash, but breaks if you depend directly on the hash itself: ```js computed('hash.foo', function() {}) // this works computed('hash', function() {}) // this will no longer rerun ``` This is used occasionally when you wish to depend on the dynamic keys of a dictionary, like so: ```js computed('hash', function() { let values = []; for (let key in this.hash) { values.push(hash[key]); } return values; }) ``` Notably, this is not a problem with autotracking, because autotracking will entangle the usage of these keys dynamically. So this is only a problem with legacy systems such as `computed` and `observer` which cannot dynamically add dependencies based on the function's runtime. To fix this, we need to determine if a dependency is a hash when a computed or an observer depends upon it, and then entangle all of its keys if it is. We do this whenever the value is the last value in the chain. (cherry picked from commit 03b20d8370d2a71928ffc40b558f751e276c6850) --- package.json | 26 +- .../link-to/query-params-angle-test.js | 24 ++ .../@ember/-internals/metal/lib/chain-tags.ts | 27 +- yarn.lock | 252 +++++++++--------- 4 files changed, 174 insertions(+), 155 deletions(-) diff --git a/package.json b/package.json index 70b53c8eeeb..cf7dff69c86 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "@babel/plugin-transform-block-scoping": "^7.8.3", "@babel/plugin-transform-object-assign": "^7.8.3", "@ember/edition-utils": "^1.2.0", - "@glimmer/vm-babel-plugins": "0.79.3", + "@glimmer/vm-babel-plugins": "0.79.4", "babel-plugin-debug-macros": "^0.3.3", "babel-plugin-filter-imports": "^4.0.0", "broccoli-concat": "^4.2.4", @@ -76,19 +76,19 @@ }, "devDependencies": { "@babel/preset-env": "^7.9.5", - "@glimmer/compiler": "0.79.3", - "@glimmer/destroyable": "0.79.3", + "@glimmer/compiler": "0.79.4", + "@glimmer/destroyable": "0.79.4", "@glimmer/env": "^0.1.7", - "@glimmer/global-context": "0.79.3", - "@glimmer/interfaces": "0.79.3", - "@glimmer/manager": "0.79.3", - "@glimmer/node": "0.79.3", - "@glimmer/opcode-compiler": "0.79.3", - "@glimmer/owner": "0.79.3", - "@glimmer/program": "0.79.3", - "@glimmer/reference": "0.79.3", - "@glimmer/runtime": "0.79.3", - "@glimmer/validator": "0.79.3", + "@glimmer/global-context": "0.79.4", + "@glimmer/interfaces": "0.79.4", + "@glimmer/manager": "0.79.4", + "@glimmer/node": "0.79.4", + "@glimmer/opcode-compiler": "0.79.4", + "@glimmer/owner": "0.79.4", + "@glimmer/program": "0.79.4", + "@glimmer/reference": "0.79.4", + "@glimmer/runtime": "0.79.4", + "@glimmer/validator": "0.79.4", "@simple-dom/document": "^1.4.0", "@types/qunit": "^2.11.1", "@types/rsvp": "^4.0.3", diff --git a/packages/@ember/-internals/glimmer/tests/integration/components/link-to/query-params-angle-test.js b/packages/@ember/-internals/glimmer/tests/integration/components/link-to/query-params-angle-test.js index 47ad96e478f..2729071af47 100644 --- a/packages/@ember/-internals/glimmer/tests/integration/components/link-to/query-params-angle-test.js +++ b/packages/@ember/-internals/glimmer/tests/integration/components/link-to/query-params-angle-test.js @@ -350,6 +350,30 @@ moduleFor( assert.equal(theLink.attr('href'), '/?foo=ASL'); } + async ['@test supplied QP properties can be bound in legacy components'](assert) { + expectDeprecation(/Passing the `@tagName` argument to/); + + this.addTemplate( + 'index', + ` + + Index + + ` + ); + + await this.visit('/'); + + let indexController = this.getController('index'); + let theLink = this.$('#the-link'); + + assert.equal(theLink.attr('href'), '/?foo=OMG'); + + runTask(() => indexController.set('boundThing', 'ASL')); + + assert.equal(theLink.attr('href'), '/?foo=ASL'); + } + async ['@test supplied QP properties can be bound (booleans)'](assert) { this.addTemplate( 'index', diff --git a/packages/@ember/-internals/metal/lib/chain-tags.ts b/packages/@ember/-internals/metal/lib/chain-tags.ts index 816f9420620..f918196155c 100644 --- a/packages/@ember/-internals/metal/lib/chain-tags.ts +++ b/packages/@ember/-internals/metal/lib/chain-tags.ts @@ -1,6 +1,7 @@ import { Meta, meta as metaFor, peekMeta } from '@ember/-internals/meta'; import { isObject } from '@ember/-internals/utils'; import { assert, deprecate } from '@ember/debug'; +import { isHashProxy } from '@glimmer/runtime'; import { _WeakSet } from '@glimmer/util'; import { combine, @@ -16,7 +17,7 @@ import { tagForProperty } from './tags'; export const CHAIN_PASS_THROUGH = new _WeakSet(); -export function finishLazyChains(meta: Meta, key: string, value: any) { +export function finishLazyChains(meta: Meta, key: string, value: unknown): void { let lazyTags = meta.readableLazyChainsFor(key); if (lazyTags === undefined) { @@ -173,20 +174,6 @@ function getChainTags( chainTags.push(propertyTag); - // If we're at the end of the path, processing the last segment, and it's - // not an alias, we should _not_ get the last value, since we already have - // its tag. There's no reason to access it and do more work. - if (segmentEnd === pathLength) { - // If the key was an alias, we should always get the next value in order to - // bootstrap the alias. This is because aliases, unlike other CPs, should - // always be in sync with the aliased value. - if (CHAIN_PASS_THROUGH.has(descriptor)) { - // tslint:disable-next-line: no-unused-expression - current[segment]; - } - break; - } - if (descriptor === undefined) { // If the descriptor is undefined, then its a normal property, so we should // lookup the value to chain off of like normal. @@ -223,8 +210,16 @@ function getChainTags( } } - if (!isObject(current)) { + if (segmentEnd === pathLength || !isObject(current)) { // we've hit the end of the chain for now, break out + + // If the last value is a HashProxy, then entangle all of its tags + if (isHashProxy(current)) { + for (let key in current) { + chainTags.push(tagForProperty(current, key)); + } + } + break; } diff --git a/yarn.lock b/yarn.lock index c0988a35c33..e195d5cb9c6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1588,52 +1588,52 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" -"@glimmer/compiler@0.79.3": - version "0.79.3" - resolved "https://registry.yarnpkg.com/@glimmer/compiler/-/compiler-0.79.3.tgz#fc68770fe50df0eab0aee0331f40ff26a8ce4763" - integrity sha512-eGuZg/6C9ITUZJswpiIElfTQ9P9zQoZccrwfFyoc6QQRcwPCGkfgLpbAjnOCHON/HNsq8Aa+2iswJzAuVyz4QA== - dependencies: - "@glimmer/interfaces" "0.79.3" - "@glimmer/syntax" "0.79.3" - "@glimmer/util" "0.79.3" - "@glimmer/wire-format" "0.79.3" +"@glimmer/compiler@0.79.4": + version "0.79.4" + resolved "https://registry.yarnpkg.com/@glimmer/compiler/-/compiler-0.79.4.tgz#746909c5f01ad57efec15da79567b515d1e3a6b0" + integrity sha512-aXTows4Kjbutp6BV18oQTFaJjIkX5+hQ25KVETK/5zla/rC9O0DQHGb2r8DDfx4DiJLXGdl4g2VLy/BfkYmcwA== + dependencies: + "@glimmer/interfaces" "0.79.4" + "@glimmer/syntax" "0.79.4" + "@glimmer/util" "0.79.4" + "@glimmer/wire-format" "0.79.4" "@simple-dom/interface" "^1.4.0" -"@glimmer/destroyable@0.79.3": - version "0.79.3" - resolved "https://registry.yarnpkg.com/@glimmer/destroyable/-/destroyable-0.79.3.tgz#a4ee01a5ef7f9e0a5e62668fb992d721c193acd4" - integrity sha512-vAvXi/eh6ca0Upqzqg+y/dsiFzHsh4La1J8oCSv33BXhbjoVWp+V++FaEYoGy4E8/gaDdt9fW8xZOvgBSoIBZw== +"@glimmer/destroyable@0.79.4": + version "0.79.4" + resolved "https://registry.yarnpkg.com/@glimmer/destroyable/-/destroyable-0.79.4.tgz#23a3a13a50063aefb2fa169feae79a373c9132bf" + integrity sha512-qpaglWv+GKlcm28MZvYemWTZV3kSlOKPc7kluRqXvoo7oqQdBEagm60XivMpxJUEf+A5YXsJ/Atty+r58eVvQg== dependencies: "@glimmer/env" "0.1.7" - "@glimmer/global-context" "0.79.3" - "@glimmer/interfaces" "0.79.3" - "@glimmer/util" "0.79.3" + "@glimmer/global-context" "0.79.4" + "@glimmer/interfaces" "0.79.4" + "@glimmer/util" "0.79.4" -"@glimmer/encoder@0.79.3": - version "0.79.3" - resolved "https://registry.yarnpkg.com/@glimmer/encoder/-/encoder-0.79.3.tgz#7f4d957b8c948d04b8594c20ba131701a1bf9453" - integrity sha512-BpZqJOPpIYQyDGR/OtgE9jbjNd47DBo5L/CJmQ1PYZ11QUM5DMUHuxpIxWKKT2JpzYJfPE2xdvYrhJrCUC0Zfg== +"@glimmer/encoder@0.79.4": + version "0.79.4" + resolved "https://registry.yarnpkg.com/@glimmer/encoder/-/encoder-0.79.4.tgz#2e2e7da3f80f21732f7ed0003c391caf4b42acfe" + integrity sha512-qqyW/TWVK1RP/zEVq0NU2EvOViftVyB43BB7y2yVyb+qD3gK0weP1InwPp1tyNUF7B6LHAcd64d4pN29Qj3vHw== dependencies: "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.79.3" - "@glimmer/vm" "0.79.3" + "@glimmer/interfaces" "0.79.4" + "@glimmer/vm" "0.79.4" "@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.79.3": - version "0.79.3" - resolved "https://registry.yarnpkg.com/@glimmer/global-context/-/global-context-0.79.3.tgz#e50fcfa598a6d9e58a9fba1586efed6d789fe24b" - integrity sha512-Aotq1fbYKk8CElF4x1nYJWGufXu7CS/iYUfrpX9v1zIjZMw52tfk1xTlNyRCpM1SCHuUL32QEskGAPDLsIYkVw== +"@glimmer/global-context@0.79.4": + version "0.79.4" + resolved "https://registry.yarnpkg.com/@glimmer/global-context/-/global-context-0.79.4.tgz#2d683a457aba7c340a3e850fdcf8a35fbcd8308e" + integrity sha512-Hn6KS7QUV63oMbop1LVOfPZ3KISzq4xMASjP+xrMzLIugvjBYYB+WoarUJcG7eB+TioOo0OMyVFibSP8ZTO2TQ== dependencies: "@glimmer/env" "^0.1.7" -"@glimmer/interfaces@0.79.3": - version "0.79.3" - resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.79.3.tgz#4e0a3ff9cf0b60bdab1a4d420f641ab540d4fc85" - integrity sha512-EFiNKwehbxm1xRsfnNu/5nu8Rw+0IYINL/Hciwl/28T8an7FOxftpy/iXXSaWvIsnPyBHqH1ufwsKYY6KXyNzg== +"@glimmer/interfaces@0.79.4": + version "0.79.4" + resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.79.4.tgz#3213e7fe73f35340762bef7f4e8c8df593a4a8c8" + integrity sha512-cyNZlRa7aXAfXY9kk7hhnWgL1R7Zw8wwi2UVEWq2nBanmpNmL1lSMJ6nY8oRIWCtWrYA9CeH7RZ6mVP5cQ/v2w== dependencies: "@simple-dom/interface" "^1.4.0" @@ -1642,140 +1642,140 @@ resolved "https://registry.yarnpkg.com/@glimmer/low-level/-/low-level-0.78.2.tgz#bca5f666760ce98345e87c5b3e37096e772cb2de" integrity sha512-0S6TWOOd0fzLLysw1pWZN0TgasaHmYs1Sjz9Til1mTByIXU1S+1rhdyr2veSQPO/aRjPuEQyKXZQHvx23Zax6w== -"@glimmer/manager@0.79.3": - version "0.79.3" - resolved "https://registry.yarnpkg.com/@glimmer/manager/-/manager-0.79.3.tgz#02dc843bd6cbc1d5b32321029a8b250c33edc1fa" - integrity sha512-VhIXX9oxrLABuA34iZrrMxwhbxRJCftPyEXyD2ZNwsr9QugtAg2cYvtIWxlf9RllTACJrSU7Gb+0BPYVG+aaaQ== +"@glimmer/manager@0.79.4": + version "0.79.4" + resolved "https://registry.yarnpkg.com/@glimmer/manager/-/manager-0.79.4.tgz#82cefd85d503c5a3c40389f3c869a8abbf273648" + integrity sha512-SCSrBEdu/JvTEFPvgkDu3kaRgJrJHrhAdB2WAoevNb8bMMhADxRPTVSfYDFL/6+eQtx6krcycVeeaCLjhZ2LNA== dependencies: - "@glimmer/destroyable" "0.79.3" + "@glimmer/destroyable" "0.79.4" "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.79.3" - "@glimmer/reference" "0.79.3" - "@glimmer/util" "0.79.3" - "@glimmer/validator" "0.79.3" - -"@glimmer/node@0.79.3": - version "0.79.3" - resolved "https://registry.yarnpkg.com/@glimmer/node/-/node-0.79.3.tgz#536457cc016b5c9788088dac8366fef9c98b7fff" - integrity sha512-iNC+TnEvKPRLFNQ6YJOH10NSAHVa7/aCejD+wR8BeOSBq1bbPQTmuQTluKRIwjDww+Np68SEjQ7Wkzvp2Lnivw== - dependencies: - "@glimmer/interfaces" "0.79.3" - "@glimmer/runtime" "0.79.3" - "@glimmer/util" "0.79.3" + "@glimmer/interfaces" "0.79.4" + "@glimmer/reference" "0.79.4" + "@glimmer/util" "0.79.4" + "@glimmer/validator" "0.79.4" + +"@glimmer/node@0.79.4": + version "0.79.4" + resolved "https://registry.yarnpkg.com/@glimmer/node/-/node-0.79.4.tgz#734ed99979fe8c396af3c356c0a5d5eee835d552" + integrity sha512-EDv/PkLGf92aFc7J8qKtBUd6ewxC5udntN6Syj0VHJ2MQeikVJWyZHwJbZP5+VUw8AbjuSKPc0Nt8G37Y2xtug== + dependencies: + "@glimmer/interfaces" "0.79.4" + "@glimmer/runtime" "0.79.4" + "@glimmer/util" "0.79.4" "@simple-dom/document" "^1.4.0" "@simple-dom/interface" "^1.4.0" -"@glimmer/opcode-compiler@0.79.3": - version "0.79.3" - resolved "https://registry.yarnpkg.com/@glimmer/opcode-compiler/-/opcode-compiler-0.79.3.tgz#dc27d49d4236060b650e41f16526fd136e7a5d17" - integrity sha512-1SDl6YQ/xYAuYD/P70YHkoKri0YZSG8ELx9n1ZKVr1sB0xv6tiIrYOyhhy+omlmcRSQwWd0XEDp/4eeb7UNjlQ== +"@glimmer/opcode-compiler@0.79.4": + version "0.79.4" + resolved "https://registry.yarnpkg.com/@glimmer/opcode-compiler/-/opcode-compiler-0.79.4.tgz#c5dffda71216909a8b17d9ff3223a82ef018dde9" + integrity sha512-K/29Wvy5nzo3deLGVZhoziznLsd8+psKhA8SO2zpS7a1a7HCSAL8SvXUZFsdsUZSU0gBmCPmw+sXSkyZTpu5CA== dependencies: - "@glimmer/encoder" "0.79.3" + "@glimmer/encoder" "0.79.4" "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.79.3" - "@glimmer/reference" "0.79.3" - "@glimmer/util" "0.79.3" - "@glimmer/vm" "0.79.3" - "@glimmer/wire-format" "0.79.3" + "@glimmer/interfaces" "0.79.4" + "@glimmer/reference" "0.79.4" + "@glimmer/util" "0.79.4" + "@glimmer/vm" "0.79.4" + "@glimmer/wire-format" "0.79.4" -"@glimmer/owner@0.79.3": - version "0.79.3" - resolved "https://registry.yarnpkg.com/@glimmer/owner/-/owner-0.79.3.tgz#0c8aeea009bf2e01653e8419754d7b8ea57607c2" - integrity sha512-vEybTpdeiaDHqRX8TaNAIz7fNlE0lii4kPTxl04me8H3YAE3nKluUxgoChWMRcgakGJ8bCzVa7p215Ap/6ULtg== +"@glimmer/owner@0.79.4": + version "0.79.4" + resolved "https://registry.yarnpkg.com/@glimmer/owner/-/owner-0.79.4.tgz#ebb300eaf23986c94705cbff8c4415ed1eaad9e9" + integrity sha512-6w24OglbMeib1xJVxOnTBoiCQbeLtDLDSzisn9z3o6+Iv3NCMzylyjv25JU9TqJydEPftDG/An/h/Aswb8iEFw== dependencies: - "@glimmer/util" "0.79.3" + "@glimmer/util" "0.79.4" -"@glimmer/program@0.79.3": - version "0.79.3" - resolved "https://registry.yarnpkg.com/@glimmer/program/-/program-0.79.3.tgz#f77b8e81842a7b3cf8a1063fc3167d2cd82d9724" - integrity sha512-vIhBlnpt+czkgJhm/OrVcrxbwxgEue6H8UMSoc5vdNiJDHUWOrYdJhr1mh1DGgvM0qqPySKJhgjo3apmA5sW+w== +"@glimmer/program@0.79.4": + version "0.79.4" + resolved "https://registry.yarnpkg.com/@glimmer/program/-/program-0.79.4.tgz#80cfda3261388caeeb66ccc46fac469d2e788b71" + integrity sha512-8wvhs7xUTdbAtG+oV19PKSFsyFujnRjl4gPs76Pr7GLHX25XOBhGxL8TptPm0JShxuvB2TMZrBwMGc3rhe402g== dependencies: - "@glimmer/encoder" "0.79.3" + "@glimmer/encoder" "0.79.4" "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.79.3" - "@glimmer/manager" "0.79.3" - "@glimmer/opcode-compiler" "0.79.3" - "@glimmer/util" "0.79.3" + "@glimmer/interfaces" "0.79.4" + "@glimmer/manager" "0.79.4" + "@glimmer/opcode-compiler" "0.79.4" + "@glimmer/util" "0.79.4" -"@glimmer/reference@0.79.3": - version "0.79.3" - resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.79.3.tgz#4c3eed5e2c810c43145a68cb2fa4f337f0b154b8" - integrity sha512-c++SMUVBzpTxd7W9LF2GvCwYIiLPbdrh6kmqOEprH9v/jt4gJkagSBCl84/t6m4NPOYIql19NpK3QqfVSxTDIA== +"@glimmer/reference@0.79.4": + version "0.79.4" + resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.79.4.tgz#3d9fcf5e57c63583da14f243128a3195f650e568" + integrity sha512-neCaUe9vqc/zGj1kNdm1ssHQ/9icC0BJd8xjYf6vAjiJ/TKEL+u+PfL8H8zqdWAK2al5zekNlhHFY55NxzX8bQ== dependencies: "@glimmer/env" "^0.1.7" - "@glimmer/global-context" "0.79.3" - "@glimmer/interfaces" "0.79.3" - "@glimmer/util" "0.79.3" - "@glimmer/validator" "0.79.3" + "@glimmer/global-context" "0.79.4" + "@glimmer/interfaces" "0.79.4" + "@glimmer/util" "0.79.4" + "@glimmer/validator" "0.79.4" -"@glimmer/runtime@0.79.3": - version "0.79.3" - resolved "https://registry.yarnpkg.com/@glimmer/runtime/-/runtime-0.79.3.tgz#1ff2051e22eff68fe27f536059484a7b0a70fdb9" - integrity sha512-3GO48ddGTuQQIe/16Y4hLDiweTVdLCIn7q6fpzHf+B/ieoVhxu8YkyKYgGEex3UHz+C+GkJxW1hru4cfp0APmA== +"@glimmer/runtime@0.79.4": + version "0.79.4" + resolved "https://registry.yarnpkg.com/@glimmer/runtime/-/runtime-0.79.4.tgz#188044848721f710859c35eecec15293b8c98bba" + integrity sha512-jacyHy7zQ39kR6c4BvPUXpnNDSybnFpFplnhsa0Fr8IqnXRTKqNv1KdfBwdbbPQNaojuV6vyWoh0jPErkcgh0w== dependencies: - "@glimmer/destroyable" "0.79.3" + "@glimmer/destroyable" "0.79.4" "@glimmer/env" "0.1.7" - "@glimmer/global-context" "0.79.3" - "@glimmer/interfaces" "0.79.3" + "@glimmer/global-context" "0.79.4" + "@glimmer/interfaces" "0.79.4" "@glimmer/low-level" "0.78.2" - "@glimmer/owner" "0.79.3" - "@glimmer/program" "0.79.3" - "@glimmer/reference" "0.79.3" - "@glimmer/util" "0.79.3" - "@glimmer/validator" "0.79.3" - "@glimmer/vm" "0.79.3" - "@glimmer/wire-format" "0.79.3" + "@glimmer/owner" "0.79.4" + "@glimmer/program" "0.79.4" + "@glimmer/reference" "0.79.4" + "@glimmer/util" "0.79.4" + "@glimmer/validator" "0.79.4" + "@glimmer/vm" "0.79.4" + "@glimmer/wire-format" "0.79.4" "@simple-dom/interface" "^1.4.0" -"@glimmer/syntax@0.79.3": - version "0.79.3" - resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.79.3.tgz#5beadd53494d0f199b83f016af90fa28c3ecaa8c" - integrity sha512-IERTn/mqRk0pZnddAnYjGUV4e93rRf5scY0dYQl2EFvBHFaOdFQPe3fhSCozx0hZpagg5LCOsbRgsMwL9IT9fw== +"@glimmer/syntax@0.79.4": + version "0.79.4" + resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.79.4.tgz#5aa21d4b3918238c24da3d640abc3b66150fc0c6" + integrity sha512-NiMIoW2G0+sBfLYnvDaZ8o8Ul/3P/ezOT8U7ZvsHDGU5hXM2buFozyoSKLILTvAQ56izdfK9fKCsn0oi4ISx3w== dependencies: - "@glimmer/interfaces" "0.79.3" - "@glimmer/util" "0.79.3" + "@glimmer/interfaces" "0.79.4" + "@glimmer/util" "0.79.4" "@handlebars/parser" "~2.0.0" simple-html-tokenizer "^0.5.10" -"@glimmer/util@0.79.3": - version "0.79.3" - resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.79.3.tgz#a54f0383d8e83ca43625e289fe1df6c72ccfb938" - integrity sha512-SVHHA6blGzIM6ZMJErqvzqsapYEsN5hXyobJl+lQAAzBKvaExc7VHQfs10267HxA9WlMNLuu83+tYOu+UR67hA== +"@glimmer/util@0.79.4": + version "0.79.4" + resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.79.4.tgz#4762ed9b231482470cb9763332097d50042f9bde" + integrity sha512-n2lEGzM9khM43HmKlig2lG5L5cHoL4tFzW21CZzmhMfc1IDCqHuP7s7924OsXSbLT1WB7B9sm/ZhnEj2nd+GiQ== dependencies: "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.79.3" + "@glimmer/interfaces" "0.79.4" "@simple-dom/interface" "^1.4.0" -"@glimmer/validator@0.79.3": - version "0.79.3" - resolved "https://registry.yarnpkg.com/@glimmer/validator/-/validator-0.79.3.tgz#1edde5e874629b91a04c5af316b9ba91ecb360ed" - integrity sha512-uXUf24RCqj48T2Hgo6ZXfwAGkBgEOQ2W/Bagg83hBv/4TbUWNt03cHq6ga2FPKpqR/T7SvhN9WM4nc5FqIYGCQ== +"@glimmer/validator@0.79.4": + version "0.79.4" + resolved "https://registry.yarnpkg.com/@glimmer/validator/-/validator-0.79.4.tgz#35bc9c6b88d0681b372f1fba3969e6385465b8d7" + integrity sha512-VLT9TozD3n3qwX9hOECn/d2Ig8PTn0Gl1FdiEpb04tldXWY0YL6oSoLEjH97R4KNqvati2jFQOOzyinzu9Ffkw== dependencies: "@glimmer/env" "^0.1.7" - "@glimmer/global-context" "0.79.3" + "@glimmer/global-context" "0.79.4" -"@glimmer/vm-babel-plugins@0.79.3": - version "0.79.3" - resolved "https://registry.yarnpkg.com/@glimmer/vm-babel-plugins/-/vm-babel-plugins-0.79.3.tgz#a8e6949f8ecc10786831d188f1001eb80927297f" - integrity sha512-346xmhP7J3wqCFKqIlwcaui/A+iHKm0ZWoaKb4lIkuro7/u5j094eEtdbonGq4eTj+UnDPpmzuqLWodXXxxo1Q== +"@glimmer/vm-babel-plugins@0.79.4": + version "0.79.4" + resolved "https://registry.yarnpkg.com/@glimmer/vm-babel-plugins/-/vm-babel-plugins-0.79.4.tgz#317b9b85752abab903674b959ed9e00e1942ae23" + integrity sha512-LEdgx6QXOAm+88TxgrvWvkUc6J6jPKmnMzW3IAiD7aIHasSl+/aKfZF0x3ICHyCXGaJGWI00mVKxd2n61aAY9g== dependencies: babel-plugin-debug-macros "^0.3.4" -"@glimmer/vm@0.79.3": - version "0.79.3" - resolved "https://registry.yarnpkg.com/@glimmer/vm/-/vm-0.79.3.tgz#79b0614116d5b3417e6d0a16c0c91fbf521ccbc4" - integrity sha512-JX1Whpm8GGyoZefXj6jJSNBi/qWKYjC5JbHrJ9KALXYCC2JAabVQlOlfRDV4mQOYv7yCzrpM8ZDCycwHTGuJ6A== +"@glimmer/vm@0.79.4": + version "0.79.4" + resolved "https://registry.yarnpkg.com/@glimmer/vm/-/vm-0.79.4.tgz#1d0f00909c6b97b99d7c8bb11d1e7b958822dbd3" + integrity sha512-enCXJlypgMTxWUupQWCPUvE41Gh4vsCIWVhqdh6ol+QGzRZBGvfXTz5xu5lTKPJQhFQsTn2ecVTKKVhqMOtzpA== dependencies: - "@glimmer/interfaces" "0.79.3" - "@glimmer/util" "0.79.3" + "@glimmer/interfaces" "0.79.4" + "@glimmer/util" "0.79.4" -"@glimmer/wire-format@0.79.3": - version "0.79.3" - resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.79.3.tgz#eac19c32297caa5129f820206b8035b8f77d07f4" - integrity sha512-6izhGKLIeuWbK9FfaM1I+hXYh3EgKpbpbA99SDQav+TMPiFWFy9sos4PyEuywha5p7MZrMDKXip/l49ARG8XHg== +"@glimmer/wire-format@0.79.4": + version "0.79.4" + resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.79.4.tgz#4074b1194650909e295c349e75d2cebb8a03c8bd" + integrity sha512-QuGfVIX1ziyFDPzJaKZnbgyhzzz5a8s/B+xYg5ZEhMo5BHuyL1a3Gw+0qUMCPlVUIX0Uv+VWvI7NF9tH/ykiZA== dependencies: - "@glimmer/interfaces" "0.79.3" - "@glimmer/util" "0.79.3" + "@glimmer/interfaces" "0.79.4" + "@glimmer/util" "0.79.4" "@handlebars/parser@~2.0.0": version "2.0.0" From a01e11de7ba0dd36134bc591c02b5d08d929b0e8 Mon Sep 17 00:00:00 2001 From: Katie Gengler Date: Mon, 21 Jun 2021 19:25:55 -0400 Subject: [PATCH 38/61] Add 3.28.0-beta.6 to CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51c3cf06412..ee34bbefad8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Ember Changelog +### v3.28.0-beta.6 (June 21, 2021) + +- [#19584](https://github.com/emberjs/ember.js/pull/19584) [BUGFIX] Ensure hash objects correctly entangle as dependencies + ### v3.28.0-beta.5 (June 14, 2021) - [#19597](https://github.com/emberjs/ember.js/pull/19597) [BUGFIX] Fix `` with nested children From cd55255b6a8035c523e498087d7cf1f989e54878 Mon Sep 17 00:00:00 2001 From: Katie Gengler Date: Mon, 21 Jun 2021 19:26:24 -0400 Subject: [PATCH 39/61] Release 3.28.0-beta.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cf7dff69c86..aae12fb3ee5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ember-source", - "version": "3.28.0-beta.5", + "version": "3.28.0-beta.6", "description": "A JavaScript framework for creating ambitious web applications", "keywords": [ "ember-addon" From 0825f8a92daf2420d16a8edca34c5f5c01ce5d06 Mon Sep 17 00:00:00 2001 From: Chris Garrett Date: Mon, 26 Jul 2021 19:25:48 -0400 Subject: [PATCH 40/61] [BUGFIX release] Restore previous hash behavior Restores the previous hash behavior where `hash` will lazily update in templates, but eagerly evaluate and create a POJO in JS. Also preserves the deprecation on setting on the hash. (cherry picked from commit a23c71e11281a4998f6e4cecdb5518fbba2e37b0) --- package.json | 26 +- .../tests/integration/helpers/hash-test.js | 3 + .../@ember/-internals/metal/lib/chain-tags.ts | 27 +- yarn.lock | 252 +++++++++--------- 4 files changed, 158 insertions(+), 150 deletions(-) diff --git a/package.json b/package.json index aae12fb3ee5..53448834f0d 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "@babel/plugin-transform-block-scoping": "^7.8.3", "@babel/plugin-transform-object-assign": "^7.8.3", "@ember/edition-utils": "^1.2.0", - "@glimmer/vm-babel-plugins": "0.79.4", + "@glimmer/vm-babel-plugins": "0.80.0", "babel-plugin-debug-macros": "^0.3.3", "babel-plugin-filter-imports": "^4.0.0", "broccoli-concat": "^4.2.4", @@ -76,19 +76,19 @@ }, "devDependencies": { "@babel/preset-env": "^7.9.5", - "@glimmer/compiler": "0.79.4", - "@glimmer/destroyable": "0.79.4", + "@glimmer/compiler": "0.80.0", + "@glimmer/destroyable": "0.80.0", "@glimmer/env": "^0.1.7", - "@glimmer/global-context": "0.79.4", - "@glimmer/interfaces": "0.79.4", - "@glimmer/manager": "0.79.4", - "@glimmer/node": "0.79.4", - "@glimmer/opcode-compiler": "0.79.4", - "@glimmer/owner": "0.79.4", - "@glimmer/program": "0.79.4", - "@glimmer/reference": "0.79.4", - "@glimmer/runtime": "0.79.4", - "@glimmer/validator": "0.79.4", + "@glimmer/global-context": "0.80.0", + "@glimmer/interfaces": "0.80.0", + "@glimmer/manager": "0.80.0", + "@glimmer/node": "0.80.0", + "@glimmer/opcode-compiler": "0.80.0", + "@glimmer/owner": "0.80.0", + "@glimmer/program": "0.80.0", + "@glimmer/reference": "0.80.0", + "@glimmer/runtime": "0.80.0", + "@glimmer/validator": "0.80.0", "@simple-dom/document": "^1.4.0", "@types/qunit": "^2.11.1", "@types/rsvp": "^4.0.3", diff --git a/packages/@ember/-internals/glimmer/tests/integration/helpers/hash-test.js b/packages/@ember/-internals/glimmer/tests/integration/helpers/hash-test.js index 9b3cd24b1a1..3b7955647ce 100644 --- a/packages/@ember/-internals/glimmer/tests/integration/helpers/hash-test.js +++ b/packages/@ember/-internals/glimmer/tests/integration/helpers/hash-test.js @@ -260,7 +260,10 @@ moduleFor( runTask(() => { set(this.context, 'firstName', 'Godfrey'); + }); + // needs to be separate task because of the way classic components update args + runTask(() => { if (HAS_NATIVE_PROXY) { expectDeprecation(() => { set(instance.hash, 'lastName', 'Chan'); diff --git a/packages/@ember/-internals/metal/lib/chain-tags.ts b/packages/@ember/-internals/metal/lib/chain-tags.ts index f918196155c..816f9420620 100644 --- a/packages/@ember/-internals/metal/lib/chain-tags.ts +++ b/packages/@ember/-internals/metal/lib/chain-tags.ts @@ -1,7 +1,6 @@ import { Meta, meta as metaFor, peekMeta } from '@ember/-internals/meta'; import { isObject } from '@ember/-internals/utils'; import { assert, deprecate } from '@ember/debug'; -import { isHashProxy } from '@glimmer/runtime'; import { _WeakSet } from '@glimmer/util'; import { combine, @@ -17,7 +16,7 @@ import { tagForProperty } from './tags'; export const CHAIN_PASS_THROUGH = new _WeakSet(); -export function finishLazyChains(meta: Meta, key: string, value: unknown): void { +export function finishLazyChains(meta: Meta, key: string, value: any) { let lazyTags = meta.readableLazyChainsFor(key); if (lazyTags === undefined) { @@ -174,6 +173,20 @@ function getChainTags( chainTags.push(propertyTag); + // If we're at the end of the path, processing the last segment, and it's + // not an alias, we should _not_ get the last value, since we already have + // its tag. There's no reason to access it and do more work. + if (segmentEnd === pathLength) { + // If the key was an alias, we should always get the next value in order to + // bootstrap the alias. This is because aliases, unlike other CPs, should + // always be in sync with the aliased value. + if (CHAIN_PASS_THROUGH.has(descriptor)) { + // tslint:disable-next-line: no-unused-expression + current[segment]; + } + break; + } + if (descriptor === undefined) { // If the descriptor is undefined, then its a normal property, so we should // lookup the value to chain off of like normal. @@ -210,16 +223,8 @@ function getChainTags( } } - if (segmentEnd === pathLength || !isObject(current)) { + if (!isObject(current)) { // we've hit the end of the chain for now, break out - - // If the last value is a HashProxy, then entangle all of its tags - if (isHashProxy(current)) { - for (let key in current) { - chainTags.push(tagForProperty(current, key)); - } - } - break; } diff --git a/yarn.lock b/yarn.lock index e195d5cb9c6..2f53c60ca77 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1588,52 +1588,52 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" -"@glimmer/compiler@0.79.4": - version "0.79.4" - resolved "https://registry.yarnpkg.com/@glimmer/compiler/-/compiler-0.79.4.tgz#746909c5f01ad57efec15da79567b515d1e3a6b0" - integrity sha512-aXTows4Kjbutp6BV18oQTFaJjIkX5+hQ25KVETK/5zla/rC9O0DQHGb2r8DDfx4DiJLXGdl4g2VLy/BfkYmcwA== - dependencies: - "@glimmer/interfaces" "0.79.4" - "@glimmer/syntax" "0.79.4" - "@glimmer/util" "0.79.4" - "@glimmer/wire-format" "0.79.4" +"@glimmer/compiler@0.80.0": + version "0.80.0" + resolved "https://registry.yarnpkg.com/@glimmer/compiler/-/compiler-0.80.0.tgz#f825b2d5b55500c0a695f076c7a2fdd312a1e94e" + integrity sha512-oz72cvjNHXpKY1i9aJBiLQSkmqW1zbCGc1J/gIGTXeMC5tdJlDXve22eS2ZkNWI41ai3ClzpA0hIz5ju7qO8zw== + dependencies: + "@glimmer/interfaces" "0.80.0" + "@glimmer/syntax" "0.80.0" + "@glimmer/util" "0.80.0" + "@glimmer/wire-format" "0.80.0" "@simple-dom/interface" "^1.4.0" -"@glimmer/destroyable@0.79.4": - version "0.79.4" - resolved "https://registry.yarnpkg.com/@glimmer/destroyable/-/destroyable-0.79.4.tgz#23a3a13a50063aefb2fa169feae79a373c9132bf" - integrity sha512-qpaglWv+GKlcm28MZvYemWTZV3kSlOKPc7kluRqXvoo7oqQdBEagm60XivMpxJUEf+A5YXsJ/Atty+r58eVvQg== +"@glimmer/destroyable@0.80.0": + version "0.80.0" + resolved "https://registry.yarnpkg.com/@glimmer/destroyable/-/destroyable-0.80.0.tgz#48e6b3d01176b11d1025ccea1429e5d4a3303ee2" + integrity sha512-deyxvtKZZJtlo8bs5iiTtUgDT5K1LTzQM7HtgpOFUOsHU3O9dGtCIPQjIqE92H+BfT7UwOlhC3xcfyDhUALA+w== dependencies: "@glimmer/env" "0.1.7" - "@glimmer/global-context" "0.79.4" - "@glimmer/interfaces" "0.79.4" - "@glimmer/util" "0.79.4" + "@glimmer/global-context" "0.80.0" + "@glimmer/interfaces" "0.80.0" + "@glimmer/util" "0.80.0" -"@glimmer/encoder@0.79.4": - version "0.79.4" - resolved "https://registry.yarnpkg.com/@glimmer/encoder/-/encoder-0.79.4.tgz#2e2e7da3f80f21732f7ed0003c391caf4b42acfe" - integrity sha512-qqyW/TWVK1RP/zEVq0NU2EvOViftVyB43BB7y2yVyb+qD3gK0weP1InwPp1tyNUF7B6LHAcd64d4pN29Qj3vHw== +"@glimmer/encoder@0.80.0": + version "0.80.0" + resolved "https://registry.yarnpkg.com/@glimmer/encoder/-/encoder-0.80.0.tgz#f529f525b44a94939b01e99c562e206bd9833df1" + integrity sha512-nCyF14OIRVixchzo0AML/TkpJV2znbYcFacUwJO67cVIMY/f14614fp63ipAHPcU+1AogIORAPT1wyUXbKcaaQ== dependencies: "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.79.4" - "@glimmer/vm" "0.79.4" + "@glimmer/interfaces" "0.80.0" + "@glimmer/vm" "0.80.0" "@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.79.4": - version "0.79.4" - resolved "https://registry.yarnpkg.com/@glimmer/global-context/-/global-context-0.79.4.tgz#2d683a457aba7c340a3e850fdcf8a35fbcd8308e" - integrity sha512-Hn6KS7QUV63oMbop1LVOfPZ3KISzq4xMASjP+xrMzLIugvjBYYB+WoarUJcG7eB+TioOo0OMyVFibSP8ZTO2TQ== +"@glimmer/global-context@0.80.0": + version "0.80.0" + resolved "https://registry.yarnpkg.com/@glimmer/global-context/-/global-context-0.80.0.tgz#09a0620e6625cc152769d9799dbb2f2d135959e3" + integrity sha512-1myqwTbsLdwP3MbYeLzBqPUMsUCqv+WxaLobHhWTo/dInF8SOyzzL9Dzox/TiqXydZx/w6sGfg9/a0g+MY5cxg== dependencies: "@glimmer/env" "^0.1.7" -"@glimmer/interfaces@0.79.4": - version "0.79.4" - resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.79.4.tgz#3213e7fe73f35340762bef7f4e8c8df593a4a8c8" - integrity sha512-cyNZlRa7aXAfXY9kk7hhnWgL1R7Zw8wwi2UVEWq2nBanmpNmL1lSMJ6nY8oRIWCtWrYA9CeH7RZ6mVP5cQ/v2w== +"@glimmer/interfaces@0.80.0": + version "0.80.0" + resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.80.0.tgz#eabc7551ffe7ad27c44ba96d39e2af6ebf01c942" + integrity sha512-evD9aVhYacFe/lD/FzaPs0CuuIgkr17+KbOCWDeEMXW0q2FnrLiQET40eP5nyhGLELhKE62mlIzdGmleUR6XYg== dependencies: "@simple-dom/interface" "^1.4.0" @@ -1642,140 +1642,140 @@ resolved "https://registry.yarnpkg.com/@glimmer/low-level/-/low-level-0.78.2.tgz#bca5f666760ce98345e87c5b3e37096e772cb2de" integrity sha512-0S6TWOOd0fzLLysw1pWZN0TgasaHmYs1Sjz9Til1mTByIXU1S+1rhdyr2veSQPO/aRjPuEQyKXZQHvx23Zax6w== -"@glimmer/manager@0.79.4": - version "0.79.4" - resolved "https://registry.yarnpkg.com/@glimmer/manager/-/manager-0.79.4.tgz#82cefd85d503c5a3c40389f3c869a8abbf273648" - integrity sha512-SCSrBEdu/JvTEFPvgkDu3kaRgJrJHrhAdB2WAoevNb8bMMhADxRPTVSfYDFL/6+eQtx6krcycVeeaCLjhZ2LNA== +"@glimmer/manager@0.80.0": + version "0.80.0" + resolved "https://registry.yarnpkg.com/@glimmer/manager/-/manager-0.80.0.tgz#07eae00d0846ca1c44307ab0a03a6f6ebbe63065" + integrity sha512-rnRR1PQgqdmuKA/Lz9iVjhSK437Yws43QtfllCoUAPjlzqekJyR0oZiozlih+b3NSHhhU1hZhr2Xoo7lzhsyjQ== dependencies: - "@glimmer/destroyable" "0.79.4" + "@glimmer/destroyable" "0.80.0" "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.79.4" - "@glimmer/reference" "0.79.4" - "@glimmer/util" "0.79.4" - "@glimmer/validator" "0.79.4" - -"@glimmer/node@0.79.4": - version "0.79.4" - resolved "https://registry.yarnpkg.com/@glimmer/node/-/node-0.79.4.tgz#734ed99979fe8c396af3c356c0a5d5eee835d552" - integrity sha512-EDv/PkLGf92aFc7J8qKtBUd6ewxC5udntN6Syj0VHJ2MQeikVJWyZHwJbZP5+VUw8AbjuSKPc0Nt8G37Y2xtug== - dependencies: - "@glimmer/interfaces" "0.79.4" - "@glimmer/runtime" "0.79.4" - "@glimmer/util" "0.79.4" + "@glimmer/interfaces" "0.80.0" + "@glimmer/reference" "0.80.0" + "@glimmer/util" "0.80.0" + "@glimmer/validator" "0.80.0" + +"@glimmer/node@0.80.0": + version "0.80.0" + resolved "https://registry.yarnpkg.com/@glimmer/node/-/node-0.80.0.tgz#afdd6acdd73f70b88a8e78e79f592139912047ce" + integrity sha512-wm3bSiWBljW5UwUII2MKu1GOLkaRha66c8RryiGP97uP0EriMXAUj9kAnhur+/oG15ME+Vp65zwx1nCVeXshYA== + dependencies: + "@glimmer/interfaces" "0.80.0" + "@glimmer/runtime" "0.80.0" + "@glimmer/util" "0.80.0" "@simple-dom/document" "^1.4.0" "@simple-dom/interface" "^1.4.0" -"@glimmer/opcode-compiler@0.79.4": - version "0.79.4" - resolved "https://registry.yarnpkg.com/@glimmer/opcode-compiler/-/opcode-compiler-0.79.4.tgz#c5dffda71216909a8b17d9ff3223a82ef018dde9" - integrity sha512-K/29Wvy5nzo3deLGVZhoziznLsd8+psKhA8SO2zpS7a1a7HCSAL8SvXUZFsdsUZSU0gBmCPmw+sXSkyZTpu5CA== +"@glimmer/opcode-compiler@0.80.0": + version "0.80.0" + resolved "https://registry.yarnpkg.com/@glimmer/opcode-compiler/-/opcode-compiler-0.80.0.tgz#adb6bf7cf374b09d48a2f7365a3d4c80f1944a14" + integrity sha512-lvRZ0QCmbsp72u6EKpo1H3LVhq2oKLEGWj7SuIgexnLoVQvPWMfTvGHnh08XOAIAkp15LlVB240V9RWfz0T8yw== dependencies: - "@glimmer/encoder" "0.79.4" + "@glimmer/encoder" "0.80.0" "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.79.4" - "@glimmer/reference" "0.79.4" - "@glimmer/util" "0.79.4" - "@glimmer/vm" "0.79.4" - "@glimmer/wire-format" "0.79.4" + "@glimmer/interfaces" "0.80.0" + "@glimmer/reference" "0.80.0" + "@glimmer/util" "0.80.0" + "@glimmer/vm" "0.80.0" + "@glimmer/wire-format" "0.80.0" -"@glimmer/owner@0.79.4": - version "0.79.4" - resolved "https://registry.yarnpkg.com/@glimmer/owner/-/owner-0.79.4.tgz#ebb300eaf23986c94705cbff8c4415ed1eaad9e9" - integrity sha512-6w24OglbMeib1xJVxOnTBoiCQbeLtDLDSzisn9z3o6+Iv3NCMzylyjv25JU9TqJydEPftDG/An/h/Aswb8iEFw== +"@glimmer/owner@0.80.0": + version "0.80.0" + resolved "https://registry.yarnpkg.com/@glimmer/owner/-/owner-0.80.0.tgz#ae5da1e4bf8121592afc920a88f3f6dda603606a" + integrity sha512-6VkPqa1fn8Y+9K0nevtMukdVlSaGzrrpYn+QReaXGFjN97YFDQWqQUrmEjcAXeOF/zcyKTpDNrQH0ev0s4JicQ== dependencies: - "@glimmer/util" "0.79.4" + "@glimmer/util" "0.80.0" -"@glimmer/program@0.79.4": - version "0.79.4" - resolved "https://registry.yarnpkg.com/@glimmer/program/-/program-0.79.4.tgz#80cfda3261388caeeb66ccc46fac469d2e788b71" - integrity sha512-8wvhs7xUTdbAtG+oV19PKSFsyFujnRjl4gPs76Pr7GLHX25XOBhGxL8TptPm0JShxuvB2TMZrBwMGc3rhe402g== +"@glimmer/program@0.80.0": + version "0.80.0" + resolved "https://registry.yarnpkg.com/@glimmer/program/-/program-0.80.0.tgz#5bcc2709757c36127568993a61e842351814b67e" + integrity sha512-gp9Lmctp5ECkb7o7fvwN40cusH1Wr/cD7x0IKg3bDFeXuYGc/nUEBlZoU3jMMlGgHjW5b4Mo6LiGkOOK3QWSCA== dependencies: - "@glimmer/encoder" "0.79.4" + "@glimmer/encoder" "0.80.0" "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.79.4" - "@glimmer/manager" "0.79.4" - "@glimmer/opcode-compiler" "0.79.4" - "@glimmer/util" "0.79.4" + "@glimmer/interfaces" "0.80.0" + "@glimmer/manager" "0.80.0" + "@glimmer/opcode-compiler" "0.80.0" + "@glimmer/util" "0.80.0" -"@glimmer/reference@0.79.4": - version "0.79.4" - resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.79.4.tgz#3d9fcf5e57c63583da14f243128a3195f650e568" - integrity sha512-neCaUe9vqc/zGj1kNdm1ssHQ/9icC0BJd8xjYf6vAjiJ/TKEL+u+PfL8H8zqdWAK2al5zekNlhHFY55NxzX8bQ== +"@glimmer/reference@0.80.0": + version "0.80.0" + resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.80.0.tgz#a69d4c43d2d85fc4b840e8a56a77b4480bac5774" + integrity sha512-Yn2RLZEWPctbSLeJRiML7DO5wAOrQCfYy4WV5YuHg4JujE7aMoYLeBFNgbGmWcAmBYZjIjVeF1/Qr2USiT3FKA== dependencies: "@glimmer/env" "^0.1.7" - "@glimmer/global-context" "0.79.4" - "@glimmer/interfaces" "0.79.4" - "@glimmer/util" "0.79.4" - "@glimmer/validator" "0.79.4" + "@glimmer/global-context" "0.80.0" + "@glimmer/interfaces" "0.80.0" + "@glimmer/util" "0.80.0" + "@glimmer/validator" "0.80.0" -"@glimmer/runtime@0.79.4": - version "0.79.4" - resolved "https://registry.yarnpkg.com/@glimmer/runtime/-/runtime-0.79.4.tgz#188044848721f710859c35eecec15293b8c98bba" - integrity sha512-jacyHy7zQ39kR6c4BvPUXpnNDSybnFpFplnhsa0Fr8IqnXRTKqNv1KdfBwdbbPQNaojuV6vyWoh0jPErkcgh0w== +"@glimmer/runtime@0.80.0": + version "0.80.0" + resolved "https://registry.yarnpkg.com/@glimmer/runtime/-/runtime-0.80.0.tgz#ddf344cca65934e283edfcad002729315623c3b7" + integrity sha512-tAlbowztTW18jzOPwOhZiSPAwCL5VVVBHb+dC7cArosLudvDBqVWK7dD7AM3NX7N9Ru3NoCsis9Ql0zYI7tFGA== dependencies: - "@glimmer/destroyable" "0.79.4" + "@glimmer/destroyable" "0.80.0" "@glimmer/env" "0.1.7" - "@glimmer/global-context" "0.79.4" - "@glimmer/interfaces" "0.79.4" + "@glimmer/global-context" "0.80.0" + "@glimmer/interfaces" "0.80.0" "@glimmer/low-level" "0.78.2" - "@glimmer/owner" "0.79.4" - "@glimmer/program" "0.79.4" - "@glimmer/reference" "0.79.4" - "@glimmer/util" "0.79.4" - "@glimmer/validator" "0.79.4" - "@glimmer/vm" "0.79.4" - "@glimmer/wire-format" "0.79.4" + "@glimmer/owner" "0.80.0" + "@glimmer/program" "0.80.0" + "@glimmer/reference" "0.80.0" + "@glimmer/util" "0.80.0" + "@glimmer/validator" "0.80.0" + "@glimmer/vm" "0.80.0" + "@glimmer/wire-format" "0.80.0" "@simple-dom/interface" "^1.4.0" -"@glimmer/syntax@0.79.4": - version "0.79.4" - resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.79.4.tgz#5aa21d4b3918238c24da3d640abc3b66150fc0c6" - integrity sha512-NiMIoW2G0+sBfLYnvDaZ8o8Ul/3P/ezOT8U7ZvsHDGU5hXM2buFozyoSKLILTvAQ56izdfK9fKCsn0oi4ISx3w== +"@glimmer/syntax@0.80.0": + version "0.80.0" + resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.80.0.tgz#5f9c2e5824fdc8f88ec3e71861598c339b6777c1" + integrity sha512-LP8I5MmcguUiHhahyF96dgjKrPE6l1QVl2rlJY23FkzPSVMtUAQxNsxHPZ7vqi+gu7wucNiOfIPNTh9avOr20Q== dependencies: - "@glimmer/interfaces" "0.79.4" - "@glimmer/util" "0.79.4" + "@glimmer/interfaces" "0.80.0" + "@glimmer/util" "0.80.0" "@handlebars/parser" "~2.0.0" simple-html-tokenizer "^0.5.10" -"@glimmer/util@0.79.4": - version "0.79.4" - resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.79.4.tgz#4762ed9b231482470cb9763332097d50042f9bde" - integrity sha512-n2lEGzM9khM43HmKlig2lG5L5cHoL4tFzW21CZzmhMfc1IDCqHuP7s7924OsXSbLT1WB7B9sm/ZhnEj2nd+GiQ== +"@glimmer/util@0.80.0": + version "0.80.0" + resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.80.0.tgz#286ec9e2c8c9e2f364e49272a3baf9d0fe3dc40c" + integrity sha512-fvr4zyGVp58vzVajwTwbGwp0LmPxm2SVWkfIGFcCr9r2BmYD+9bd52I0u00LsZvNJQqFNyI8RB+qXThRMi+TiA== dependencies: "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.79.4" + "@glimmer/interfaces" "0.80.0" "@simple-dom/interface" "^1.4.0" -"@glimmer/validator@0.79.4": - version "0.79.4" - resolved "https://registry.yarnpkg.com/@glimmer/validator/-/validator-0.79.4.tgz#35bc9c6b88d0681b372f1fba3969e6385465b8d7" - integrity sha512-VLT9TozD3n3qwX9hOECn/d2Ig8PTn0Gl1FdiEpb04tldXWY0YL6oSoLEjH97R4KNqvati2jFQOOzyinzu9Ffkw== +"@glimmer/validator@0.80.0": + version "0.80.0" + resolved "https://registry.yarnpkg.com/@glimmer/validator/-/validator-0.80.0.tgz#f93c221a681809e5e45451e21d58ad0a819a38c0" + integrity sha512-qjKKvHaxp7jT978FM1Ifa4aur/W1osPRrMFahQH5LjwMQEdLdk3OSyuxfTY6nTArnK0YJWJZPScrRD0lS2Wy9Q== dependencies: "@glimmer/env" "^0.1.7" - "@glimmer/global-context" "0.79.4" + "@glimmer/global-context" "0.80.0" -"@glimmer/vm-babel-plugins@0.79.4": - version "0.79.4" - resolved "https://registry.yarnpkg.com/@glimmer/vm-babel-plugins/-/vm-babel-plugins-0.79.4.tgz#317b9b85752abab903674b959ed9e00e1942ae23" - integrity sha512-LEdgx6QXOAm+88TxgrvWvkUc6J6jPKmnMzW3IAiD7aIHasSl+/aKfZF0x3ICHyCXGaJGWI00mVKxd2n61aAY9g== +"@glimmer/vm-babel-plugins@0.80.0": + version "0.80.0" + resolved "https://registry.yarnpkg.com/@glimmer/vm-babel-plugins/-/vm-babel-plugins-0.80.0.tgz#e9a6b496501eed367b94c928dc48a954830af3b5" + integrity sha512-ZW6+L+FzjDZngGj87zn3MRRA/MrchC7Con33mCcI36v8u48maheB351uhQe+fBVU300IfyzNMvAdwdVKS5VIFw== dependencies: babel-plugin-debug-macros "^0.3.4" -"@glimmer/vm@0.79.4": - version "0.79.4" - resolved "https://registry.yarnpkg.com/@glimmer/vm/-/vm-0.79.4.tgz#1d0f00909c6b97b99d7c8bb11d1e7b958822dbd3" - integrity sha512-enCXJlypgMTxWUupQWCPUvE41Gh4vsCIWVhqdh6ol+QGzRZBGvfXTz5xu5lTKPJQhFQsTn2ecVTKKVhqMOtzpA== +"@glimmer/vm@0.80.0": + version "0.80.0" + resolved "https://registry.yarnpkg.com/@glimmer/vm/-/vm-0.80.0.tgz#435a8d846e7e6066c018018a71be403520e9b577" + integrity sha512-1oSNmMXS83o/+SO1dW1rdm6hHH5ZbCfZt0mrY4+UHFHnlt8RH24z4YN36kjBVczCX1DhZJOYUrwwE4FKBjKdaQ== dependencies: - "@glimmer/interfaces" "0.79.4" - "@glimmer/util" "0.79.4" + "@glimmer/interfaces" "0.80.0" + "@glimmer/util" "0.80.0" -"@glimmer/wire-format@0.79.4": - version "0.79.4" - resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.79.4.tgz#4074b1194650909e295c349e75d2cebb8a03c8bd" - integrity sha512-QuGfVIX1ziyFDPzJaKZnbgyhzzz5a8s/B+xYg5ZEhMo5BHuyL1a3Gw+0qUMCPlVUIX0Uv+VWvI7NF9tH/ykiZA== +"@glimmer/wire-format@0.80.0": + version "0.80.0" + resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.80.0.tgz#bea3da7973a6a70611bf45cfc15592dbec132091" + integrity sha512-DAUEqUxq0ymuzRStw51DMhTrRZdCBVPZ7K63YFLRud3pojaApWxgeOFlsLua9nRqR6wYSSKS0y2E0n0tPnRndA== dependencies: - "@glimmer/interfaces" "0.79.4" - "@glimmer/util" "0.79.4" + "@glimmer/interfaces" "0.80.0" + "@glimmer/util" "0.80.0" "@handlebars/parser@~2.0.0": version "2.0.0" From 21ecd426774992b69961e175fd4debf900e9a47f Mon Sep 17 00:00:00 2001 From: Henry Majoros Date: Fri, 30 Jul 2021 09:52:19 -0400 Subject: [PATCH 41/61] [BUGFIX LTS] fix memory leak in RouterService (cherry picked from commit 238e01679bd15eafa5c6a9d988f8b68905d76177) --- packages/@ember/-internals/routing/lib/services/router.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/@ember/-internals/routing/lib/services/router.ts b/packages/@ember/-internals/routing/lib/services/router.ts index 1982ea5e32a..c675b9e8087 100644 --- a/packages/@ember/-internals/routing/lib/services/router.ts +++ b/packages/@ember/-internals/routing/lib/services/router.ts @@ -61,6 +61,12 @@ export default class RouterService extends Service { return (this[ROUTER] = router); } + willDestroy() { + super.willDestroy(...arguments); + + this[ROUTER] = null; + } + /** Transition the application into another route. The route may be either a single route or route path: From 8a4e4af73274ce0073b1146fd9d14ed4e1b88a37 Mon Sep 17 00:00:00 2001 From: Matthew Beale Date: Sun, 1 Aug 2021 08:48:30 -0400 Subject: [PATCH 42/61] [BUGFIX release] Deprecate htmlSafe via prototype In Ember 3.24 various string methods added to the `String.prototype` were deprecated for removal in Ember 4.0. `htmlSafe` (the version available via string prototype) was supposed to be included in those deprecations, however dues to its implementation being different it was missed. This omission can be understood as a bug. This patch deprecates `String.prototype.htmlSafe` targeting Ember 4.0. This will allow the removal of *all* string prototype extensions in 4.0 as intended by the original deprecation. See also: https://github.com/emberjs/ember.js/pull/19654#issuecomment-890386906 (cherry picked from commit c6c697876ff3c710617f935c72b6113505c1fd7d) --- .../glimmer/tests/utils/string-test.js | 40 +++++++++++++++++++ packages/ember/index.js | 13 ++++++ 2 files changed, 53 insertions(+) diff --git a/packages/@ember/-internals/glimmer/tests/utils/string-test.js b/packages/@ember/-internals/glimmer/tests/utils/string-test.js index 139c6c3846d..343ea352474 100644 --- a/packages/@ember/-internals/glimmer/tests/utils/string-test.js +++ b/packages/@ember/-internals/glimmer/tests/utils/string-test.js @@ -1,4 +1,5 @@ import { moduleFor, AbstractTestCase } from 'internal-test-helpers'; +import { ENV } from '@ember/-internals/environment'; import { SafeString, htmlSafe, isHTMLSafe } from './helpers'; @@ -11,6 +12,19 @@ moduleFor( this.assert.ok(safeString instanceof SafeString, 'should be a SafeString'); } + ['@test [deprecated] htmlSafe via string prototype should return an instance of SafeString']() { + if (ENV.EXTEND_PROTOTYPES.String) { + let safeString; + expectDeprecation(() => { + safeString = 'you need to be more bold'.htmlSafe(); + }, /String prototype extensions are deprecated/); + + this.assert.ok(safeString instanceof SafeString, 'should be a SafeString'); + } else { + this.assert.expect(0); + } + } + ['@test htmlSafe should return an empty string for null']() { let safeString = htmlSafe(null); @@ -24,6 +38,32 @@ moduleFor( this.assert.equal(safeString instanceof SafeString, true, 'should be a SafeString'); this.assert.equal(safeString.toString(), '', 'should return an empty string'); } + + ['@test [deprecated] htmlSafe via string prototype should return an instance of SafeString for an empty string']() { + if (ENV.EXTEND_PROTOTYPES.String) { + let safeString; + expectDeprecation(() => { + safeString = ''.htmlSafe(); + }, /String prototype extensions are deprecated/); + + this.assert.ok(safeString instanceof SafeString, 'should be a SafeString'); + } else { + this.assert.expect(0); + } + } + + ['@test [deprecated] String.prototype.htmlSafe is not modified without EXTEND_PROTOTYPES']( + assert + ) { + if (!ENV.EXTEND_PROTOTYPES.String) { + assert.ok( + 'undefined' === typeof String.prototype.htmlSafe, + 'String.prototype helper disabled' + ); + } else { + this.assert.expect(0); + } + } } ); diff --git a/packages/ember/index.js b/packages/ember/index.js index b8f3b854bcd..76c0eb46172 100644 --- a/packages/ember/index.js +++ b/packages/ember/index.js @@ -573,6 +573,19 @@ Ember._captureRenderTree = captureRenderTree; if (ENV.EXTEND_PROTOTYPES.String) { String.prototype.htmlSafe = function () { + deprecate( + `String prototype extensions are deprecated. Please import htmlSafe from '@ember/template' instead.`, + false, + { + id: 'ember-string.prototype-extensions', + for: 'ember-source', + since: { + enabled: '3.27.6', + }, + until: '4.0.0', + url: 'https://deprecations.emberjs.com/v3.x/#toc_ember-string-htmlsafe-ishtmlsafe', + } + ); return htmlSafe(this); }; } From cf4ccb6ef8b789046b2e01d4e335ce2b5287bfa6 Mon Sep 17 00:00:00 2001 From: Katie Gengler Date: Mon, 2 Aug 2021 15:25:37 -0400 Subject: [PATCH 43/61] Add HAS_NATIVE_PROXY guard to test for deprecation --- .../glimmer/tests/integration/helpers/hash-test.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/@ember/-internals/glimmer/tests/integration/helpers/hash-test.js b/packages/@ember/-internals/glimmer/tests/integration/helpers/hash-test.js index 3b7955647ce..9eb7d13135f 100644 --- a/packages/@ember/-internals/glimmer/tests/integration/helpers/hash-test.js +++ b/packages/@ember/-internals/glimmer/tests/integration/helpers/hash-test.js @@ -309,10 +309,15 @@ moduleFor( this.assertText('Chad Hietala'); runTask(() => { - expectDeprecation(() => { + if (HAS_NATIVE_PROXY) { + expectDeprecation(() => { + set(fooBarInstance.hash, 'firstName', 'Godfrey'); + set(fooBarInstance.hash, 'lastName', 'Chan'); + }, /You set the '.*' property on a {{hash}} object/); + } else { set(fooBarInstance.hash, 'firstName', 'Godfrey'); set(fooBarInstance.hash, 'lastName', 'Chan'); - }, /You set the '.*' property on a {{hash}} object/); + } }); this.assertText('Godfrey Chan'); From f65283d7985b58e8788c65cc92bc3cf70ecc2226 Mon Sep 17 00:00:00 2001 From: Katie Gengler Date: Mon, 2 Aug 2021 13:48:36 -0400 Subject: [PATCH 44/61] Add 3.28.0-beta.7 to CHANGELOG --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee34bbefad8..16c70013207 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Ember Changelog +### v3.28.0-beta.7 (August 2, 2021) + +- [#19681](https://github.com/emberjs/ember.js/pull/19681) [BUGFIX] Restore previous hash behavior +- [#19685](https://github.com/emberjs/ember.js/pull/19685) [BUGFIX] Fix memory leak in RouterService +- [#19690](https://github.com/emberjs/ember.js/pull/19690) [BUGFIX] Deprecates String.prototype.htmlSafe targeting Ember 4.0, as intended by the original deprecation. + ### v3.28.0-beta.6 (June 21, 2021) - [#19584](https://github.com/emberjs/ember.js/pull/19584) [BUGFIX] Ensure hash objects correctly entangle as dependencies From a4bfee9fa84c1a1d2e8de0f839455e140eede901 Mon Sep 17 00:00:00 2001 From: Katie Gengler Date: Mon, 2 Aug 2021 13:48:58 -0400 Subject: [PATCH 45/61] Release 3.28.0-beta.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 53448834f0d..b186b0eb10a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ember-source", - "version": "3.28.0-beta.6", + "version": "3.28.0-beta.7", "description": "A JavaScript framework for creating ambitious web applications", "keywords": [ "ember-addon" From 8cf4f4ab134f535b4bb2495cd730d3326af6fd02 Mon Sep 17 00:00:00 2001 From: Brenden Palmer Date: Thu, 5 Aug 2021 13:55:51 -0400 Subject: [PATCH 46/61] ensure `deserializeQueryParam` is called for lazy routes (cherry picked from commit b3559e48d1ebdd6c4a86a84671022849f91c0c49) --- .../integration/application/engine-test.js | 59 +++++++++++++++++++ .../-internals/routing/lib/system/route.ts | 18 ++++-- 2 files changed, 73 insertions(+), 4 deletions(-) diff --git a/packages/@ember/-internals/glimmer/tests/integration/application/engine-test.js b/packages/@ember/-internals/glimmer/tests/integration/application/engine-test.js index 49f3499b046..b518a074f98 100644 --- a/packages/@ember/-internals/glimmer/tests/integration/application/engine-test.js +++ b/packages/@ember/-internals/glimmer/tests/integration/application/engine-test.js @@ -974,5 +974,64 @@ moduleFor( assert.equal(error.message, 'Whoops! Something went wrong...'); }); } + + ['@test visit() with `shouldRender: true` queryParams are properly deserialized for lazy routes']( + assert + ) { + assert.expect(2); + + let hooks = []; + + this.setupAppAndRoutableEngine(hooks); + + this.add( + 'engine:blog', + Engine.extend({ + Resolver: ModuleBasedTestResolver, + + init() { + this._super(...arguments); + this.register( + 'controller:application', + Controller.extend({ + queryParams: ['lazyQueryParam'], + }) + ); + + this.register( + 'template:application', + compile('Engine
{{this.lazyQueryParam}}
{{outlet}}') + ); + + this.register( + 'route:application', + Route.extend({ + queryParams: { + lazyQueryParam: { + defaultValue: null, + }, + }, + deserializeQueryParam() { + hooks.push('engine - deserialize query param'); + return 'foo'; + }, + model() { + hooks.push('engine - application'); + }, + }) + ); + }, + }) + ); + + return this.visit('/blog?lazyQueryParam=bar', { shouldRender: true }).then(() => { + assert.deepEqual( + hooks, + ['application - application', 'engine - deserialize query param', 'engine - application'], + 'the expected hooks were fired' + ); + assert.strictEqual(this.element.querySelector('.lazy-query-param').innerHTML, 'foo'); + }); + } } ); diff --git a/packages/@ember/-internals/routing/lib/system/route.ts b/packages/@ember/-internals/routing/lib/system/route.ts index 1b295201c04..69dcd37e48b 100644 --- a/packages/@ember/-internals/routing/lib/system/route.ts +++ b/packages/@ember/-internals/routing/lib/system/route.ts @@ -2026,11 +2026,21 @@ export function getFullQueryParams(router: EmberRouter, state: TransitionState routeInfo.route); - router._deserializeQueryParams(state.routeInfos, state['fullQueryParams'] as QueryParam); - return state['fullQueryParams']; + assign(fullQueryParamsState, state.queryParams); + + router._deserializeQueryParams(state.routeInfos, fullQueryParamsState as QueryParam); + + // only cache query params state if all routeinfos have resolved; it's possible + // for lazy routes to not have resolved when `getFullQueryParams` is called, so + // we wait until all routes have resolved prior to caching query params state + if (haveAllRouteInfosResolved) { + state['fullQueryParams'] = fullQueryParamsState; + } + + return fullQueryParamsState; } function getQueryParamsFor(route: Route, state: TransitionState) { From 502936825afa222218c73efe72b04def6de18f33 Mon Sep 17 00:00:00 2001 From: Katie Gengler Date: Mon, 9 Aug 2021 14:14:56 -0400 Subject: [PATCH 47/61] Add v3.28.0 to CHANGELOG --- CHANGELOG.md | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16c70013207..b2f19131eab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,41 +1,13 @@ # Ember Changelog -### v3.28.0-beta.7 (August 2, 2021) +## v3.28.0 (August 9, 2021) +- [#19697](https://github.com/emberjs/ember.js/pull/19697) [BUGFIX] Ensure `deserializeQueryParam` is called for lazy routes - [#19681](https://github.com/emberjs/ember.js/pull/19681) [BUGFIX] Restore previous hash behavior - [#19685](https://github.com/emberjs/ember.js/pull/19685) [BUGFIX] Fix memory leak in RouterService - [#19690](https://github.com/emberjs/ember.js/pull/19690) [BUGFIX] Deprecates String.prototype.htmlSafe targeting Ember 4.0, as intended by the original deprecation. - -### v3.28.0-beta.6 (June 21, 2021) - - [#19584](https://github.com/emberjs/ember.js/pull/19584) [BUGFIX] Ensure hash objects correctly entangle as dependencies - -### v3.28.0-beta.5 (June 14, 2021) - -- [#19597](https://github.com/emberjs/ember.js/pull/19597) [BUGFIX] Fix `` with nested children - -### v3.28.0-beta.4 (June 7, 2021) - -- [#19586](https://github.com/emberjs/ember.js/pull/19586) [BUGFIX] Fix Embroider compatibility - -### v3.28.0-beta.3 (June 1, 2021) - -- [#19565](https://github.com/emberjs/ember.js/pull/19565) [BUGFIX] Ensures that computed can depend on dynamic hash keys -- [#19571](https://github.com/emberjs/ember.js/pull/19571) [BUGFIX] Delay until: 5.0.0 the removal of the deprecated transition methods of controller and route from [RFC #674](https://github.com/emberjs/rfcs/blob/master/text/0674-deprecate-transition-methods-of-controller-and-route.md). - -### v3.28.0-beta.2 (May 27, 2021) - -- [#19511](https://github.com/emberjs/ember.js/pull/19511) / [#19548](https://github.com/emberjs/ember.js/pull/19548) [BUGFIX] Makes the (hash) helper lazy -- [#19530](https://github.com/emberjs/ember.js/pull/19530) [DOC] fix passing params to named blocks examples -- [#19536](https://github.com/emberjs/ember.js/pull/19536) [BUGFIX] Fix `computed.*` deprecation message to include the correct import path -- [#19544](https://github.com/emberjs/ember.js/pull/19544) [BUGFIX] Use explicit this in helper test blueprints -- [#19555](https://github.com/emberjs/ember.js/pull/19555) [BUGFIX] Improve class based tranform deprecation message -- [#19557](https://github.com/emberjs/ember.js/pull/19557) [BUGFIX] Refine Ember Global deprecation message -- [#19564](https://github.com/emberjs/ember.js/pull/19564) [BUGFIX] Improve computed.* and run.* deprecation message (IE11) - [#19491](https://github.com/emberjs/ember.js/pull/19491) [BUGFIX] Fix `owner.lookup` `owner.register` behavior with `singleton: true` option - -### v3.28.0-beta.1 (May 3, 2021) - - [#19472](https://github.com/emberjs/ember.js/pull/19472) [BUGFIX] Prevent transformation of block params called `attrs` ## v3.27.5 (June 10, 2021) From f243a4f0947a0be1d324b5250c4e2327c6bd7a5f Mon Sep 17 00:00:00 2001 From: Katie Gengler Date: Mon, 9 Aug 2021 20:50:46 -0400 Subject: [PATCH 48/61] Release v3.28.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b186b0eb10a..6acf4ce2020 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ember-source", - "version": "3.28.0-beta.7", + "version": "3.28.0", "description": "A JavaScript framework for creating ambitious web applications", "keywords": [ "ember-addon" From 4e097e6f5abe652dd0cdfc74c4c747b8e00e4d5a Mon Sep 17 00:00:00 2001 From: Chris Krycho Date: Thu, 26 Aug 2021 16:45:30 -0600 Subject: [PATCH 49/61] [BUGFIX release] fix router test regression in urlFor and recognize As part of the improvements made between 3.24 and 3.28, the router microlib is now lazily loaded. When these changes were made, there were a couple cases where it *should* be possible to access router state in a non-application test (integration etc.) but it currently is not because the router is not necessarily set up. Since `setupRouter` is idempotent, call it in those functions so that if it is *not* set up, it gets set up, and otherwise it will continue working as expected. (cherry picked from commit 9f61c7a8520e01856e94893bf2049cc69f788397) --- packages/@ember/-internals/routing/lib/services/router.ts | 3 +++ .../router_service_test/non_application_test_test.js | 7 +++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/@ember/-internals/routing/lib/services/router.ts b/packages/@ember/-internals/routing/lib/services/router.ts index c675b9e8087..68f2de42293 100644 --- a/packages/@ember/-internals/routing/lib/services/router.ts +++ b/packages/@ember/-internals/routing/lib/services/router.ts @@ -240,6 +240,7 @@ export default class RouterService extends Service { @public */ urlFor(routeName: string, ...args: any[]) { + this._router.setupRouter(); return this._router.generate(routeName, ...args); } @@ -375,6 +376,7 @@ export default class RouterService extends Service { `You must pass a url that begins with the application's rootURL "${this.rootURL}"`, url.indexOf(this.rootURL) === 0 ); + this._router.setupRouter(); let internalURL = cleanURL(url, this.rootURL); return this._router._routerMicrolib.recognize(internalURL); } @@ -395,6 +397,7 @@ export default class RouterService extends Service { `You must pass a url that begins with the application's rootURL "${this.rootURL}"`, url.indexOf(this.rootURL) === 0 ); + this._router.setupRouter(); let internalURL = cleanURL(url, this.rootURL); return this._router._routerMicrolib.recognizeAndLoad(internalURL); } diff --git a/packages/ember/tests/routing/router_service_test/non_application_test_test.js b/packages/ember/tests/routing/router_service_test/non_application_test_test.js index add81994bdd..f24f24b8e00 100644 --- a/packages/ember/tests/routing/router_service_test/non_application_test_test.js +++ b/packages/ember/tests/routing/router_service_test/non_application_test_test.js @@ -66,14 +66,15 @@ moduleFor( } ['@test RouterService#urlFor returns url'](assert) { - let router = this.owner.lookup('router:main'); - router.setupRouter(); assert.equal(this.routerService.urlFor('parent.child'), '/child'); } ['@test RouterService#transitionTo with basic route'](assert) { assert.expect(2); + // Callers who want to actually execute a transition in a non-application + // test are doing something weird and therefore should do + // `owner.setupRouter()` explicitly in their tests. let componentInstance; let router = this.owner.lookup('router:main'); router.setupRouter(); @@ -107,8 +108,6 @@ moduleFor( } ['@test RouterService#recognize recognize returns routeInfo'](assert) { - let router = this.owner.lookup('router:main'); - router.setupRouter(); let routeInfo = this.routerService.recognize('/dynamic-with-child/123/1?a=b'); assert.ok(routeInfo); let { name, localName, parent, child, params, queryParams, paramNames } = routeInfo; From c37df4dadf49920cc70a6a1811dd9fb7a955a6e4 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Mon, 30 Aug 2021 16:40:50 -0400 Subject: [PATCH 50/61] Add v3.28.1 to CHANGELOG.md. --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2f19131eab..9fc71c71ee5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Ember Changelog +## v3.28.1 (August 30, 2021) + +- [#19733](https://github.com/emberjs/ember.js/pull/19733) [BUGFIX] Ensure that using `routerService.urlFor(...)` and `routerService.recognize(...)` does not error if the router is not fully initialized + ## v3.28.0 (August 9, 2021) - [#19697](https://github.com/emberjs/ember.js/pull/19697) [BUGFIX] Ensure `deserializeQueryParam` is called for lazy routes From 5f4ccf9e4521e52749fe710be3a92533a8422d0e Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Thu, 21 Oct 2021 19:02:31 -0400 Subject: [PATCH 51/61] Update glimmer-vm to allow locals in loose mode See https://github.com/glimmerjs/glimmer-vm/pull/1351 for context. --- package.json | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 6acf4ce2020..2cc0b1c7e7e 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "@babel/plugin-transform-block-scoping": "^7.8.3", "@babel/plugin-transform-object-assign": "^7.8.3", "@ember/edition-utils": "^1.2.0", - "@glimmer/vm-babel-plugins": "0.80.0", + "@glimmer/vm-babel-plugins": "0.80.1", "babel-plugin-debug-macros": "^0.3.3", "babel-plugin-filter-imports": "^4.0.0", "broccoli-concat": "^4.2.4", @@ -76,19 +76,19 @@ }, "devDependencies": { "@babel/preset-env": "^7.9.5", - "@glimmer/compiler": "0.80.0", - "@glimmer/destroyable": "0.80.0", + "@glimmer/compiler": "0.80.1", + "@glimmer/destroyable": "0.80.1", "@glimmer/env": "^0.1.7", - "@glimmer/global-context": "0.80.0", - "@glimmer/interfaces": "0.80.0", - "@glimmer/manager": "0.80.0", - "@glimmer/node": "0.80.0", - "@glimmer/opcode-compiler": "0.80.0", - "@glimmer/owner": "0.80.0", - "@glimmer/program": "0.80.0", - "@glimmer/reference": "0.80.0", - "@glimmer/runtime": "0.80.0", - "@glimmer/validator": "0.80.0", + "@glimmer/global-context": "0.80.1", + "@glimmer/interfaces": "0.80.1", + "@glimmer/manager": "0.80.1", + "@glimmer/node": "0.80.1", + "@glimmer/opcode-compiler": "0.80.1", + "@glimmer/owner": "0.80.1", + "@glimmer/program": "0.80.1", + "@glimmer/reference": "0.80.1", + "@glimmer/runtime": "0.80.1", + "@glimmer/validator": "0.80.1", "@simple-dom/document": "^1.4.0", "@types/qunit": "^2.11.1", "@types/rsvp": "^4.0.3", From 4c0e61b4a5d35084f43bb93ac7306f2183c02a1e Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Thu, 21 Oct 2021 19:04:39 -0400 Subject: [PATCH 52/61] Add v3.28.2 to CHANGELOG.md. --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fc71c71ee5..0694d4485f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Ember Changelog +## v3.28.2 (October 21, 2021) + +- [glimmerjs/glimmer-vm#1351](https://github.com/glimmerjs/glimmer-vm/pull/1351) Support lexical scope in loose mode + ## v3.28.1 (August 30, 2021) - [#19733](https://github.com/emberjs/ember.js/pull/19733) [BUGFIX] Ensure that using `routerService.urlFor(...)` and `routerService.recognize(...)` does not error if the router is not fully initialized From 5fc912b2a4cc574ff821ec3d63df1385d819c827 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Thu, 21 Oct 2021 19:04:53 -0400 Subject: [PATCH 53/61] 3.28.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2cc0b1c7e7e..a18404e6deb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ember-source", - "version": "3.28.0", + "version": "3.28.2", "description": "A JavaScript framework for creating ambitious web applications", "keywords": [ "ember-addon" From eb40ee3ee0869f3b3fcd251dee8a192c51ab81bd Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Fri, 22 Oct 2021 08:25:44 -0400 Subject: [PATCH 54/61] Update glimmer-vm to 0.80.2 (fix some inline precompile issues) (cherry picked from commit 6707ad35e1a9336309c6654f138e9b606ff5d0f6) --- package.json | 28 +++--- yarn.lock | 252 +++++++++++++++++++++++++-------------------------- 2 files changed, 140 insertions(+), 140 deletions(-) diff --git a/package.json b/package.json index a18404e6deb..c1f72e5f182 100644 --- a/package.json +++ b/package.json @@ -51,8 +51,8 @@ "@babel/plugin-transform-block-scoping": "^7.8.3", "@babel/plugin-transform-object-assign": "^7.8.3", "@ember/edition-utils": "^1.2.0", - "@glimmer/vm-babel-plugins": "0.80.1", - "babel-plugin-debug-macros": "^0.3.3", + "@glimmer/vm-babel-plugins": "0.80.2", + "babel-plugin-debug-macros": "^0.3.4", "babel-plugin-filter-imports": "^4.0.0", "broccoli-concat": "^4.2.4", "broccoli-debug": "^0.6.4", @@ -76,19 +76,19 @@ }, "devDependencies": { "@babel/preset-env": "^7.9.5", - "@glimmer/compiler": "0.80.1", - "@glimmer/destroyable": "0.80.1", + "@glimmer/compiler": "0.80.2", + "@glimmer/destroyable": "0.80.2", "@glimmer/env": "^0.1.7", - "@glimmer/global-context": "0.80.1", - "@glimmer/interfaces": "0.80.1", - "@glimmer/manager": "0.80.1", - "@glimmer/node": "0.80.1", - "@glimmer/opcode-compiler": "0.80.1", - "@glimmer/owner": "0.80.1", - "@glimmer/program": "0.80.1", - "@glimmer/reference": "0.80.1", - "@glimmer/runtime": "0.80.1", - "@glimmer/validator": "0.80.1", + "@glimmer/global-context": "0.80.2", + "@glimmer/interfaces": "0.80.2", + "@glimmer/manager": "0.80.2", + "@glimmer/node": "0.80.2", + "@glimmer/opcode-compiler": "0.80.2", + "@glimmer/owner": "0.80.2", + "@glimmer/program": "0.80.2", + "@glimmer/reference": "0.80.2", + "@glimmer/runtime": "0.80.2", + "@glimmer/validator": "0.80.2", "@simple-dom/document": "^1.4.0", "@types/qunit": "^2.11.1", "@types/rsvp": "^4.0.3", diff --git a/yarn.lock b/yarn.lock index 2f53c60ca77..a0b519e65c7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1588,52 +1588,52 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" -"@glimmer/compiler@0.80.0": - version "0.80.0" - resolved "https://registry.yarnpkg.com/@glimmer/compiler/-/compiler-0.80.0.tgz#f825b2d5b55500c0a695f076c7a2fdd312a1e94e" - integrity sha512-oz72cvjNHXpKY1i9aJBiLQSkmqW1zbCGc1J/gIGTXeMC5tdJlDXve22eS2ZkNWI41ai3ClzpA0hIz5ju7qO8zw== - dependencies: - "@glimmer/interfaces" "0.80.0" - "@glimmer/syntax" "0.80.0" - "@glimmer/util" "0.80.0" - "@glimmer/wire-format" "0.80.0" +"@glimmer/compiler@0.80.2": + version "0.80.2" + resolved "https://registry.yarnpkg.com/@glimmer/compiler/-/compiler-0.80.2.tgz#730001221f7240709f5952f30427f2352aa8b05d" + integrity sha512-oWl0A3lvGjlArlYAosUQStCAgboCOaf7GZCJ/A3cGCuy1BlP/pFCBFkgG60SODJwr+zeJLRAh0adroaisH66SA== + dependencies: + "@glimmer/interfaces" "0.80.2" + "@glimmer/syntax" "0.80.2" + "@glimmer/util" "0.80.2" + "@glimmer/wire-format" "0.80.2" "@simple-dom/interface" "^1.4.0" -"@glimmer/destroyable@0.80.0": - version "0.80.0" - resolved "https://registry.yarnpkg.com/@glimmer/destroyable/-/destroyable-0.80.0.tgz#48e6b3d01176b11d1025ccea1429e5d4a3303ee2" - integrity sha512-deyxvtKZZJtlo8bs5iiTtUgDT5K1LTzQM7HtgpOFUOsHU3O9dGtCIPQjIqE92H+BfT7UwOlhC3xcfyDhUALA+w== +"@glimmer/destroyable@0.80.2": + version "0.80.2" + resolved "https://registry.yarnpkg.com/@glimmer/destroyable/-/destroyable-0.80.2.tgz#da199504eb91cf2513f2c3ac6d0d899d83b74878" + integrity sha512-RdquK8byB/uvwEIzUxXL3dX0wnPW6yLooBmrR/QKOyiP0f23DdLLdT2tc7etITkF0NOFjtRApFr3Kwxm2vsHfA== dependencies: "@glimmer/env" "0.1.7" - "@glimmer/global-context" "0.80.0" - "@glimmer/interfaces" "0.80.0" - "@glimmer/util" "0.80.0" + "@glimmer/global-context" "0.80.2" + "@glimmer/interfaces" "0.80.2" + "@glimmer/util" "0.80.2" -"@glimmer/encoder@0.80.0": - version "0.80.0" - resolved "https://registry.yarnpkg.com/@glimmer/encoder/-/encoder-0.80.0.tgz#f529f525b44a94939b01e99c562e206bd9833df1" - integrity sha512-nCyF14OIRVixchzo0AML/TkpJV2znbYcFacUwJO67cVIMY/f14614fp63ipAHPcU+1AogIORAPT1wyUXbKcaaQ== +"@glimmer/encoder@0.80.2": + version "0.80.2" + resolved "https://registry.yarnpkg.com/@glimmer/encoder/-/encoder-0.80.2.tgz#30dd5aed6b56362388a2e3ed1069a318c76132ca" + integrity sha512-16D7VVy2Riqc2+q/374auzcJ/KpIIxEactAkPlPUgexwzUEuJSPcg1hcEh0medwPQlNn1YkL+5YFPh9zFUgoWQ== dependencies: "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.80.0" - "@glimmer/vm" "0.80.0" + "@glimmer/interfaces" "0.80.2" + "@glimmer/vm" "0.80.2" "@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.80.0": - version "0.80.0" - resolved "https://registry.yarnpkg.com/@glimmer/global-context/-/global-context-0.80.0.tgz#09a0620e6625cc152769d9799dbb2f2d135959e3" - integrity sha512-1myqwTbsLdwP3MbYeLzBqPUMsUCqv+WxaLobHhWTo/dInF8SOyzzL9Dzox/TiqXydZx/w6sGfg9/a0g+MY5cxg== +"@glimmer/global-context@0.80.2": + version "0.80.2" + resolved "https://registry.yarnpkg.com/@glimmer/global-context/-/global-context-0.80.2.tgz#aaa389f1055a056d0f911a7e9d101cbcc06f133b" + integrity sha512-XskcLaDUoXJYa/RLhkFNZSywzLoeMDQk6UTxvWrCtfE8hKXfeKSKq1FKyYenzB3SMF2ESX5yHOSd/xKBIYVypg== dependencies: "@glimmer/env" "^0.1.7" -"@glimmer/interfaces@0.80.0": - version "0.80.0" - resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.80.0.tgz#eabc7551ffe7ad27c44ba96d39e2af6ebf01c942" - integrity sha512-evD9aVhYacFe/lD/FzaPs0CuuIgkr17+KbOCWDeEMXW0q2FnrLiQET40eP5nyhGLELhKE62mlIzdGmleUR6XYg== +"@glimmer/interfaces@0.80.2": + version "0.80.2" + resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.80.2.tgz#3937610ada436102ff9f92a6ea89e6d4531c1432" + integrity sha512-s5xhjoRNwp2fJty8/LpOY2qRLRlevYZFxEDD+Jl44YTRdU68DZJdSYd0cBknp1qDSi+C74zIg7S5cGwS3ulkUw== dependencies: "@simple-dom/interface" "^1.4.0" @@ -1642,140 +1642,140 @@ resolved "https://registry.yarnpkg.com/@glimmer/low-level/-/low-level-0.78.2.tgz#bca5f666760ce98345e87c5b3e37096e772cb2de" integrity sha512-0S6TWOOd0fzLLysw1pWZN0TgasaHmYs1Sjz9Til1mTByIXU1S+1rhdyr2veSQPO/aRjPuEQyKXZQHvx23Zax6w== -"@glimmer/manager@0.80.0": - version "0.80.0" - resolved "https://registry.yarnpkg.com/@glimmer/manager/-/manager-0.80.0.tgz#07eae00d0846ca1c44307ab0a03a6f6ebbe63065" - integrity sha512-rnRR1PQgqdmuKA/Lz9iVjhSK437Yws43QtfllCoUAPjlzqekJyR0oZiozlih+b3NSHhhU1hZhr2Xoo7lzhsyjQ== +"@glimmer/manager@0.80.2": + version "0.80.2" + resolved "https://registry.yarnpkg.com/@glimmer/manager/-/manager-0.80.2.tgz#739d9766a21d62965bb322f5c57a7e984af35a1f" + integrity sha512-9Fz+R67cqXeDkFBBfag3HNE4bla0Y2BCmzo/VSPzt6dI/2qzWl+MTDyiu85RffAnMZgXuqMUElizcsuq3hWERg== dependencies: - "@glimmer/destroyable" "0.80.0" + "@glimmer/destroyable" "0.80.2" "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.80.0" - "@glimmer/reference" "0.80.0" - "@glimmer/util" "0.80.0" - "@glimmer/validator" "0.80.0" - -"@glimmer/node@0.80.0": - version "0.80.0" - resolved "https://registry.yarnpkg.com/@glimmer/node/-/node-0.80.0.tgz#afdd6acdd73f70b88a8e78e79f592139912047ce" - integrity sha512-wm3bSiWBljW5UwUII2MKu1GOLkaRha66c8RryiGP97uP0EriMXAUj9kAnhur+/oG15ME+Vp65zwx1nCVeXshYA== - dependencies: - "@glimmer/interfaces" "0.80.0" - "@glimmer/runtime" "0.80.0" - "@glimmer/util" "0.80.0" + "@glimmer/interfaces" "0.80.2" + "@glimmer/reference" "0.80.2" + "@glimmer/util" "0.80.2" + "@glimmer/validator" "0.80.2" + +"@glimmer/node@0.80.2": + version "0.80.2" + resolved "https://registry.yarnpkg.com/@glimmer/node/-/node-0.80.2.tgz#651055876ca4c95fc5159f7918da1ea715e222e6" + integrity sha512-Urtey5+Jla2sjJSeYnjIYii9pei7bLr/8dPxbVkmJEh8oK3YIcz7YNymFjXxce2Vxdnj1A1KussGzBcK0FP3pA== + dependencies: + "@glimmer/interfaces" "0.80.2" + "@glimmer/runtime" "0.80.2" + "@glimmer/util" "0.80.2" "@simple-dom/document" "^1.4.0" "@simple-dom/interface" "^1.4.0" -"@glimmer/opcode-compiler@0.80.0": - version "0.80.0" - resolved "https://registry.yarnpkg.com/@glimmer/opcode-compiler/-/opcode-compiler-0.80.0.tgz#adb6bf7cf374b09d48a2f7365a3d4c80f1944a14" - integrity sha512-lvRZ0QCmbsp72u6EKpo1H3LVhq2oKLEGWj7SuIgexnLoVQvPWMfTvGHnh08XOAIAkp15LlVB240V9RWfz0T8yw== +"@glimmer/opcode-compiler@0.80.2": + version "0.80.2" + resolved "https://registry.yarnpkg.com/@glimmer/opcode-compiler/-/opcode-compiler-0.80.2.tgz#be6fe3d0c7e82e1d903a9b594b017236c035018b" + integrity sha512-STGh/F8NaYxDVG6rPM97t/A9fnOpU+uK0BQEhRLsx/iGvq8PyE966p4LKyRAbmbuFTLhbZE7E/68Y0k0eWQc6Q== dependencies: - "@glimmer/encoder" "0.80.0" + "@glimmer/encoder" "0.80.2" "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.80.0" - "@glimmer/reference" "0.80.0" - "@glimmer/util" "0.80.0" - "@glimmer/vm" "0.80.0" - "@glimmer/wire-format" "0.80.0" + "@glimmer/interfaces" "0.80.2" + "@glimmer/reference" "0.80.2" + "@glimmer/util" "0.80.2" + "@glimmer/vm" "0.80.2" + "@glimmer/wire-format" "0.80.2" -"@glimmer/owner@0.80.0": - version "0.80.0" - resolved "https://registry.yarnpkg.com/@glimmer/owner/-/owner-0.80.0.tgz#ae5da1e4bf8121592afc920a88f3f6dda603606a" - integrity sha512-6VkPqa1fn8Y+9K0nevtMukdVlSaGzrrpYn+QReaXGFjN97YFDQWqQUrmEjcAXeOF/zcyKTpDNrQH0ev0s4JicQ== +"@glimmer/owner@0.80.2": + version "0.80.2" + resolved "https://registry.yarnpkg.com/@glimmer/owner/-/owner-0.80.2.tgz#34cf1b70ab3f061d8675c941cecaf3fcc319af3b" + integrity sha512-jEwaRA0oEEPaJDHs/5MlWm3fEmhN8qp3NJlLYs5Duviks+tEhtmB1zr3Jg+7TAMrJloRo9iadt4TrZzezgRAIQ== dependencies: - "@glimmer/util" "0.80.0" + "@glimmer/util" "0.80.2" -"@glimmer/program@0.80.0": - version "0.80.0" - resolved "https://registry.yarnpkg.com/@glimmer/program/-/program-0.80.0.tgz#5bcc2709757c36127568993a61e842351814b67e" - integrity sha512-gp9Lmctp5ECkb7o7fvwN40cusH1Wr/cD7x0IKg3bDFeXuYGc/nUEBlZoU3jMMlGgHjW5b4Mo6LiGkOOK3QWSCA== +"@glimmer/program@0.80.2": + version "0.80.2" + resolved "https://registry.yarnpkg.com/@glimmer/program/-/program-0.80.2.tgz#dc1a582c564f735f4021d3eb6c54047c237c264f" + integrity sha512-MpPJgeCc/yj9uawG4kqBxzVOuJNky3WB9g3Cm21k0Z+YACdguC2UjXUoA9PvjfrLEj+7eajE0wQ+QTbztOwVtQ== dependencies: - "@glimmer/encoder" "0.80.0" + "@glimmer/encoder" "0.80.2" "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.80.0" - "@glimmer/manager" "0.80.0" - "@glimmer/opcode-compiler" "0.80.0" - "@glimmer/util" "0.80.0" + "@glimmer/interfaces" "0.80.2" + "@glimmer/manager" "0.80.2" + "@glimmer/opcode-compiler" "0.80.2" + "@glimmer/util" "0.80.2" -"@glimmer/reference@0.80.0": - version "0.80.0" - resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.80.0.tgz#a69d4c43d2d85fc4b840e8a56a77b4480bac5774" - integrity sha512-Yn2RLZEWPctbSLeJRiML7DO5wAOrQCfYy4WV5YuHg4JujE7aMoYLeBFNgbGmWcAmBYZjIjVeF1/Qr2USiT3FKA== +"@glimmer/reference@0.80.2": + version "0.80.2" + resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.80.2.tgz#db14f64592bd7f505d47527eacc298a1ba7f8ea5" + integrity sha512-uXRc912/kAoXgNu2MIWcqARyMUq+h+N82LiNXg0mYo/SYaxT1ag3uVw6nM82ou9ii0lLWKY1fP/4knuSwu0rbA== dependencies: "@glimmer/env" "^0.1.7" - "@glimmer/global-context" "0.80.0" - "@glimmer/interfaces" "0.80.0" - "@glimmer/util" "0.80.0" - "@glimmer/validator" "0.80.0" + "@glimmer/global-context" "0.80.2" + "@glimmer/interfaces" "0.80.2" + "@glimmer/util" "0.80.2" + "@glimmer/validator" "0.80.2" -"@glimmer/runtime@0.80.0": - version "0.80.0" - resolved "https://registry.yarnpkg.com/@glimmer/runtime/-/runtime-0.80.0.tgz#ddf344cca65934e283edfcad002729315623c3b7" - integrity sha512-tAlbowztTW18jzOPwOhZiSPAwCL5VVVBHb+dC7cArosLudvDBqVWK7dD7AM3NX7N9Ru3NoCsis9Ql0zYI7tFGA== +"@glimmer/runtime@0.80.2": + version "0.80.2" + resolved "https://registry.yarnpkg.com/@glimmer/runtime/-/runtime-0.80.2.tgz#14895a6d2a0c7214163a21579a7980f8784dfd6c" + integrity sha512-7g12Eyo/fQpKICXXW/+cQCA/mYr4ugOrM7YiZSYtAdm1gIQqQFbxnod2iLgFgISDqRHf8cKTsuZw7+yeIwQNIA== dependencies: - "@glimmer/destroyable" "0.80.0" + "@glimmer/destroyable" "0.80.2" "@glimmer/env" "0.1.7" - "@glimmer/global-context" "0.80.0" - "@glimmer/interfaces" "0.80.0" + "@glimmer/global-context" "0.80.2" + "@glimmer/interfaces" "0.80.2" "@glimmer/low-level" "0.78.2" - "@glimmer/owner" "0.80.0" - "@glimmer/program" "0.80.0" - "@glimmer/reference" "0.80.0" - "@glimmer/util" "0.80.0" - "@glimmer/validator" "0.80.0" - "@glimmer/vm" "0.80.0" - "@glimmer/wire-format" "0.80.0" + "@glimmer/owner" "0.80.2" + "@glimmer/program" "0.80.2" + "@glimmer/reference" "0.80.2" + "@glimmer/util" "0.80.2" + "@glimmer/validator" "0.80.2" + "@glimmer/vm" "0.80.2" + "@glimmer/wire-format" "0.80.2" "@simple-dom/interface" "^1.4.0" -"@glimmer/syntax@0.80.0": - version "0.80.0" - resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.80.0.tgz#5f9c2e5824fdc8f88ec3e71861598c339b6777c1" - integrity sha512-LP8I5MmcguUiHhahyF96dgjKrPE6l1QVl2rlJY23FkzPSVMtUAQxNsxHPZ7vqi+gu7wucNiOfIPNTh9avOr20Q== +"@glimmer/syntax@0.80.2": + version "0.80.2" + resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.80.2.tgz#2123a0c28c9a9d39b42392aaa3df8b7f3706645b" + integrity sha512-30H1RtmjCW5miO4codNPWgyO0UOeBaDuc7ohSuG0E85djh444ImfJwlLE/cW6C4pLb38OeG8vEPODnppWV3XUg== dependencies: - "@glimmer/interfaces" "0.80.0" - "@glimmer/util" "0.80.0" + "@glimmer/interfaces" "0.80.2" + "@glimmer/util" "0.80.2" "@handlebars/parser" "~2.0.0" simple-html-tokenizer "^0.5.10" -"@glimmer/util@0.80.0": - version "0.80.0" - resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.80.0.tgz#286ec9e2c8c9e2f364e49272a3baf9d0fe3dc40c" - integrity sha512-fvr4zyGVp58vzVajwTwbGwp0LmPxm2SVWkfIGFcCr9r2BmYD+9bd52I0u00LsZvNJQqFNyI8RB+qXThRMi+TiA== +"@glimmer/util@0.80.2": + version "0.80.2" + resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.80.2.tgz#a1dbb11575255a478c0ba161d521cdbad8c3410d" + integrity sha512-GniMILqLJ+dWiwmO/UOBPCqwMYEPYoFW3e/mInUbKn0YBenf/M6hJhnPI7Z11NpObknq3s5nNLkDcmR3gdFmHA== dependencies: "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.80.0" + "@glimmer/interfaces" "0.80.2" "@simple-dom/interface" "^1.4.0" -"@glimmer/validator@0.80.0": - version "0.80.0" - resolved "https://registry.yarnpkg.com/@glimmer/validator/-/validator-0.80.0.tgz#f93c221a681809e5e45451e21d58ad0a819a38c0" - integrity sha512-qjKKvHaxp7jT978FM1Ifa4aur/W1osPRrMFahQH5LjwMQEdLdk3OSyuxfTY6nTArnK0YJWJZPScrRD0lS2Wy9Q== +"@glimmer/validator@0.80.2": + version "0.80.2" + resolved "https://registry.yarnpkg.com/@glimmer/validator/-/validator-0.80.2.tgz#4ac1faf608913c88d0dab54a37068bbdf6edc62a" + integrity sha512-m5K0IxStWHM5vJbJDDXhnr2LGAnC469RclA6jazbtl3fVHEg5njzsQYUIfRTxFpgPK3QEyRJrR6r3PG9RCMnDw== dependencies: "@glimmer/env" "^0.1.7" - "@glimmer/global-context" "0.80.0" + "@glimmer/global-context" "0.80.2" -"@glimmer/vm-babel-plugins@0.80.0": - version "0.80.0" - resolved "https://registry.yarnpkg.com/@glimmer/vm-babel-plugins/-/vm-babel-plugins-0.80.0.tgz#e9a6b496501eed367b94c928dc48a954830af3b5" - integrity sha512-ZW6+L+FzjDZngGj87zn3MRRA/MrchC7Con33mCcI36v8u48maheB351uhQe+fBVU300IfyzNMvAdwdVKS5VIFw== +"@glimmer/vm-babel-plugins@0.80.2": + version "0.80.2" + resolved "https://registry.yarnpkg.com/@glimmer/vm-babel-plugins/-/vm-babel-plugins-0.80.2.tgz#6e3b6b0ec06994084b44fca1f19c20fd945df454" + integrity sha512-ufdz76tVz3TivS8Bb92n/v6yXNX8zgREDwR3ju45ZO48yWexySllUBFOvwCAmPIoHSQGq8LyIwJGESIJLacr6A== dependencies: babel-plugin-debug-macros "^0.3.4" -"@glimmer/vm@0.80.0": - version "0.80.0" - resolved "https://registry.yarnpkg.com/@glimmer/vm/-/vm-0.80.0.tgz#435a8d846e7e6066c018018a71be403520e9b577" - integrity sha512-1oSNmMXS83o/+SO1dW1rdm6hHH5ZbCfZt0mrY4+UHFHnlt8RH24z4YN36kjBVczCX1DhZJOYUrwwE4FKBjKdaQ== +"@glimmer/vm@0.80.2": + version "0.80.2" + resolved "https://registry.yarnpkg.com/@glimmer/vm/-/vm-0.80.2.tgz#33f875b0b8e2cc5a6c3d5c1548dbbc333631f6ac" + integrity sha512-5dk76zuc2wRR6L2FVHJIX0MQ3AuawXoO2JW/i5nP8wu3r3jXXrvUbtwtR2DCq6lasmyjk5pygtf+DSaawrezqg== dependencies: - "@glimmer/interfaces" "0.80.0" - "@glimmer/util" "0.80.0" + "@glimmer/interfaces" "0.80.2" + "@glimmer/util" "0.80.2" -"@glimmer/wire-format@0.80.0": - version "0.80.0" - resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.80.0.tgz#bea3da7973a6a70611bf45cfc15592dbec132091" - integrity sha512-DAUEqUxq0ymuzRStw51DMhTrRZdCBVPZ7K63YFLRud3pojaApWxgeOFlsLua9nRqR6wYSSKS0y2E0n0tPnRndA== +"@glimmer/wire-format@0.80.2": + version "0.80.2" + resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.80.2.tgz#ae7c7bd2e2a56aca6110b6d7048dae6ac99d340e" + integrity sha512-UE7P2AJNs9snKr8LRd4LDZYRmOybYJodUl4vfdntmBeYHiGNWWKpft1tgg5IDdBgmYPvoOEaRQUoIkdMhMT6aA== dependencies: - "@glimmer/interfaces" "0.80.0" - "@glimmer/util" "0.80.0" + "@glimmer/interfaces" "0.80.2" + "@glimmer/util" "0.80.2" "@handlebars/parser@~2.0.0": version "2.0.0" From 845e8278c33a336fdae731bc9893631aa1f5517b Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Fri, 22 Oct 2021 08:51:40 -0400 Subject: [PATCH 55/61] Add v3.28.3 to CHANGELOG.md. --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0694d4485f7..d2d27a6bede 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Ember Changelog +## v3.28.3 (October 22, 2021) + +- [#19799](https://github.com/emberjs/ember.js/pull/19799) / [glimmerjs/glimmer-vm#1354](https://github.com/glimmerjs/glimmer-vm/pull/1354) Fixes for errors while precompiling inline templates (introduced in 3.28.2) + ## v3.28.2 (October 21, 2021) - [glimmerjs/glimmer-vm#1351](https://github.com/glimmerjs/glimmer-vm/pull/1351) Support lexical scope in loose mode From 69324901be6faa8ff1a63ed75685778a0a7eb249 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Fri, 22 Oct 2021 08:51:51 -0400 Subject: [PATCH 56/61] 3.28.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c1f72e5f182..32ff2bfdf80 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ember-source", - "version": "3.28.2", + "version": "3.28.3", "description": "A JavaScript framework for creating ambitious web applications", "keywords": [ "ember-addon" From 1402cb4fd84acc3e848fc849005d789f8849a4e6 Mon Sep 17 00:00:00 2001 From: Edward Faulkner Date: Fri, 22 Oct 2021 00:31:02 -0400 Subject: [PATCH 57/61] Don't pass falsy `locals` to glimmer precompile Fixes #19797. (cherry picked from commit d9a83a4ba5f11347fb443ed7f08a3b4cfdb5ffe4) --- .../lib/system/compile-options.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/ember-template-compiler/lib/system/compile-options.ts b/packages/ember-template-compiler/lib/system/compile-options.ts index 87832571e09..4dd7fbba8d8 100644 --- a/packages/ember-template-compiler/lib/system/compile-options.ts +++ b/packages/ember-template-compiler/lib/system/compile-options.ts @@ -37,6 +37,15 @@ export function buildCompileOptions(_options: EmberPrecompileOptions): EmberPrec options.locals = undefined; } + if ('locals' in options && !options.locals) { + // Glimmer's precompile options declare `locals` like: + // locals?: string[] + // but many in-use versions of babel-plugin-htmlbars-inline-precompile will + // set locals to `null`. This used to work but only because glimmer was + // ignoring locals for non-strict templates, and now it supports that case. + delete options.locals; + } + // move `moduleName` into `meta` property if (options.moduleName) { let meta = options.meta; From f41c84924d7c7df04b6b1dc8bf7e9316a8891ff7 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Fri, 22 Oct 2021 12:37:46 -0400 Subject: [PATCH 58/61] Update glimmer-vm to 0.80.3 See https://github.com/glimmerjs/glimmer-vm/releases/tag/v0.80.3 --- package.json | 26 +++--- yarn.lock | 252 +++++++++++++++++++++++++-------------------------- 2 files changed, 139 insertions(+), 139 deletions(-) diff --git a/package.json b/package.json index 32ff2bfdf80..4f9dc0821c5 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "@babel/plugin-transform-block-scoping": "^7.8.3", "@babel/plugin-transform-object-assign": "^7.8.3", "@ember/edition-utils": "^1.2.0", - "@glimmer/vm-babel-plugins": "0.80.2", + "@glimmer/vm-babel-plugins": "0.80.3", "babel-plugin-debug-macros": "^0.3.4", "babel-plugin-filter-imports": "^4.0.0", "broccoli-concat": "^4.2.4", @@ -76,19 +76,19 @@ }, "devDependencies": { "@babel/preset-env": "^7.9.5", - "@glimmer/compiler": "0.80.2", - "@glimmer/destroyable": "0.80.2", + "@glimmer/compiler": "0.80.3", + "@glimmer/destroyable": "0.80.3", "@glimmer/env": "^0.1.7", - "@glimmer/global-context": "0.80.2", - "@glimmer/interfaces": "0.80.2", - "@glimmer/manager": "0.80.2", - "@glimmer/node": "0.80.2", - "@glimmer/opcode-compiler": "0.80.2", - "@glimmer/owner": "0.80.2", - "@glimmer/program": "0.80.2", - "@glimmer/reference": "0.80.2", - "@glimmer/runtime": "0.80.2", - "@glimmer/validator": "0.80.2", + "@glimmer/global-context": "0.80.3", + "@glimmer/interfaces": "0.80.3", + "@glimmer/manager": "0.80.3", + "@glimmer/node": "0.80.3", + "@glimmer/opcode-compiler": "0.80.3", + "@glimmer/owner": "0.80.3", + "@glimmer/program": "0.80.3", + "@glimmer/reference": "0.80.3", + "@glimmer/runtime": "0.80.3", + "@glimmer/validator": "0.80.3", "@simple-dom/document": "^1.4.0", "@types/qunit": "^2.11.1", "@types/rsvp": "^4.0.3", diff --git a/yarn.lock b/yarn.lock index a0b519e65c7..64e49a632a7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1588,52 +1588,52 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" -"@glimmer/compiler@0.80.2": - version "0.80.2" - resolved "https://registry.yarnpkg.com/@glimmer/compiler/-/compiler-0.80.2.tgz#730001221f7240709f5952f30427f2352aa8b05d" - integrity sha512-oWl0A3lvGjlArlYAosUQStCAgboCOaf7GZCJ/A3cGCuy1BlP/pFCBFkgG60SODJwr+zeJLRAh0adroaisH66SA== - dependencies: - "@glimmer/interfaces" "0.80.2" - "@glimmer/syntax" "0.80.2" - "@glimmer/util" "0.80.2" - "@glimmer/wire-format" "0.80.2" +"@glimmer/compiler@0.80.3": + version "0.80.3" + resolved "https://registry.yarnpkg.com/@glimmer/compiler/-/compiler-0.80.3.tgz#a347192ede2e25e01f72079bfc4310a20bab1e87" + integrity sha512-eMsp5iOHZAWKJNmWFwfGxJ3Cs0gySELDRTqW/fm0RC0MLXoViaPYSQJ/yb2/VozkHeDijoQkPWPCY6TW8zRCjg== + dependencies: + "@glimmer/interfaces" "0.80.3" + "@glimmer/syntax" "0.80.3" + "@glimmer/util" "0.80.3" + "@glimmer/wire-format" "0.80.3" "@simple-dom/interface" "^1.4.0" -"@glimmer/destroyable@0.80.2": - version "0.80.2" - resolved "https://registry.yarnpkg.com/@glimmer/destroyable/-/destroyable-0.80.2.tgz#da199504eb91cf2513f2c3ac6d0d899d83b74878" - integrity sha512-RdquK8byB/uvwEIzUxXL3dX0wnPW6yLooBmrR/QKOyiP0f23DdLLdT2tc7etITkF0NOFjtRApFr3Kwxm2vsHfA== +"@glimmer/destroyable@0.80.3": + version "0.80.3" + resolved "https://registry.yarnpkg.com/@glimmer/destroyable/-/destroyable-0.80.3.tgz#bdbce5253429c4ee46116582e2bfde2fd9fd1638" + integrity sha512-fi0lO1QzWdkq/Izgef9l57dvFX+HS0ecd1N6Y6aWV/YKz8wjSgq/PNVBJMeFF+eV+HGIOzWnwu1oaIFfk9qKUw== dependencies: "@glimmer/env" "0.1.7" - "@glimmer/global-context" "0.80.2" - "@glimmer/interfaces" "0.80.2" - "@glimmer/util" "0.80.2" + "@glimmer/global-context" "0.80.3" + "@glimmer/interfaces" "0.80.3" + "@glimmer/util" "0.80.3" -"@glimmer/encoder@0.80.2": - version "0.80.2" - resolved "https://registry.yarnpkg.com/@glimmer/encoder/-/encoder-0.80.2.tgz#30dd5aed6b56362388a2e3ed1069a318c76132ca" - integrity sha512-16D7VVy2Riqc2+q/374auzcJ/KpIIxEactAkPlPUgexwzUEuJSPcg1hcEh0medwPQlNn1YkL+5YFPh9zFUgoWQ== +"@glimmer/encoder@0.80.3": + version "0.80.3" + resolved "https://registry.yarnpkg.com/@glimmer/encoder/-/encoder-0.80.3.tgz#854be4d7673568ade867078676f2b8c8f6e3a89d" + integrity sha512-lhF4z9M5tWURapA4uoGUGHwCinpzWrKEhdX3L0V1WmXsWxZviWin8f9WcvmK4O990uFBfe/GVSF0anYDU+fFAw== dependencies: "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.80.2" - "@glimmer/vm" "0.80.2" + "@glimmer/interfaces" "0.80.3" + "@glimmer/vm" "0.80.3" "@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.80.2": - version "0.80.2" - resolved "https://registry.yarnpkg.com/@glimmer/global-context/-/global-context-0.80.2.tgz#aaa389f1055a056d0f911a7e9d101cbcc06f133b" - integrity sha512-XskcLaDUoXJYa/RLhkFNZSywzLoeMDQk6UTxvWrCtfE8hKXfeKSKq1FKyYenzB3SMF2ESX5yHOSd/xKBIYVypg== +"@glimmer/global-context@0.80.3": + version "0.80.3" + resolved "https://registry.yarnpkg.com/@glimmer/global-context/-/global-context-0.80.3.tgz#bfac6f048a8c3884e7d2c56509d57b4f63101d9a" + integrity sha512-GQLx1CznQeAELq4lg1VKo4zZ12wXX5wNdyFc0p+BdUP07vYUR47p/FJNst1RfUg1gU2/NxuUjdBh26QIHb+QTw== dependencies: "@glimmer/env" "^0.1.7" -"@glimmer/interfaces@0.80.2": - version "0.80.2" - resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.80.2.tgz#3937610ada436102ff9f92a6ea89e6d4531c1432" - integrity sha512-s5xhjoRNwp2fJty8/LpOY2qRLRlevYZFxEDD+Jl44YTRdU68DZJdSYd0cBknp1qDSi+C74zIg7S5cGwS3ulkUw== +"@glimmer/interfaces@0.80.3": + version "0.80.3" + resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.80.3.tgz#c7c866376d73b9c4e4282e9056c6798e84ce7331" + integrity sha512-38PVcR7uFdFdJnqDNhLMbaluZhJezdwRAJCTkwk/AxlC2bGa6iCv2GDQhErXp1qr26gyO7dt37gbtwLojBDauA== dependencies: "@simple-dom/interface" "^1.4.0" @@ -1642,140 +1642,140 @@ resolved "https://registry.yarnpkg.com/@glimmer/low-level/-/low-level-0.78.2.tgz#bca5f666760ce98345e87c5b3e37096e772cb2de" integrity sha512-0S6TWOOd0fzLLysw1pWZN0TgasaHmYs1Sjz9Til1mTByIXU1S+1rhdyr2veSQPO/aRjPuEQyKXZQHvx23Zax6w== -"@glimmer/manager@0.80.2": - version "0.80.2" - resolved "https://registry.yarnpkg.com/@glimmer/manager/-/manager-0.80.2.tgz#739d9766a21d62965bb322f5c57a7e984af35a1f" - integrity sha512-9Fz+R67cqXeDkFBBfag3HNE4bla0Y2BCmzo/VSPzt6dI/2qzWl+MTDyiu85RffAnMZgXuqMUElizcsuq3hWERg== +"@glimmer/manager@0.80.3": + version "0.80.3" + resolved "https://registry.yarnpkg.com/@glimmer/manager/-/manager-0.80.3.tgz#6d509ad6760e5aa484608201b146dce0d8cc4197" + integrity sha512-K2TEqp5VU61D/ytHzf1DmcsCV/MTLJZw8yuxp1/azDYEYJTKThM8U09yIcbsfTaEXDPkWNJ8A11LzcvYjow2iQ== dependencies: - "@glimmer/destroyable" "0.80.2" + "@glimmer/destroyable" "0.80.3" "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.80.2" - "@glimmer/reference" "0.80.2" - "@glimmer/util" "0.80.2" - "@glimmer/validator" "0.80.2" - -"@glimmer/node@0.80.2": - version "0.80.2" - resolved "https://registry.yarnpkg.com/@glimmer/node/-/node-0.80.2.tgz#651055876ca4c95fc5159f7918da1ea715e222e6" - integrity sha512-Urtey5+Jla2sjJSeYnjIYii9pei7bLr/8dPxbVkmJEh8oK3YIcz7YNymFjXxce2Vxdnj1A1KussGzBcK0FP3pA== - dependencies: - "@glimmer/interfaces" "0.80.2" - "@glimmer/runtime" "0.80.2" - "@glimmer/util" "0.80.2" + "@glimmer/interfaces" "0.80.3" + "@glimmer/reference" "0.80.3" + "@glimmer/util" "0.80.3" + "@glimmer/validator" "0.80.3" + +"@glimmer/node@0.80.3": + version "0.80.3" + resolved "https://registry.yarnpkg.com/@glimmer/node/-/node-0.80.3.tgz#c1fde8e3095e99764589f6d6730a14b05d2cfce8" + integrity sha512-WzYsJ3V8aDrQRlu6So8p/Fe0N3TdEUJJ/tbFIwpKDviVEhLxuJOnW/Qv6CjHaE1mzaVK8/HOxCtM96myg80GxQ== + dependencies: + "@glimmer/interfaces" "0.80.3" + "@glimmer/runtime" "0.80.3" + "@glimmer/util" "0.80.3" "@simple-dom/document" "^1.4.0" "@simple-dom/interface" "^1.4.0" -"@glimmer/opcode-compiler@0.80.2": - version "0.80.2" - resolved "https://registry.yarnpkg.com/@glimmer/opcode-compiler/-/opcode-compiler-0.80.2.tgz#be6fe3d0c7e82e1d903a9b594b017236c035018b" - integrity sha512-STGh/F8NaYxDVG6rPM97t/A9fnOpU+uK0BQEhRLsx/iGvq8PyE966p4LKyRAbmbuFTLhbZE7E/68Y0k0eWQc6Q== +"@glimmer/opcode-compiler@0.80.3": + version "0.80.3" + resolved "https://registry.yarnpkg.com/@glimmer/opcode-compiler/-/opcode-compiler-0.80.3.tgz#3c92ed8f3ed278743f57813089efe52339cb438b" + integrity sha512-qxKemQkjEeaznBQJHjhYy6LYSxi3XtBuMXLau/iouKI+tIq6MWIrmcET9Pg6ODS7O46JP/xMbDpGgf9IrKQvPQ== dependencies: - "@glimmer/encoder" "0.80.2" + "@glimmer/encoder" "0.80.3" "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.80.2" - "@glimmer/reference" "0.80.2" - "@glimmer/util" "0.80.2" - "@glimmer/vm" "0.80.2" - "@glimmer/wire-format" "0.80.2" + "@glimmer/interfaces" "0.80.3" + "@glimmer/reference" "0.80.3" + "@glimmer/util" "0.80.3" + "@glimmer/vm" "0.80.3" + "@glimmer/wire-format" "0.80.3" -"@glimmer/owner@0.80.2": - version "0.80.2" - resolved "https://registry.yarnpkg.com/@glimmer/owner/-/owner-0.80.2.tgz#34cf1b70ab3f061d8675c941cecaf3fcc319af3b" - integrity sha512-jEwaRA0oEEPaJDHs/5MlWm3fEmhN8qp3NJlLYs5Duviks+tEhtmB1zr3Jg+7TAMrJloRo9iadt4TrZzezgRAIQ== +"@glimmer/owner@0.80.3": + version "0.80.3" + resolved "https://registry.yarnpkg.com/@glimmer/owner/-/owner-0.80.3.tgz#24574d75ada5ecd4b1caa96310cf956420d936df" + integrity sha512-kf8NunzhzFzZ+/ySHNu66w6DS9OW1EY7UmKypMESE4Suy3FShGnWmm8aoqxpjoOwczzOaODScRX9ZIPIpV3xNg== dependencies: - "@glimmer/util" "0.80.2" + "@glimmer/util" "0.80.3" -"@glimmer/program@0.80.2": - version "0.80.2" - resolved "https://registry.yarnpkg.com/@glimmer/program/-/program-0.80.2.tgz#dc1a582c564f735f4021d3eb6c54047c237c264f" - integrity sha512-MpPJgeCc/yj9uawG4kqBxzVOuJNky3WB9g3Cm21k0Z+YACdguC2UjXUoA9PvjfrLEj+7eajE0wQ+QTbztOwVtQ== +"@glimmer/program@0.80.3": + version "0.80.3" + resolved "https://registry.yarnpkg.com/@glimmer/program/-/program-0.80.3.tgz#42408a451681edf503104827d268079bd00abcc1" + integrity sha512-Y058DF2pb7ulUf2ytU8cK/b1VSyRIbBRQyorgRXaR4dpLO7RXm6AHSrn2miiy2EtoOodBk7JX50Ei3kr0+eVZw== dependencies: - "@glimmer/encoder" "0.80.2" + "@glimmer/encoder" "0.80.3" "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.80.2" - "@glimmer/manager" "0.80.2" - "@glimmer/opcode-compiler" "0.80.2" - "@glimmer/util" "0.80.2" + "@glimmer/interfaces" "0.80.3" + "@glimmer/manager" "0.80.3" + "@glimmer/opcode-compiler" "0.80.3" + "@glimmer/util" "0.80.3" -"@glimmer/reference@0.80.2": - version "0.80.2" - resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.80.2.tgz#db14f64592bd7f505d47527eacc298a1ba7f8ea5" - integrity sha512-uXRc912/kAoXgNu2MIWcqARyMUq+h+N82LiNXg0mYo/SYaxT1ag3uVw6nM82ou9ii0lLWKY1fP/4knuSwu0rbA== +"@glimmer/reference@0.80.3": + version "0.80.3" + resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.80.3.tgz#e60aaf3eb73b9ca3803942b49e29d104a06c948b" + integrity sha512-ghvMnkHBRc5xwAxL/r5ZVbBH1bGxLk2LmgQwpgeSzv5EhZvRQCRW8W19IDmMCv9pAEmgsxgdjAQcP0gudMvyrQ== dependencies: "@glimmer/env" "^0.1.7" - "@glimmer/global-context" "0.80.2" - "@glimmer/interfaces" "0.80.2" - "@glimmer/util" "0.80.2" - "@glimmer/validator" "0.80.2" + "@glimmer/global-context" "0.80.3" + "@glimmer/interfaces" "0.80.3" + "@glimmer/util" "0.80.3" + "@glimmer/validator" "0.80.3" -"@glimmer/runtime@0.80.2": - version "0.80.2" - resolved "https://registry.yarnpkg.com/@glimmer/runtime/-/runtime-0.80.2.tgz#14895a6d2a0c7214163a21579a7980f8784dfd6c" - integrity sha512-7g12Eyo/fQpKICXXW/+cQCA/mYr4ugOrM7YiZSYtAdm1gIQqQFbxnod2iLgFgISDqRHf8cKTsuZw7+yeIwQNIA== +"@glimmer/runtime@0.80.3": + version "0.80.3" + resolved "https://registry.yarnpkg.com/@glimmer/runtime/-/runtime-0.80.3.tgz#faec66e717b57035332bab22f8d377c6aaeda4d9" + integrity sha512-my+myLcOeYjdcrUbjjOfguPAtgOzSDBMjLql58aiColsEntvv1NsKAYLRaxf+MwSYK/PzxAUM+tN+pRdm43vSA== dependencies: - "@glimmer/destroyable" "0.80.2" + "@glimmer/destroyable" "0.80.3" "@glimmer/env" "0.1.7" - "@glimmer/global-context" "0.80.2" - "@glimmer/interfaces" "0.80.2" + "@glimmer/global-context" "0.80.3" + "@glimmer/interfaces" "0.80.3" "@glimmer/low-level" "0.78.2" - "@glimmer/owner" "0.80.2" - "@glimmer/program" "0.80.2" - "@glimmer/reference" "0.80.2" - "@glimmer/util" "0.80.2" - "@glimmer/validator" "0.80.2" - "@glimmer/vm" "0.80.2" - "@glimmer/wire-format" "0.80.2" + "@glimmer/owner" "0.80.3" + "@glimmer/program" "0.80.3" + "@glimmer/reference" "0.80.3" + "@glimmer/util" "0.80.3" + "@glimmer/validator" "0.80.3" + "@glimmer/vm" "0.80.3" + "@glimmer/wire-format" "0.80.3" "@simple-dom/interface" "^1.4.0" -"@glimmer/syntax@0.80.2": - version "0.80.2" - resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.80.2.tgz#2123a0c28c9a9d39b42392aaa3df8b7f3706645b" - integrity sha512-30H1RtmjCW5miO4codNPWgyO0UOeBaDuc7ohSuG0E85djh444ImfJwlLE/cW6C4pLb38OeG8vEPODnppWV3XUg== +"@glimmer/syntax@0.80.3": + version "0.80.3" + resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.80.3.tgz#9018469f03c9ad5ee9e14446280f5f6312bdf130" + integrity sha512-hACbTpXgNO2l7USDVDUPvXh4Xo9e06sQEyv1QvGn/MK8FKfMkThxOmLrWy/pcEdeePmCMNGMLGgfjG6bO5FCUQ== dependencies: - "@glimmer/interfaces" "0.80.2" - "@glimmer/util" "0.80.2" + "@glimmer/interfaces" "0.80.3" + "@glimmer/util" "0.80.3" "@handlebars/parser" "~2.0.0" simple-html-tokenizer "^0.5.10" -"@glimmer/util@0.80.2": - version "0.80.2" - resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.80.2.tgz#a1dbb11575255a478c0ba161d521cdbad8c3410d" - integrity sha512-GniMILqLJ+dWiwmO/UOBPCqwMYEPYoFW3e/mInUbKn0YBenf/M6hJhnPI7Z11NpObknq3s5nNLkDcmR3gdFmHA== +"@glimmer/util@0.80.3": + version "0.80.3" + resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.80.3.tgz#573e562e20c7c1a869d84095a987d641ea9885d1" + integrity sha512-H6u9gPpBrZWfdHAXQyVTsttSJzBfpQ2NWc2Jnh35b7HxPpg0npcLsjIAuba4gHlcsKLwlN42s3O+J8x9weL4gQ== dependencies: "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.80.2" + "@glimmer/interfaces" "0.80.3" "@simple-dom/interface" "^1.4.0" -"@glimmer/validator@0.80.2": - version "0.80.2" - resolved "https://registry.yarnpkg.com/@glimmer/validator/-/validator-0.80.2.tgz#4ac1faf608913c88d0dab54a37068bbdf6edc62a" - integrity sha512-m5K0IxStWHM5vJbJDDXhnr2LGAnC469RclA6jazbtl3fVHEg5njzsQYUIfRTxFpgPK3QEyRJrR6r3PG9RCMnDw== +"@glimmer/validator@0.80.3": + version "0.80.3" + resolved "https://registry.yarnpkg.com/@glimmer/validator/-/validator-0.80.3.tgz#32814cb9d4c504e2ffc828cd6def0e6e27dd9e67" + integrity sha512-73Kk6v4q8zz4brbsM6stMrQKyyRU9uBYqpyfhQNAIjsJAtVchazt/v/h6JcXTDAJZ+YvhIoFrM//8GJWAqPh3w== dependencies: "@glimmer/env" "^0.1.7" - "@glimmer/global-context" "0.80.2" + "@glimmer/global-context" "0.80.3" -"@glimmer/vm-babel-plugins@0.80.2": - version "0.80.2" - resolved "https://registry.yarnpkg.com/@glimmer/vm-babel-plugins/-/vm-babel-plugins-0.80.2.tgz#6e3b6b0ec06994084b44fca1f19c20fd945df454" - integrity sha512-ufdz76tVz3TivS8Bb92n/v6yXNX8zgREDwR3ju45ZO48yWexySllUBFOvwCAmPIoHSQGq8LyIwJGESIJLacr6A== +"@glimmer/vm-babel-plugins@0.80.3": + version "0.80.3" + resolved "https://registry.yarnpkg.com/@glimmer/vm-babel-plugins/-/vm-babel-plugins-0.80.3.tgz#434b62172318cac43830d3ac29818cf2c5f111c1" + integrity sha512-9ej6xlm5MzHBJ5am2l0dbbn8Z0wJoYoMpM8FcrGMlUP6SPMLWxvxpMsApgQo8u6dvZRCjR3/bw3fdf7GOy0AFw== dependencies: babel-plugin-debug-macros "^0.3.4" -"@glimmer/vm@0.80.2": - version "0.80.2" - resolved "https://registry.yarnpkg.com/@glimmer/vm/-/vm-0.80.2.tgz#33f875b0b8e2cc5a6c3d5c1548dbbc333631f6ac" - integrity sha512-5dk76zuc2wRR6L2FVHJIX0MQ3AuawXoO2JW/i5nP8wu3r3jXXrvUbtwtR2DCq6lasmyjk5pygtf+DSaawrezqg== +"@glimmer/vm@0.80.3": + version "0.80.3" + resolved "https://registry.yarnpkg.com/@glimmer/vm/-/vm-0.80.3.tgz#3073cfa40b4cf16468a62862fd608b20f4880dc6" + integrity sha512-W3auYwgJPGgAINsF/8aU8Vsdw1w/k0LjIq6KAmuMlj09ol1jVQKjFNp990Te9L18OPHp2BcFvFd4x3kHZa0Z0Q== dependencies: - "@glimmer/interfaces" "0.80.2" - "@glimmer/util" "0.80.2" + "@glimmer/interfaces" "0.80.3" + "@glimmer/util" "0.80.3" -"@glimmer/wire-format@0.80.2": - version "0.80.2" - resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.80.2.tgz#ae7c7bd2e2a56aca6110b6d7048dae6ac99d340e" - integrity sha512-UE7P2AJNs9snKr8LRd4LDZYRmOybYJodUl4vfdntmBeYHiGNWWKpft1tgg5IDdBgmYPvoOEaRQUoIkdMhMT6aA== +"@glimmer/wire-format@0.80.3": + version "0.80.3" + resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.80.3.tgz#e8acb095244e982c328cceba8438b19eb5226358" + integrity sha512-mcF3iyIukja3RlMbFFMFY80dZ9FtCooMdX/R1py1TfzPc9dYPmLadayC0mrRNPmf/PV9NQVihFHFHNuWitNSrw== dependencies: - "@glimmer/interfaces" "0.80.2" - "@glimmer/util" "0.80.2" + "@glimmer/interfaces" "0.80.3" + "@glimmer/util" "0.80.3" "@handlebars/parser@~2.0.0": version "2.0.0" From d5e3540ffaea7ea79f3a7787d99a93236909e0ec Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Fri, 22 Oct 2021 12:38:07 -0400 Subject: [PATCH 59/61] Add v3.28.4 to CHANGELOG.md. --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2d27a6bede..b7ad848ac0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Ember Changelog +## v3.28.4 (October 22, 2021) + +- [#19798](https://github.com/emberjs/ember.js/pull/19798) More fixes for errors while precompiling inline templates (introduced in 3.28.2) +- [glimmerjs/glimmer-vm@0.80.3](https://github.com/glimmerjs/glimmer-vm/releases/tag/v0.80.3) Improve template compilation speed regression + ## v3.28.3 (October 22, 2021) - [#19799](https://github.com/emberjs/ember.js/pull/19799) / [glimmerjs/glimmer-vm#1354](https://github.com/glimmerjs/glimmer-vm/pull/1354) Fixes for errors while precompiling inline templates (introduced in 3.28.2) From 62976fe7c0197baa05d1be558d0a4bcc18199d34 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Fri, 22 Oct 2021 12:38:22 -0400 Subject: [PATCH 60/61] 3.28.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4f9dc0821c5..fd59c04bd57 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ember-source", - "version": "3.28.3", + "version": "3.28.4", "description": "A JavaScript framework for creating ambitious web applications", "keywords": [ "ember-addon" From 739b62a13bac008bcb6d6d021d31c895fee6d9de Mon Sep 17 00:00:00 2001 From: NullVoxPopuli Date: Thu, 14 Oct 2021 09:38:09 -0400 Subject: [PATCH 61/61] [BUGFIX LTS] fix router test regression for all router service properties --- packages/@ember/-internals/routing/lib/services/router.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/@ember/-internals/routing/lib/services/router.ts b/packages/@ember/-internals/routing/lib/services/router.ts index 68f2de42293..8abcb6ff46d 100644 --- a/packages/@ember/-internals/routing/lib/services/router.ts +++ b/packages/@ember/-internals/routing/lib/services/router.ts @@ -58,6 +58,7 @@ export default class RouterService extends Service { } const owner = getOwner(this) as Owner; router = owner.lookup('router:main') as EmberRouter; + router.setupRouter(); return (this[ROUTER] = router); } @@ -240,7 +241,6 @@ export default class RouterService extends Service { @public */ urlFor(routeName: string, ...args: any[]) { - this._router.setupRouter(); return this._router.generate(routeName, ...args); } @@ -376,7 +376,6 @@ export default class RouterService extends Service { `You must pass a url that begins with the application's rootURL "${this.rootURL}"`, url.indexOf(this.rootURL) === 0 ); - this._router.setupRouter(); let internalURL = cleanURL(url, this.rootURL); return this._router._routerMicrolib.recognize(internalURL); } @@ -397,7 +396,6 @@ export default class RouterService extends Service { `You must pass a url that begins with the application's rootURL "${this.rootURL}"`, url.indexOf(this.rootURL) === 0 ); - this._router.setupRouter(); let internalURL = cleanURL(url, this.rootURL); return this._router._routerMicrolib.recognizeAndLoad(internalURL); } @@ -511,7 +509,9 @@ RouterService.reopen(Evented, { @type String @public */ - currentRouteName: readOnly('_router.currentRouteName'), + get currentRouteName() { + return this._router.currentRouteName; + }, /** Current URL for the application.