ember-source 4.0.0-beta.1 → 4.0.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/blueprints/acceptance-test/qunit-files/tests/acceptance/__name__-test.js +1 -1
  3. package/blueprints/acceptance-test/qunit-rfc-232-files/tests/acceptance/__name__-test.js +1 -1
  4. package/blueprints/component-test/qunit-files/__root__/__testType__/__path__/__test__.js +3 -3
  5. package/blueprints/helper-test/index.js +4 -22
  6. package/blueprints/helper-test/mocha-0.12-files/__root__/__testType__/__collection__/__name__-test.js +1 -13
  7. package/blueprints/helper-test/mocha-files/__root__/__testType__/__collection__/__name__-test.js +0 -13
  8. package/blueprints/helper-test/mocha-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js +2 -12
  9. package/blueprints/helper-test/qunit-files/__root__/__testType__/__collection__/__name__-test.js +2 -13
  10. package/blueprints/helper-test/qunit-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js +2 -14
  11. package/blueprints/initializer/files/__root__/initializers/__name__.js +0 -1
  12. package/blueprints/instance-initializer/files/__root__/instance-initializers/__name__.js +0 -1
  13. package/build-metadata.json +3 -3
  14. package/dist/dependencies/@glimmer/manager.js +19 -98
  15. package/dist/dependencies/@glimmer/opcode-compiler.js +9 -146
  16. package/dist/dependencies/@glimmer/runtime.js +1 -55
  17. package/dist/dependencies/@glimmer/validator.js +19 -51
  18. package/dist/ember-template-compiler.js +383 -961
  19. package/dist/ember-template-compiler.map +1 -1
  20. package/dist/ember-testing.js +4 -513
  21. package/dist/ember-testing.map +1 -1
  22. package/dist/ember.debug.js +3246 -8084
  23. package/dist/ember.debug.map +1 -1
  24. package/dist/header/license.js +1 -1
  25. package/dist/packages/@ember/-internals/container/index.js +17 -183
  26. package/dist/packages/@ember/-internals/environment/index.js +0 -27
  27. package/dist/packages/@ember/-internals/extension-support/lib/container_debug_adapter.js +7 -0
  28. package/dist/packages/@ember/-internals/glimmer/index.js +4827 -6812
  29. package/dist/packages/@ember/-internals/metal/index.js +21 -45
  30. package/dist/packages/@ember/-internals/routing/lib/services/router.js +8 -0
  31. package/dist/packages/@ember/-internals/routing/lib/services/routing.js +1 -1
  32. package/dist/packages/@ember/-internals/routing/lib/system/route.js +1 -41
  33. package/dist/packages/@ember/-internals/routing/lib/system/router.js +22 -91
  34. package/dist/packages/@ember/-internals/runtime/lib/mixins/array.js +2 -173
  35. package/dist/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +3 -43
  36. package/dist/packages/@ember/-internals/runtime/lib/system/array_proxy.js +8 -15
  37. package/dist/packages/@ember/-internals/runtime/lib/system/core_object.js +4 -90
  38. package/dist/packages/@ember/-internals/utils/index.js +0 -3
  39. package/dist/packages/@ember/-internals/views/index.js +0 -2
  40. package/dist/packages/@ember/-internals/views/lib/mixins/view_support.js +4 -4
  41. package/dist/packages/@ember/-internals/views/lib/system/event_dispatcher.js +22 -72
  42. package/dist/packages/@ember/application/instance.js +1 -22
  43. package/dist/packages/@ember/application/lib/application.js +14 -32
  44. package/dist/packages/@ember/canary-features/index.js +0 -2
  45. package/dist/packages/@ember/component/index.js +1 -1
  46. package/dist/packages/@ember/deprecated-features/index.js +0 -4
  47. package/dist/packages/@ember/engine/index.js +2 -7
  48. package/dist/packages/@ember/engine/instance.js +0 -4
  49. package/dist/packages/@ember/object/lib/computed/computed_macros.js +0 -373
  50. package/dist/packages/@ember/object/lib/computed/reduce_computed_macros.js +0 -351
  51. package/dist/packages/@ember/routing/index.js +1 -1
  52. package/dist/packages/ember/index.js +9 -62
  53. package/dist/packages/ember/version.js +1 -1
  54. package/dist/packages/ember-testing/index.js +0 -2
  55. package/dist/packages/ember-testing/lib/helpers.js +0 -12
  56. package/dist/packages/ember-testing/lib/setup_for_testing.js +0 -10
  57. package/docs/data.json +598 -1901
  58. package/lib/index.js +13 -51
  59. package/package.json +18 -18
  60. package/dist/packages/@ember/-internals/views/lib/mixins/text_support.js +0 -345
  61. package/dist/packages/@ember/-internals/views/lib/system/jquery.js +0 -26
  62. package/dist/packages/@ember/component/checkbox.js +0 -17
  63. package/dist/packages/@ember/component/text-area.js +0 -17
  64. package/dist/packages/@ember/component/text-field.js +0 -17
  65. package/dist/packages/@ember/routing/link-component.js +0 -17
  66. package/dist/packages/ember-testing/lib/events.js +0 -101
  67. package/dist/packages/ember-testing/lib/helpers/-is-form-control.js +0 -19
  68. package/dist/packages/ember-testing/lib/helpers/click.js +0 -32
  69. package/dist/packages/ember-testing/lib/helpers/fill_in.js +0 -47
  70. package/dist/packages/ember-testing/lib/helpers/find.js +0 -40
  71. package/dist/packages/ember-testing/lib/helpers/find_with_assert.js +0 -37
  72. package/dist/packages/ember-testing/lib/helpers/key_event.js +0 -37
  73. package/dist/packages/ember-testing/lib/helpers/trigger_event.js +0 -61
  74. package/dist/packages/ember-testing/lib/support.js +0 -57
  75. package/dist/packages/jquery/index.js +0 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,61 @@
