ember-source 4.4.0-alpha.3 → 4.4.0-alpha.4

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 (39) hide show
  1. package/CHANGELOG.md +5 -1
  2. package/blueprints/acceptance-test/mocha-rfc-232-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/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js +2 -2
  5. package/blueprints/component-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js +2 -2
  6. package/blueprints/controller-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js +1 -1
  7. package/blueprints/controller-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js +1 -1
  8. package/blueprints/helper-test/mocha-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js +1 -1
  9. package/blueprints/helper-test/qunit-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js +1 -1
  10. package/blueprints/route-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js +1 -1
  11. package/blueprints/route-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js +1 -1
  12. package/blueprints/service-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js +1 -1
  13. package/blueprints/service-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js +1 -1
  14. package/build-metadata.json +3 -3
  15. package/dist/ember-template-compiler.js +7 -3
  16. package/dist/ember-template-compiler.map +1 -1
  17. package/dist/ember-testing.js +2 -2
  18. package/dist/ember-testing.map +1 -1
  19. package/dist/ember.debug.js +298 -957
  20. package/dist/ember.debug.map +1 -1
  21. package/dist/header/license.js +1 -1
  22. package/dist/packages/@ember/-internals/container/index.js +0 -16
  23. package/dist/packages/@ember/-internals/extension-support/lib/container_debug_adapter.js +10 -19
  24. package/dist/packages/@ember/-internals/extension-support/lib/data_adapter.js +113 -112
  25. package/dist/packages/@ember/-internals/glimmer/index.js +112 -748
  26. package/dist/packages/@ember/-internals/metal/index.js +1 -4
  27. package/dist/packages/@ember/-internals/routing/lib/system/router.js +1 -1
  28. package/dist/packages/@ember/-internals/runtime/lib/ext/rsvp.js +8 -4
  29. package/dist/packages/@ember/-internals/runtime/lib/mixins/-proxy.js +1 -1
  30. package/dist/packages/@ember/-internals/runtime/lib/mixins/array.js +1 -1
  31. package/dist/packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js +16 -16
  32. package/dist/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +8 -8
  33. package/dist/packages/@ember/-internals/views/lib/system/utils.js +4 -2
  34. package/dist/packages/@ember/-internals/views/lib/views/core_view.js +5 -22
  35. package/dist/packages/@ember/debug/index.js +1 -1
  36. package/dist/packages/@ember/renderer/index.js +21 -0
  37. package/dist/packages/ember/version.js +1 -1
  38. package/docs/data.json +400 -210
  39. package/package.json +9 -9
@@ -1755,9 +1755,6 @@ function isPath(path) {
1755
1755
  return typeof path === 'string' && firstDotIndexCache.get(path) !== -1;
1756
1756
  }
1757
1757
 
1758
- /**
1759
- @module @ember/object
1760
- */
1761
1758
  const PROXY_CONTENT = symbol('PROXY_CONTENT');
1762
1759
  let getPossibleMandatoryProxyValue;
1763
1760
 