1
1
  # Ember Changelog
2
2
 
3
+ ### v4.0.0-beta.10 (November 15, 2021)
4
+
5
+ - [#19833](https://github.com/emberjs/ember.js/pull/19833) [CLEANUP] Remove deprecated array observers
6
+ - [#19836](https://github.com/emberjs/ember.js/pull/19836) [CLEANUP] Turn `template-only-glimmer-components` deprecation into an error
7
+ - [#19843](https://github.com/emberjs/ember.js/pull/19843) [CLEANUP] Turn `argument-less-helper-paren-less-invocation` deprecation into an error
8
+
9
+ ### v4.0.0-beta.9 (November 10, 2021)
10
+
11
+ - [#19749](https://github.com/emberjs/ember.js/pull/19749) [CLEANUP] Remove `deprecate-router-events` support code
12
+ - [#19762](https://github.com/emberjs/ember.js/pull/19762) [CLEANUP] Update GlimmerVM to 0.81
13
+ - removes deprecation of mutations during helper compute
14
+ - removes deprecation of mutations during unknownProperty
15
+ - `@glimmer/integration-tests`, `@glimmer/manager`, `@glimmer/validator`
16
+ * [#1330](https://github.com/glimmerjs/glimmer-vm/pull/1330) Remove deprecated support for mutation after consumption during certain manager hooks ([@snewcomer](https://github.com/snewcomer))
17
+ - `@glimmer/manager`
18
+ * [#1328](https://github.com/glimmerjs/glimmer-vm/pull/1328) Remove deprecated Component Manager version 3.4 ([@nlfurniss](https://github.com/nlfurniss))
19
+ - `@glimmer/integration-tests`, `@glimmer/manager`
20
+ * [#1329](https://github.com/glimmerjs/glimmer-vm/pull/1329) Remove deprecated Modifier Manager version 3.13 ([@nlfurniss](https://github.com/nlfurniss))
21
+ - [#19806](https://github.com/emberjs/ember.js/pull/19806) [CLEANUP] Drop export of built-ins, remove legacy components
22
+
23
+ ### v4.0.0-beta.8 (November 5, 2021)
24
+
25
+ - [#19823](https://github.com/emberjs/ember.js/pull/19823) / [#19828](https://github.com/emberjs/ember.js/pull/19828) [BUGFIX] Fix deprecation `until` and link for Component.reopenClass and Component.reopen
26
+ - [#19825](https://github.com/emberjs/ember.js/pull/19825) [BUGFIX] Replace `assert.equal` in blueprints with `assert.strictEqual` to pass eslint-plugin-qunit v7 on generation
27
+ - [#19808](https://github.com/emberjs/ember.js/pull/19808) [CLEANUP] Remove the `--test-type` option from the helper blueprint
28
+ - [#19820](https://github.com/emberjs/ember.js/pull/19820) Fix memory leak when looking up non-instantiable objects from the owner
29
+
30
+ ### v4.0.0-beta.7 (November 1, 2021)
31
+
32
+ - [#19677](https://github.com/emberjs/ember.js/pull/19677) [CLEANUP] Remove jQuery from build
33
+
34
+ ### v4.0.0-beta.6 (October 26, 2021)
35
+
36
+ - [#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)
37
+
38
+ ### v4.0.0-beta.5 (October 11, 2021)
39
+
40
+ - [#19761](https://github.com/emberjs/ember.js/pull/19761) [BREAKING] Require ember-auto-import >= 2 or higher to enable ember-source to become a v2 addon in the 4.x cycle
41
+
42
+ ### v4.0.0-beta.4 (September 13, 2021)
43
+
44
+ - [#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
45
+
46
+ ### v4.0.0-beta.3 (August 30, 2021)
47
+
48
+ - [#19708](https://github.com/emberjs/ember.js/pull/19708) [CLEANUP] Remove class-binding-and-class-name-bindings-in-templates
49
+
50
+ ### v4.0.0-beta.2 (August 23, 2021)
51
+
52
+ - [#19680](https://github.com/emberjs/ember.js/pull/19680) [DEPRECATION] Deprecate owner.inject per [RFC #680](https://github.com/emberjs/rfcs/blob/sn/owner-inject-deprecation/text/0680-implicit-injection-deprecation.md#1-deprecate-implicit-injection-on-target-object) and cleanup related deprecations that are `until: 4.0.0`.
53
+ - [#19706](https://github.com/emberjs/ember.js/pull/19706) [BUGFIX] Explicitly drop Node 10 support to match support policy.
54
+ - [#19650](https://github.com/emberjs/ember.js/pull/19650) [CLEANUP] Remove deprecated mouse events
55
+ - [#19675](https://github.com/emberjs/ember.js/pull/19675) [CLEANUP] Remove jQuery usage from ember-testing
56
+ - [#19704](https://github.com/emberjs/ember.js/pull/19704) [CLEANUP] Remove template-compiler.registerPlugin
57
+ - [#19707](https://github.com/emberjs/ember.js/pull/19707) [CLEANUP] Remove Application Controller Router Properties
58
+
3
59
  ### v4.0.0-beta.1 (August 17, 2021)
4
60
 
5
61
  - [#19649](https://github.com/emberjs/ember.js/pull/19649) / [#19692](https://github.com/emberjs/ember.js/pull/19692) [DEPRECATION] Add deprecation warning to Ember.assign implementing [RFC #750](https://github.com/emberjs/rfcs/blob/master/text/0750-deprecate-ember-assign.md).
@@ -44,6 +100,22 @@
44
100
  - [#19695](https://github.com/emberjs/ember.js/pull/19695) [CLEANUP] Remove {{partial}}
45
101
  - [#19691](https://github.com/emberjs/ember.js/pull/19691) Add build assertion against `{{outlet named}}`
46
102
 
103
+ ## v3.28.5 (November 3, 2021)
104
+
105
+ - [#19820](https://github.com/emberjs/ember.js/pull/19820) Fix memory leak when looking up non-instantiable objects from the owner
106
+
107
+ ## v3.28.3 (October 22, 2021)
108
+
109
+ - [#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)
110
+
111
+ ## v3.28.2 (October 21, 2021)
112
+
113
+ - [glimmerjs/glimmer-vm#1351](https://github.com/glimmerjs/glimmer-vm/pull/1351) Support lexical scope in loose mode
114
+
115
+ ## v3.28.1 (August 30, 2021)
116
+
117
+ - [#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
118
+
47
119
  ### v3.28.0 (August 9, 2021)
48
120
 
49
121
  - [#19697](https://github.com/emberjs/ember.js/pull/19697) [BUGFIX] Ensure `deserializeQueryParam` is called for lazy routes
@@ -7,6 +7,6 @@ test('visiting /<%= dasherizedModuleName %>', function(assert) {
7
7
  visit('/<%= dasherizedModuleName %>');
8
8
 
9
9
  andThen(function() {
10
- assert.equal(currentURL(), '/<%= dasherizedModuleName %>');
10
+ assert.strictEqual(currentURL(), '/<%= dasherizedModuleName %>');
11
11
  });
12
12
  });
@@ -8,6 +8,6 @@ module('<%= friendlyTestName %>', function(hooks) {
8
8
  test('visiting /<%= dasherizedModuleName %>', async function(assert) {
9
9
  await visit('/<%= dasherizedModuleName %>');
10
10
 
11
- assert.equal(currentURL(), '/<%= dasherizedModuleName %>');
11
+ assert.strictEqual(currentURL(), '/<%= dasherizedModuleName %>');
12
12
  });
13
13
  });
@@ -13,7 +13,7 @@ test('it renders', function(assert) {
13
13
 
14
14
  this.render(hbs`<%= selfCloseComponent(componentName) %>`);
15
15
 
16
- assert.equal(this.$().text().trim(), '');
16
+ assert.strictEqual(this.$().text().trim(), '');
17
17
 
18
18
  // Template block usage:
19
19
  this.render(hbs`
@@ -22,10 +22,10 @@ test('it renders', function(assert) {
22
22
  <%= closeComponent(componentName) %>
23
23
  `);
24
24
 
25
- assert.equal(this.$().text().trim(), 'template block text');<% } else if(testType === 'unit') { %>
25
+ assert.strictEqual(this.$().text().trim(), 'template block text');<% } else if(testType === 'unit') { %>
26
26
  // Creates the component instance
27
27
  /*let component =*/ this.subject();
28
28
  // Renders the component to the page
29
29
  this.render();
30
- assert.equal(this.$().text().trim(), '');<% } %>
30
+ assert.strictEqual(this.$().text().trim(), '');<% } %>
31
31
  });
@@ -7,29 +7,15 @@ const semver = require('semver');
7
7
  const useTestFrameworkDetector = require('../test-framework-detector');
8
8
 
9
9
  module.exports = useTestFrameworkDetector({
10
- description: 'Generates a helper integration test or a unit test.',
11
-
12
- availableOptions: [
13
- {
14
- name: 'test-type',
15
- type: ['integration', 'unit'],
16
- default: 'integration',
17
- aliases: [
18
- { i: 'integration' },
19
- { u: 'unit' },
20
- { integration: 'integration' },
21
- { unit: 'unit' },
22
- ],
23
- },
24
- ],
10
+ description: 'Generates a helper integration test.',
25
11
 
26
12
  fileMapTokens: function () {
27
13
  return {
28
14
  __root__() {
29
15
  return 'tests';
30
16
  },
31
- __testType__(options) {
32
- return options.locals.testType || 'integration';
17
+ __testType__() {
18
+ return 'integration';
33
19
  },
34
20
  __collection__() {
35
21
  return 'helpers';
@@ -38,9 +24,7 @@ module.exports = useTestFrameworkDetector({
38
24
  },
39
25
 
40
26
  locals: function (options) {
41
- let testType = options.testType || 'integration';
42
- let testName = testType === 'integration' ? 'Integration' : 'Unit';
43
- let friendlyTestName = [testName, 'Helper', options.entity.name].join(' | ');
27
+ let friendlyTestName = ['Integration', 'Helper', options.entity.name].join(' | ');
44
28
  let dasherizedModulePrefix = stringUtils.dasherize(options.project.config().modulePrefix);
45
29
 
46
30
  let hbsImportStatement = this._useNamedHbsImport()
@@ -48,7 +32,6 @@ module.exports = useTestFrameworkDetector({
48
32
  : "import hbs from 'htmlbars-inline-precompile';";
49
33
 
50
34
  return {
51
- testType,
52
35
  friendlyTestName,
53
36
  dasherizedModulePrefix,
54
37
  hbsImportStatement,
@@ -68,7 +51,6 @@ module.exports = useTestFrameworkDetector({
68
51
  afterInstall: function (options) {
69
52
  if (
70
53
  !options.dryRun &&
71
- options.testType === 'integration' &&
72
54
  !this._useNamedHbsImport() &&
73
55
  isPackageMissing(this, 'ember-cli-htmlbars-inline-precompile')
74
56
  ) {
@@ -1,5 +1,5 @@
1
1
  import { expect } from 'chai';
2
- <% if (testType == 'integration') { %>import { describe, it } from 'mocha';
2
+ import { describe, it } from 'mocha';
3
3
  import { setupComponentTest } from 'ember-mocha';
4
4
  import hbs from 'htmlbars-inline-precompile';
5
5
 
@@ -24,15 +24,3 @@ describe('<%= friendlyTestName %>', function() {
24
24
  expect(this.$().text().trim()).to.equal('1234');
25
25
  });
26
26
  });
27
- <% } else if (testType == 'unit') { %>import { describe, it } from 'mocha';
28
- import { <%= camelizedModuleName %> } from '<%= dasherizedPackageName %>/helpers/<%= dasherizedModuleName %>';
29
-
30
- describe('<%= friendlyTestName %>', function() {
31
-
32
- // TODO: Replace this with your real tests.
33
- it('works', function() {
34
- let result = <%= camelizedModuleName %>(42);
35
- expect(result).to.be.ok;
36
- });
37
- });
38
- <% } %>
@@ -1,5 +1,4 @@
1
1
  import { expect } from 'chai';
2
- <% if (testType == 'integration') { %>
3
2
  import { describeComponent, it } from 'ember-mocha';
4
3
  import hbs from 'htmlbars-inline-precompile';
5
4
 
@@ -25,15 +24,3 @@ describeComponent('<%= dasherizedModuleName %>', 'helper:<%= dasherizedModuleNam
25
24
  });
26
25
  }
27
26
  );
28
- <% } else if (testType == 'unit') { %>import { describe, it } from 'mocha';
29
- import { <%= camelizedModuleName %> } from '<%= dasherizedPackageName %>/helpers/<%= dasherizedModuleName %>';
30
-
31
- describe('<%= friendlyTestName %>', function() {
32
-
33
- // TODO: Replace this with your real tests.
34
- it('works', function() {
35
- let result = <%= camelizedModuleName %>(42);
36
- expect(result).to.be.ok;
37
- });
38
- });
39
- <% } %>
@@ -1,5 +1,5 @@
1
1
  import { expect } from 'chai';
2
- <% if (testType == 'integration') { %>import { describe, it } from 'mocha';
2
+ import { describe, it } from 'mocha';
3
3
  import { setupRenderingTest } from 'ember-mocha';
4
4
  import { render } from '@ember/test-helpers';
5
5
  <%= hbsImportStatement %>
@@ -15,14 +15,4 @@ describe('<%= friendlyTestName %>', function() {
15
15
 
16
16
  expect(this.element.textContent.trim()).to.equal('1234');
17
17
  });
18
- });<% } else if (testType == 'unit') { %>import { describe, it } from 'mocha';
19
- import { <%= camelizedModuleName %> } from '<%= dasherizedPackageName %>/helpers/<%= dasherizedModuleName %>';
20
-
21
- describe('<%= friendlyTestName %>', function() {
22
-
23
- // TODO: Replace this with your real tests.
24
- it('works', function() {
25
- let result = <%= camelizedModuleName %>(42);
26
- expect(result).to.be.ok;
27
- });
28
- });<% } %>
18
+ });
@@ -1,4 +1,4 @@
1
- <% if (testType == 'integration') { %>import { moduleForComponent, test } from 'ember-qunit';
1
+ import { moduleForComponent, test } from 'ember-qunit';
2
2
  import hbs from 'htmlbars-inline-precompile';
3
3
 
4
4
  moduleForComponent('<%= dasherizedModuleName %>', 'helper:<%= dasherizedModuleName %>', {
@@ -11,16 +11,5 @@ test('it renders', function(assert) {
11
11
 
12
12
  this.render(hbs`{{<%= dasherizedModuleName %> this.inputValue}}`);
13
13
 
14
- assert.equal(this.$().text().trim(), '1234');
15
- });<% } else if (testType == 'unit') { %>
16
- import { <%= camelizedModuleName %> } from '<%= dasherizedModulePrefix %>/helpers/<%= dasherizedModuleName %>';
17
- import { module, test } from 'qunit';
18
-
19
- module('<%= friendlyTestName %>');
20
-
21
- // TODO: Replace this with your real tests.
22
- test('it works', function(assert) {
23
- let result = <%= camelizedModuleName %>([42]);
24
- assert.ok(result);
14
+ assert.strictEqual(this.$().text().trim(), '1234');
25
15
  });
26
- <% } %>
@@ -1,4 +1,4 @@
1
- <% if (testType === 'integration') { %>import { module, test } from 'qunit';
1
+ import { module, test } from 'qunit';
2
2
  import { setupRenderingTest } from 'ember-qunit';
3
3
  import { render } from '@ember/test-helpers';
4
4
  <%= hbsImportStatement %>
@@ -14,16 +14,4 @@ module('<%= friendlyTestName %>', function(hooks) {
14
14
 
15
15
  assert.dom(this.element).hasText('1234');
16
16
  });
17
- });<% } else if (testType === 'unit') { %>import { <%= camelizedModuleName %> } from '<%= dasherizedModulePrefix %>/helpers/<%= dasherizedModuleName %>';
18
- import { module, test } from 'qunit';
19
- import { setupTest } from 'ember-qunit';
20
-
21
- module('<%= friendlyTestName %>', function(hooks) {
22
- setupTest(hooks);
23
-
24
- // TODO: Replace this with your real tests.
25
- test('it works', function(assert) {
26
- let result = <%= camelizedModuleName %>([42]);
27
- assert.ok(result);
28
- });
29
- });<% } %>
17
+ });
@@ -1,5 +1,4 @@
1
1
  export function initialize(/* application */) {
2
- // application.inject('route', 'foo', 'service:foo');
3
2
  }
4
3
 
5
4
  export default {
@@ -1,5 +1,4 @@
1
1
  export function initialize(/* appInstance */) {
2
- // appInstance.inject('route', 'foo', 'service:foo');
3
2
  }
4
3
 
5
4
  export default {
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "4.0.0-beta.1",
2
+ "version": "4.0.0-beta.10",
3
3
  "buildType": "tag",
4
- "SHA": "0cf547f7a5cc45cb6517b30fc6d8dd3e7872415f",
5
- "assetPath": "/tag/shas/0cf547f7a5cc45cb6517b30fc6d8dd3e7872415f.tgz"
4
+ "SHA": "4aa09c6a4108fe1a6f4ef441b36b9ed3b8ba1c5f",
5
+ "assetPath": "/tag/shas/4aa09c6a4108fe1a6f4ef441b36b9ed3b8ba1c5f.tgz"
6
6
  }
@@ -1,9 +1,8 @@
1
1
  import { DEBUG } from '@glimmer/env';
2
- import { debugToString, _WeakSet, HAS_NATIVE_PROXY, assign, dict } from '@glimmer/util';
2
+ import { debugToString, _WeakSet, HAS_NATIVE_PROXY } from '@glimmer/util';
3
3
  import { valueForRef, createConstRef, createComputeRef, UNDEFINED_REFERENCE } from '@glimmer/reference';
4
- import { track, deprecateMutationsInTrackingTransaction, createUpdatableTag, untrack } from '@glimmer/validator';
4
+ import { track, createUpdatableTag, untrack } from '@glimmer/validator';
5
5
  import { registerDestructor, associateDestroyableChild } from '@glimmer/destroyable';
6
- import { setOwner } from '@glimmer/owner';
7
6
 
8
7
  const COMPONENT_MANAGERS = new WeakMap();
9
8
  const MODIFIER_MANAGERS = new WeakMap();
@@ -382,16 +381,11 @@ const CAPABILITIES = {
382
381
  hasSubOwner: false
383
382
  };
384
383
  function componentCapabilities(managerAPI, options = {}) {
385
- if (DEBUG && managerAPI !== '3.4' && managerAPI !== '3.13') {
384
+ if (DEBUG && managerAPI !== '3.13') {
386
385
  throw new Error('Invalid component manager compatibility specified');
387
386
  }
388
387
 
389
- let updateHook = true;
390
-
391
- if (managerAPI === '3.13') {
392
- updateHook = Boolean(options.updateHook);
393
- }
394
-
388
+ let updateHook = Boolean(options.updateHook);
395
389
  return buildCapabilities({
396
390
  asyncLifeCycleCallbacks: Boolean(options.asyncLifecycleCallbacks),
397
391
  destructor: Boolean(options.destructor),
@@ -456,7 +450,7 @@ class CustomComponentManager {
456
450
 
457
451
  if (DEBUG && !FROM_CAPABILITIES.has(delegate.capabilities)) {
458
452
  // TODO: This error message should make sense in both Ember and Glimmer https://github.com/glimmerjs/glimmer-vm/issues/1200
459
- throw new Error(`Custom component managers must have a \`capabilities\` property that is the result of calling the \`capabilities('3.4' | '3.13')\` (imported via \`import { capabilities } from '@ember/component';\`). Received: \`${JSON.stringify(delegate.capabilities)}\` for: \`${delegate}\``);
453
+ throw new Error(`Custom component managers must have a \`capabilities\` property that is the result of calling the \`capabilities('3.13')\` (imported via \`import { capabilities } from '@ember/component';\`). Received: \`${JSON.stringify(delegate.capabilities)}\` for: \`${delegate}\``);
460
454
  }
461
455
 
462
456
  componentManagerDelegates.set(owner, delegate);
@@ -468,16 +462,7 @@ class CustomComponentManager {
468
462
  create(owner, definition, vmArgs) {
469
463
  let delegate = this.getDelegateFor(owner);
470
464
  let args = argsProxyFor(vmArgs.capture(), 'component');
471
- let component;
472
-
473
- if (DEBUG && deprecateMutationsInTrackingTransaction !== undefined) {
474
- deprecateMutationsInTrackingTransaction(() => {
475
- component = delegate.createComponent(definition, args);
476
- });
477
- } else {
478
- component = delegate.createComponent(definition, args);
479
- }
480
-
465
+ let component = delegate.createComponent(definition, args);
481
466
  return new CustomComponentState(component, delegate, args);
482
467
  }
483
468
 
@@ -563,16 +548,12 @@ class CustomComponentState {
563
548
  }
564
549
 
565
550
  function modifierCapabilities(managerAPI, optionalFeatures = {}) {
566
- if (DEBUG && managerAPI !== '3.13' && managerAPI !== '3.22') {
551
+ if (DEBUG && managerAPI !== '3.22') {
567
552
  throw new Error('Invalid modifier manager compatibility specified');
568
553
  }
569
554
 
570
555
  return buildCapabilities({
571
- disableAutoTracking: Boolean(optionalFeatures.disableAutoTracking),
572
- useArgsProxy: managerAPI === '3.13' ? false : true,
573
- // This capability is used in Ember, exclusively in resolution mode. See the
574
- // Ember glimmer resolver for details.
575
- passFactoryToCreate: managerAPI === '3.13'
556
+ disableAutoTracking: Boolean(optionalFeatures.disableAutoTracking)
576
557
  });
577
558
  }
578
559
  /**
@@ -620,7 +601,7 @@ class CustomModifierManager {
620
601
 
621
602
  if (DEBUG && !FROM_CAPABILITIES.has(delegate.capabilities)) {
622
603
  // TODO: This error message should make sense in both Ember and Glimmer https://github.com/glimmerjs/glimmer-vm/issues/1200
623
- throw new Error(`Custom modifier managers must have a \`capabilities\` property that is the result of calling the \`capabilities('3.13' | '3.22')\` (imported via \`import { capabilities } from '@ember/modifier';\`). Received: \`${JSON.stringify(delegate.capabilities)}\` for: \`${delegate}\``);
604
+ throw new Error(`Custom modifier managers must have a \`capabilities\` property that is the result of calling the \`capabilities('3.22')\` (imported via \`import { capabilities } from '@ember/modifier';\`). Received: \`${JSON.stringify(delegate.capabilities)}\` for: \`${delegate}\``);
624
605
  }
625
606
 
626
607
  componentManagerDelegates.set(owner, delegate);
@@ -631,67 +612,23 @@ class CustomModifierManager {
631
612
 
632
613
  create(owner, element, definition, capturedArgs) {
633
614
  let delegate = this.getDelegateFor(owner);
634
- let {
635
- useArgsProxy,
636
- passFactoryToCreate
637
- } = delegate.capabilities;
638
- let argsProxy = argsProxyFor(capturedArgs, 'modifier');
639
- let args = useArgsProxy ? argsProxy : reifyArgs(capturedArgs);
640
- let instance;
641
- let factoryOrDefinition = definition;
642
-
643
- if (passFactoryToCreate) {
644
- // Make a fake factory. While not perfect, this should generally prevent
645
- // breakage in users of older modifier capabilities.
646
- factoryOrDefinition = {
647
- create(args) {
648
- let params = assign({}, args);
649
- setOwner(params, owner);
650
- return definition.create(args);
651
- },
652
-
653
- class: definition
654
- };
655
- }
656
-
657
- if (DEBUG && deprecateMutationsInTrackingTransaction !== undefined) {
658
- deprecateMutationsInTrackingTransaction(() => {
659
- instance = delegate.createModifier(factoryOrDefinition, args);
660
- });
661
- } else {
662
- instance = delegate.createModifier(factoryOrDefinition, args);
663
- }
664
-
615
+ let args = argsProxyFor(capturedArgs, 'modifier');
616
+ let instance = delegate.createModifier(definition, args);
665
617
  let tag = createUpdatableTag();
666
618
  let state;
667
-
668
- if (useArgsProxy) {
669
- state = {
670
- tag,
671
- element,
672
- delegate,
673
- args,
674
- modifier: instance
675
- };
676
- } else {
677
- state = {
678
- tag,
679
- element,
680
- modifier: instance,
681
- delegate,
682
-
683
- get args() {
684
- return reifyArgs(capturedArgs);
685
- }
686
-
687
- };
688
- }
619
+ state = {
620
+ tag,
621
+ element,
622
+ delegate,
623
+ args,
624
+ modifier: instance
625
+ };
689
626
 
690
627
  if (DEBUG) {
691
628
  state.debugName = typeof definition === 'function' ? definition.name : definition.toString();
692
629
  }
693
630
 
694
- registerDestructor(state, () => delegate.destroyModifier(instance, argsProxy));
631
+ registerDestructor(state, () => delegate.destroyModifier(instance, args));
695
632
  return state;
696
633
  }
697
634
 
@@ -745,22 +682,6 @@ class CustomModifierManager {
745
682
  }
746
683
 
747
684
  }
748
- function reifyArgs({
749
- named,
750
- positional
751
- }) {
752
- let reifiedNamed = dict();
753
-
754
- for (let key in named) {
755
- reifiedNamed[key] = valueForRef(named[key]);
756
- }
757
-
758
- let reifiedPositional = positional.map(valueForRef);
759
- return {
760
- named: reifiedNamed,
761
- positional: reifiedPositional
762
- };
763
- }
764
685
 
765
686
  function helperCapabilities(managerAPI, options = {}) {
766
687
  if (DEBUG && managerAPI !== '3.23') {