@@ -2759,7 +2756,7 @@ function mergeMixins(mixins, meta$$1, descs, values, base, keys, keysWithSuper)
2759
2756
  } else if (mixins !== undefined) {
2760
2757
  mergeMixins(mixins, meta$$1, descs, values, base, keys, keysWithSuper);
2761
2758
 
2762
- if (currentMixin._without !== undefined) {
2759
+ if (currentMixin instanceof Mixin && currentMixin._without !== undefined) {
2763
2760
  currentMixin._without.forEach(keyName => {
2764
2761
  // deleting the key means we won't process the value
2765
2762
  let index = keys.indexOf(keyName);
@@ -1629,7 +1629,7 @@ function representEmptyRoute(liveRoutes, defaultParentState, {
1629
1629
  // Create an entry to represent our default template name,
1630
1630
  // just so other routes can target it and inherit its place
1631
1631
  // in the outlet hierarchy.
1632
- defaultParentState.outlets.main = {
1632
+ defaultParentState.outlets['main'] = {
1633
1633
  render: {
1634
1634
  name: routeName,
1635
1635
  outlet: 'main'
@@ -25,13 +25,17 @@ export function onerrorDefault(reason) {
25
25
 
26
26
  function errorFor(reason) {
27
27
  if (!reason) return;
28
+ let withErrorThrown = reason;
28
29
 
29
- if (reason.errorThrown) {
30
- return unwrapErrorThrown(reason);
30
+ if (withErrorThrown.errorThrown) {
31
+ return unwrapErrorThrown(withErrorThrown);
31
32
  }
32
33
 
33
- if (reason.name === 'UnrecognizedURLError') {
34
- assert(`The URL '${reason.message}' did not match any routes in your application`, false);
34
+ let withName = reason;
35
+
36
+ if (withName.name === 'UnrecognizedURLError') {
37
+ assert(`The URL '${withName.message}' did not match any routes in your application`, false); // @ts-expect-error We'll hit this if the assert is stripped
38
+
35
39
  return;
36
40
  }
37
41
 
@@ -53,7 +53,7 @@ function customTagForProxy(proxy, key, addMandatorySetter) {
53
53
  export default Mixin.create({
54
54
  /**
55
55
  The object whose properties will be forwarded.
56
- @property content
56
+ @property content
57
57
  @type {unknown}
58
58
  @default null
59
59
  @public
@@ -1351,7 +1351,7 @@ const MutableArray = Mixin.create(ArrayMixin, MutableEnumerable, {
1351
1351
  colors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
1352
1352
  ```
1353
1353
  @method unshiftObjects
1354
- @param {Enumberable} objects the objects to add
1354
+ @param {Enumerable} objects the objects to add
1355
1355
  @return {EmberArray} receiver
1356
1356
  @public
1357
1357
  */
@@ -98,7 +98,7 @@ export default Mixin.create({
98
98
  /**
99
99
  If the proxied promise is rejected this will contain the reason
100
100
  provided.
101
- @property reason
101
+ @property reason
102
102
  @default null
103
103
  @public
104
104
  */
@@ -106,7 +106,7 @@ export default Mixin.create({
106
106
 
107
107
  /**
108
108
  Once the proxied promise has settled this will become `false`.
109
- @property isPending
109
+ @property isPending
110
110
  @default true
111
111
  @public
112
112
  */
@@ -116,7 +116,7 @@ export default Mixin.create({
116
116
 
117
117
  /**
118
118
  Once the proxied promise has settled this will become `true`.
119
- @property isSettled
119
+ @property isSettled
120
120
  @default false
121
121
  @public
122
122
  */
@@ -126,7 +126,7 @@ export default Mixin.create({
126
126
 
127
127
  /**
128
128
  Will become `true` if the proxied promise is rejected.
129
- @property isRejected
129
+ @property isRejected
130
130
  @default false
131
131
  @public
132
132
  */
@@ -134,7 +134,7 @@ export default Mixin.create({
134
134
 
135
135
  /**
136
136
  Will become `true` if the proxied promise is fulfilled.
137
- @property isFulfilled
137
+ @property isFulfilled
138
138
  @default false
139
139
  @public
140
140
  */
@@ -142,17 +142,17 @@ export default Mixin.create({
142
142
 
143
143
  /**
144
144
  The promise whose fulfillment value is being proxied by this object.
145
- This property must be specified upon creation, and should not be
145
+ This property must be specified upon creation, and should not be
146
146
  changed once created.
147
- Example:
148
- ```javascript
147
+ Example:
148
+ ```javascript
149
149
  import ObjectProxy from '@ember/object/proxy';
150
150
  import PromiseProxyMixin from '@ember/object/promise-proxy-mixin';
151
- ObjectProxy.extend(PromiseProxyMixin).create({
151
+ ObjectProxy.extend(PromiseProxyMixin).create({
152
152
  promise: <thenable>
153
153
  });
154
154
  ```
155
- @property promise
155
+ @property promise
156
156
  @public
157
157
  */
158
158
  promise: computed({
@@ -168,8 +168,8 @@ export default Mixin.create({
168
168
 
169
169
  /**
170
170
  An alias to the proxied promise's `then`.
171
- See RSVP.Promise.then.
172
- @method then
171
+ See RSVP.Promise.then.
172
+ @method then
173
173
  @param {Function} callback
174
174
  @return {RSVP.Promise}
175
175
  @public
@@ -178,8 +178,8 @@ export default Mixin.create({
178
178
 
179
179
  /**
180
180
  An alias to the proxied promise's `catch`.
181
- See RSVP.Promise.catch.
182
- @method catch
181
+ See RSVP.Promise.catch.
182
+ @method catch
183
183
  @param {Function} callback
184
184
  @return {RSVP.Promise}
185
185
  @since 1.3.0
@@ -189,8 +189,8 @@ export default Mixin.create({
189
189
 
190
190
  /**
191
191
  An alias to the proxied promise's `finally`.
192
- See RSVP.Promise.finally.
193
- @method finally
192
+ See RSVP.Promise.finally.
193
+ @method finally
194
194
  @param {Function} callback
195
195
  @return {RSVP.Promise}
196
196
  @since 1.3.0
@@ -41,9 +41,9 @@ const TargetActionSupport = Mixin.create({
41
41
  /**
42
42
  Send an `action` with an `actionContext` to a `target`. The action, actionContext
43
43
  and target will be retrieved from properties of the object. For example:
44
- ```javascript
44
+ ```javascript
45
45
  import { alias } from '@ember/object/computed';
46
- App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {
46
+ App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {
47
47
  target: alias('controller'),
48
48
  action: 'save',
49
49
  actionContext: alias('context'),
@@ -53,9 +53,9 @@ const TargetActionSupport = Mixin.create({
53
53
  }
54
54
  });
55
55
  ```
56
- The `target`, `action`, and `actionContext` can be provided as properties of
56
+ The `target`, `action`, and `actionContext` can be provided as properties of
57
57
  an optional object argument to `triggerAction` as well.
58
- ```javascript
58
+ ```javascript
59
59
  App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {
60
60
  click() {
61
61
  this.triggerAction({
@@ -67,12 +67,12 @@ const TargetActionSupport = Mixin.create({
67
67
  }
68
68
  });
69
69
  ```
70
- The `actionContext` defaults to the object you are mixing `TargetActionSupport` into.
70
+ The `actionContext` defaults to the object you are mixing `TargetActionSupport` into.
71
71
  But `target` and `action` must be specified either as properties or with the argument
72
72
  to `triggerAction`, or a combination:
73
- ```javascript
73
+ ```javascript
74
74
  import { alias } from '@ember/object/computed';
75
- App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {
75
+ App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {
76
76
  target: alias('controller'),
77
77
  click() {
78
78
  this.triggerAction({
@@ -82,7 +82,7 @@ const TargetActionSupport = Mixin.create({
82
82
  }
83
83
  });
84
84
  ```
85
- @method triggerAction
85
+ @method triggerAction
86
86
  @param opts {Object} (optional, with the optional keys action, target and/or actionContext)
87
87
  @return {Boolean} true if the action was sent successfully and did not return false
88
88
  @private
@@ -1,6 +1,4 @@
1
1
  import { getOwner } from '@ember/-internals/owner';
2
- /* globals Element */
3
-
4
2
  import { guidFor } from '@ember/-internals/utils';
5
3
  import { assert } from '@ember/debug';
6
4
  /**
@@ -8,6 +6,10 @@ import { assert } from '@ember/debug';
8
6
  */
9
7
 
10
8
  export function isSimpleClick(event) {
9
+ if (!(event instanceof MouseEvent)) {
10
+ return false;
11
+ }
12
+
11
13
  let modifier = event.shiftKey || event.metaKey || event.altKey || event.ctrlKey;
12
14
  let secondaryClick = event.which > 1; // IE9 may return undefined
13
15
 
@@ -1,23 +1,6 @@
1
1
  import { inject } from '@ember/-internals/metal';
2
2
  import { ActionHandler, Evented, FrameworkObject } from '@ember/-internals/runtime';
3
3
  import states from './states';
4
- /**
5
- `Ember.CoreView` is an abstract class that exists to give view-like behavior
6
- to both Ember's main view class `Component` and other classes that don't need
7
- the full functionality of `Component`.
8
-
9
- Unless you have specific needs for `CoreView`, you will use `Component`
10
- in your applications.
11
-
12
- @class CoreView
13
- @namespace Ember
14
- @extends EmberObject
15
- @deprecated Use `Component` instead.
16
- @uses Evented
17
- @uses Ember.ActionHandler
18
- @private
19
- */
20
-
21
4
  const CoreView = FrameworkObject.extend(Evented, ActionHandler, {
22
5
  isView: true,
23
6
  _states: states,
@@ -34,7 +17,7 @@ const CoreView = FrameworkObject.extend(Evented, ActionHandler, {
34
17
  /**
35
18
  If the view is currently inserted into the DOM of a parent view, this
36
19
  property will point to the parent of the view.
37
- @property parentView
20
+ @property parentView
38
21
  @type Ember.View
39
22
  @default null
40
23
  @private
@@ -42,16 +25,16 @@ const CoreView = FrameworkObject.extend(Evented, ActionHandler, {
42
25
  parentView: null,
43
26
 
44
27
  instrumentDetails(hash) {
45
- hash.object = this.toString();
46
- hash.containerKey = this._debugContainerKey;
47
- hash.view = this;
28
+ hash['object'] = this.toString();
29
+ hash['containerKey'] = this._debugContainerKey;
30
+ hash['view'] = this;
48
31
  return hash;
49
32
  },
50
33
 
51
34
  /**
52
35
  Override the default event firing from `Evented` to
53
36
  also call methods with the given name.
54
- @method trigger
37
+ @method trigger
55
38
  @param name {String}
56
39
  @private
57
40
  */
@@ -260,7 +260,7 @@ let _warnIfUsingStrippedFeatureFlags;
260
260
  if (DEBUG && !isTesting()) {
261
261
  if (typeof window !== 'undefined' && (isFirefox || isChrome) && window.addEventListener) {
262
262
  window.addEventListener('load', () => {
263
- if (document.documentElement && document.documentElement.dataset && !document.documentElement.dataset.emberExtension) {
263
+ if (document.documentElement && document.documentElement.dataset && !document.documentElement.dataset['emberExtension']) {
264
264
  let downloadURL;
265
265
 
266
266
  if (isChrome) {
@@ -0,0 +1,21 @@
1
+ /**
2
+ @module @ember/renderer
3
+ @public
4
+ */
5
+
6
+ /**
7
+ * @class Renderer
8
+ * @public
9
+ */
10
+
11
+ /**
12
+ Returns a promise which will resolve when rendering has settled. Settled in
13
+ this context is defined as when all of the tags in use are "current" (e.g.
14
+ `renderers.every(r => r._isValid())`). When this is checked at the _end_ of
15
+ the run loop, this essentially guarantees that all rendering is completed.
16
+
17
+ @method renderSettled
18
+ @return {Promise<void>} a promise which fulfills when rendering has settled
19
+ @public
20
+ */
21
+ export { renderSettled } from '@ember/-internals/glimmer';
@@ -1 +1 @@
1
- export default "4.4.0-alpha.3";
1
+ export default "4.4.0-alpha.4";