ember-source 4.0.0-beta.8 → 4.0.0-beta.9

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 (34) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/build-metadata.json +3 -3
  3. package/dist/dependencies/@glimmer/manager.js +19 -98
  4. package/dist/dependencies/@glimmer/opcode-compiler.js +9 -146
  5. package/dist/dependencies/@glimmer/runtime.js +1 -55
  6. package/dist/dependencies/@glimmer/validator.js +19 -51
  7. package/dist/ember-template-compiler.js +292 -276
  8. package/dist/ember-template-compiler.map +1 -1
  9. package/dist/ember-testing.js +1 -1
  10. package/dist/ember-testing.map +1 -1
  11. package/dist/ember.debug.js +3070 -5987
  12. package/dist/ember.debug.map +1 -1
  13. package/dist/header/license.js +1 -1
  14. package/dist/packages/@ember/-internals/environment/index.js +0 -15
  15. package/dist/packages/@ember/-internals/glimmer/index.js +4816 -6761
  16. package/dist/packages/@ember/-internals/metal/index.js +4 -14
  17. package/dist/packages/@ember/-internals/routing/lib/services/routing.js +1 -1
  18. package/dist/packages/@ember/-internals/routing/lib/system/route.js +1 -41
  19. package/dist/packages/@ember/-internals/routing/lib/system/router.js +13 -47
  20. package/dist/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +3 -43
  21. package/dist/packages/@ember/-internals/views/index.js +0 -1
  22. package/dist/packages/@ember/canary-features/index.js +0 -2
  23. package/dist/packages/@ember/component/index.js +1 -1
  24. package/dist/packages/@ember/deprecated-features/index.js +0 -1
  25. package/dist/packages/@ember/routing/index.js +1 -1
  26. package/dist/packages/ember/index.js +2 -48
  27. package/dist/packages/ember/version.js +1 -1
  28. package/docs/data.json +276 -1046
  29. package/package.json +15 -15
  30. package/dist/packages/@ember/-internals/views/lib/mixins/text_support.js +0 -345
  31. package/dist/packages/@ember/component/checkbox.js +0 -17
  32. package/dist/packages/@ember/component/text-area.js +0 -17
  33. package/dist/packages/@ember/component/text-field.js +0 -17
  34. package/dist/packages/@ember/routing/link-component.js +0 -17
@@ -4,7 +4,7 @@ import { assert, deprecate, debug, warn } from '@ember/debug';
4
4
  import { ENV, context } from '@ember/-internals/environment';
5
5
  import { schedule } from '@ember/runloop';
6
6
  import { registerDestructor, isDestroyed } from '@glimmer/destroyable';
7
- import { CURRENT_TAG, tagMetaFor, validateTag, valueForTag, CONSTANT_TAG, dirtyTagFor, tagFor, combine, createUpdatableTag, updateTag, ALLOW_CYCLES, consumeTag, track, untrack, deprecateMutationsInTrackingTransaction, isTracking, trackedData } from '@glimmer/validator';
7
+ import { CURRENT_TAG, tagMetaFor, validateTag, valueForTag, CONSTANT_TAG, dirtyTagFor, tagFor, combine, createUpdatableTag, updateTag, ALLOW_CYCLES, consumeTag, track, untrack, isTracking, trackedData } from '@glimmer/validator';
8
8
  export { createCache, getValue, isConst } from '@glimmer/validator';
9
9
  import { DEBUG } from '@glimmer/env';
10
10
  import { getCustomTagFor } from '@glimmer/manager';
@@ -1842,13 +1842,7 @@ function _getProp(obj, keyName) {
1842
1842
  }
1843
1843
 
1844
1844
  if (value === undefined && isObject$$1 && !(keyName in obj) && typeof obj.unknownProperty === 'function') {
1845
- if (DEBUG) {
1846
- deprecateMutationsInTrackingTransaction(() => {
1847
- value = obj.unknownProperty(keyName);
1848
- });
1849
- } else {
1850
- value = obj.unknownProperty(keyName);
1851
- }
1845
+ value = obj.unknownProperty(keyName);
1852
1846
  }
1853
1847
 
1854
1848
  if (isTracking()) {
@@ -3115,9 +3109,7 @@ class Mixin {
3115
3109
 
3116
3110
  guidFor(this);
3117
3111
 
3118
- if (true
3119
- /* EMBER_MODERNIZED_BUILT_IN_COMPONENTS */
3120
- && Mixin._disableDebugSeal !== true) {
3112
+ if (Mixin._disableDebugSeal !== true) {
3121
3113
  Object.seal(this);
3122
3114
  }
3123
3115
  }
@@ -3240,9 +3232,7 @@ class Mixin {
3240
3232
 
3241
3233
  }
3242
3234
 
3243
- if (DEBUG && true
3244
- /* EMBER_MODERNIZED_BUILT_IN_COMPONENTS */
3245
- ) {
3235
+ if (DEBUG) {
3246
3236
  Object.defineProperty(Mixin, '_disableDebugSeal', {
3247
3237
  configurable: true,
3248
3238
  enumerable: false,
@@ -7,7 +7,7 @@ import { readOnly } from '@ember/object/computed';
7
7
  import Service from '@ember/service';
8
8
  const ROUTER = symbol('ROUTER');
9
9
  /**
10
- The Routing service is used by LinkComponent, and provides facilities for
10
+ The Routing service is used by LinkTo, and provides facilities for
11
11
  the component/view layer to interact with the router.
12
12
 
13
13
  This is a private service for internal usage only. For public usage,
@@ -11,8 +11,7 @@ import { addObserver, computed, defineProperty, descriptorForProperty, flushAsyn
11
11
  import { getOwner } from '@ember/-internals/owner';
12
12
  import { A as emberA, ActionHandler, Evented, Object as EmberObject, typeOf } from '@ember/-internals/runtime';
13
13
  import { isProxy, lookupDescriptor, symbol } from '@ember/-internals/utils';
14
- import { assert, deprecate, info, isTesting } from '@ember/debug';
15
- import { ROUTER_EVENTS } from '@ember/deprecated-features';
14
+ import { assert, info, isTesting } from '@ember/debug';
16
15
  import { dependentKeyCompat } from '@ember/object/compat';
17
16
  import { once } from '@ember/runloop';
18
17
  import { classify } from '@ember/string';
@@ -1945,43 +1944,4 @@ Route.reopen({
1945
1944
 
1946
1945
  }
1947
1946
  });
1948
- export let ROUTER_EVENT_DEPRECATIONS;
1949
-
1950
- if (ROUTER_EVENTS) {
1951
- ROUTER_EVENT_DEPRECATIONS = {
1952
- on(name) {
1953
- this._super(...arguments);
1954
-
1955
- let hasDidTransition = name === 'didTransition';
1956
- let hasWillTransition = name === 'willTransition';
1957
-
1958
- if (hasDidTransition) {
1959
- deprecate('You attempted to listen to the "didTransition" event which is deprecated. Please inject the router service and listen to the "routeDidChange" event.', false, {
1960
- id: 'deprecate-router-events',
1961
- until: '4.0.0',
1962
- url: 'https://deprecations.emberjs.com/v3.x#toc_deprecate-router-events',
1963
- for: 'ember-source',
1964
- since: {
1965
- enabled: '3.11.0'
1966
- }
1967
- });
1968
- }
1969
-
1970
- if (hasWillTransition) {
1971
- deprecate('You attempted to listen to the "willTransition" event which is deprecated. Please inject the router service and listen to the "routeWillChange" event.', false, {
1972
- id: 'deprecate-router-events',
1973
- until: '4.0.0',
1974
- url: 'https://deprecations.emberjs.com/v3.x#toc_deprecate-router-events',
1975
- for: 'ember-source',
1976
- since: {
1977
- enabled: '3.11.0'
1978
- }
1979
- });
1980
- }
1981
- }
1982
-
1983
- };
1984
- Route.reopen(ROUTER_EVENT_DEPRECATIONS);
1985
- }
1986
-
1987
1947
  export default Route;
@@ -2,15 +2,14 @@ import { privatize as P } from '@ember/-internals/container';
2
2
  import { computed, get, set } from '@ember/-internals/metal';
3
3
  import { getOwner } from '@ember/-internals/owner';
4
4
  import { A as emberA, Evented, Object as EmberObject, typeOf } from '@ember/-internals/runtime';
5
- import { assert, deprecate, info } from '@ember/debug';
6
- import { ROUTER_EVENTS } from '@ember/deprecated-features';
5
+ import { assert, info } from '@ember/debug';
7
6
  import EmberError from '@ember/error';
8
7
  import { cancel, once, run, scheduleOnce } from '@ember/runloop';
9
8
  import { DEBUG } from '@glimmer/env';
10
9
  import EmberLocation from '../location/api';
11
10
  import { calculateCacheKey, extractRouteArgs, getActiveTargetName, resemblesURL } from '../utils';
12
11
  import DSL from './dsl';
13
- import { defaultSerialize, getFullQueryParams, hasDefaultSerialize, ROUTE_CONNECTIONS, ROUTER_EVENT_DEPRECATIONS } from './route';
12
+ import { defaultSerialize, getFullQueryParams, hasDefaultSerialize, ROUTE_CONNECTIONS } from './route';
14
13
  import RouterState from './router_state';
15
14
  import Router, { logAbort, STATE_SYMBOL } from 'router_js';
16
15
 
@@ -20,10 +19,7 @@ function defaultDidTransition(infos) {
20
19
  this._cancelSlowTransitionTimer();
21
20
 
22
21
  this.notifyPropertyChange('url');
23
- this.set('currentState', this.targetState); // Put this in the runloop so url will be accurate. Seems
24
- // less surprising than didTransition being out of sync.
25
-
26
- once(this, this.trigger, 'didTransition');
22
+ this.set('currentState', this.targetState);
27
23
 
28
24
  if (DEBUG) {
29
25
  // @ts-expect-error namespace isn't public
@@ -34,9 +30,7 @@ function defaultDidTransition(infos) {
34
30
  }
35
31
  }
36
32
 
37
- function defaultWillTransition(oldInfos, newInfos, transition) {
38
- once(this, this.trigger, 'willTransition', transition);
39
-
33
+ function defaultWillTransition(oldInfos, newInfos) {
40
34
  if (DEBUG) {
41
35
  // @ts-expect-error namespace isn't public
42
36
  if (this.namespace.LOG_TRANSITIONS) {
@@ -256,42 +250,18 @@ class EmberRouter extends EmberObject.extend(Evented) {
256
250
  location.setURL(path);
257
251
  set(router, 'currentURL', path);
258
252
  });
259
- }
253
+ } // TODO: merge into routeDidChange
260
254
 
261
- didTransition(infos) {
262
- if (ROUTER_EVENTS) {
263
- if (router.didTransition !== defaultDidTransition) {
264
- deprecate('You attempted to override the "didTransition" method which is deprecated. Please inject the router service and listen to the "routeDidChange" event.', false, {
265
- id: 'deprecate-router-events',
266
- until: '4.0.0',
267
- url: 'https://deprecations.emberjs.com/v3.x#toc_deprecate-router-events',
268
- for: 'ember-source',
269
- since: {
270
- enabled: '3.11.0'
271
- }
272
- });
273
- }
274
- }
275
255
 
256
+ didTransition(infos) {
257
+ assert('You attempted to override the "didTransition" method which has been deprecated. Please inject the router service and listen to the "routeDidChange" event.', router.didTransition === defaultDidTransition);
276
258
  router.didTransition(infos);
277
- }
259
+ } // TODO: merge into routeWillChange
278
260
 
279
- willTransition(oldInfos, newInfos, transition) {
280
- if (ROUTER_EVENTS) {
281
- if (router.willTransition !== defaultWillTransition) {
282
- deprecate('You attempted to override the "willTransition" method which is deprecated. Please inject the router service and listen to the "routeWillChange" event.', false, {
283
- id: 'deprecate-router-events',
284
- until: '4.0.0',
285
- url: 'https://deprecations.emberjs.com/v3.x#toc_deprecate-router-events',
286
- for: 'ember-source',
287
- since: {
288
- enabled: '3.11.0'
289
- }
290
- });
291
- }
292
- }
293
261
 
294
- router.willTransition(oldInfos, newInfos, transition);
262
+ willTransition(oldInfos, newInfos) {
263
+ assert('You attempted to override the "willTransition" method which has been deprecated. Please inject the router service and listen to the "routeWillChange" event.', router.willTransition === defaultWillTransition);
264
+ router.willTransition(oldInfos, newInfos);
295
265
  }
296
266
 
297
267
  triggerEvent(routeInfos, ignoreFailure, name, args) {
@@ -1415,7 +1385,8 @@ export function triggerEvent(routeInfos, ignoreFailure, name, args) {
1415
1385
  if (!routeInfos) {
1416
1386
  if (ignoreFailure) {
1417
1387
  return;
1418
- }
1388
+ } // TODO: update?
1389
+
1419
1390
 
1420
1391
  throw new EmberError(`Can't trigger action '${name}' because your app hasn't finished transitioning into its first route. To trigger an action on destination routes during a transition, you can call \`.send()\` on the \`Transition\` object passed to the \`model/beforeModel/afterModel\` hooks.`);
1421
1392
  }
@@ -1624,9 +1595,4 @@ EmberRouter.reopen({
1624
1595
  return location.getURL();
1625
1596
  })
1626
1597
  });
1627
-
1628
- if (ROUTER_EVENTS) {
1629
- EmberRouter.reopen(ROUTER_EVENT_DEPRECATIONS);
1630
- }
1631
-
1632
1598
  export default EmberRouter;
@@ -3,14 +3,8 @@
3
3
  */
4
4
  import { context } from '@ember/-internals/environment';
5
5
  import { get, Mixin, computed } from '@ember/-internals/metal';
6
- import { assert, deprecate } from '@ember/debug';
6
+ import { assert } from '@ember/debug';
7
7
  import { DEBUG } from '@glimmer/env';
8
-
9
- if (DEBUG && true
10
- /* EMBER_MODERNIZED_BUILT_IN_COMPONENTS */
11
- ) {
12
- Mixin._disableDebugSeal = true;
13
- }
14
8
  /**
15
9
  `Ember.TargetActionSupport` is a mixin that can be included in a class
16
10
  to add a `triggerAction` method with semantics similar to the Handlebars
@@ -24,7 +18,6 @@ doing more complex event handling in Components.
24
18
  @private
25
19
  */
26
20
 
27
-
28
21
  const TargetActionSupport = Mixin.create({
29
22
  target: null,
30
23
  action: null,
@@ -151,41 +144,8 @@ function getTarget(instance) {
151
144
  return null;
152
145
  }
153
146
 
154
- if (true
155
- /* EMBER_MODERNIZED_BUILT_IN_COMPONENTS */
156
- ) {
157
- Object.defineProperty(TargetActionSupport, '_wasReopened', {
158
- configurable: true,
159
- enumerable: false,
160
- writable: true,
161
- value: false
162
- });
163
- Object.defineProperty(TargetActionSupport, 'reopen', {
164
- configurable: true,
165
- enumerable: false,
166
- writable: true,
167
- value: function reopen(...args) {
168
- if (this === TargetActionSupport) {
169
- deprecate('Reopening Ember.TargetActionSupport is deprecated.', false, {
170
- id: 'ember.built-in-components.reopen',
171
- for: 'ember-source',
172
- since: {
173
- enabled: '3.27.0'
174
- },
175
- until: '4.0.0',
176
- url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-reopen'
177
- });
178
- TargetActionSupport._wasReopened = true;
179
- }
180
-
181
- return Mixin.prototype.reopen.call(this, ...args);
182
- }
183
- });
184
-
185
- if (DEBUG) {
186
- Object.seal(TargetActionSupport);
187
- Mixin._disableDebugSeal = false;
188
- }
147
+ if (DEBUG) {
148
+ Object.seal(TargetActionSupport);
189
149
  }
190
150
 
191
151
  export default TargetActionSupport;
@@ -1,7 +1,6 @@
1
1
  export { addChildView, isSimpleClick, getViewBounds, getViewClientRects, getViewBoundingClientRect, getRootViews, getChildViews, getViewId, getElementView, getViewElement, setElementView, setViewElement, clearElementView, clearViewElement, constructStyleDeprecationMessage } from './lib/system/utils';
2
2
  export { default as EventDispatcher } from './lib/system/event_dispatcher';
3
3
  export { default as ComponentLookup } from './lib/component_lookup';
4
- export { default as TextSupport } from './lib/mixins/text_support';
5
4
  export { default as CoreView } from './lib/views/core_view';
6
5
  export { default as ClassNamesSupport } from './lib/mixins/class_names_support';
7
6
  export { default as ChildViewsSupport } from './lib/mixins/child_views_support';
@@ -16,7 +16,6 @@ export const DEFAULT_FEATURES = {
16
16
  EMBER_NAMED_BLOCKS: true,
17
17
  EMBER_GLIMMER_HELPER_MANAGER: true,
18
18
  EMBER_GLIMMER_INVOKE_HELPER: true,
19
- EMBER_MODERNIZED_BUILT_IN_COMPONENTS: true,
20
19
  EMBER_STRICT_MODE: true,
21
20
  EMBER_DYNAMIC_HELPERS_AND_MODIFIERS: true,
22
21
  EMBER_ROUTING_ROUTER_SERVICE_REFRESH: false
@@ -73,7 +72,6 @@ export const EMBER_IMPROVED_INSTRUMENTATION = featureValue(FEATURES.EMBER_IMPROV
73
72
  export const EMBER_NAMED_BLOCKS = featureValue(FEATURES.EMBER_NAMED_BLOCKS);
74
73
  export const EMBER_GLIMMER_HELPER_MANAGER = featureValue(FEATURES.EMBER_GLIMMER_HELPER_MANAGER);
75
74
  export const EMBER_GLIMMER_INVOKE_HELPER = featureValue(FEATURES.EMBER_GLIMMER_INVOKE_HELPER);
76
- export const EMBER_MODERNIZED_BUILT_IN_COMPONENTS = featureValue(FEATURES.EMBER_MODERNIZED_BUILT_IN_COMPONENTS);
77
75
  export const EMBER_STRICT_MODE = featureValue(FEATURES.EMBER_STRICT_MODE);
78
76
  export const EMBER_DYNAMIC_HELPERS_AND_MODIFIERS = featureValue(FEATURES.EMBER_DYNAMIC_HELPERS_AND_MODIFIERS);
79
77
  export const EMBER_ROUTING_ROUTER_SERVICE_REFRESH = featureValue(FEATURES.EMBER_ROUTING_ROUTER_SERVICE_REFRESH);
@@ -1,3 +1,3 @@
1
1
  export { setComponentTemplate, getComponentTemplate } from '@glimmer/manager';
2
- export { Component as default, Input } from '@ember/-internals/glimmer';
2
+ export { Component as default, Input, Textarea } from '@ember/-internals/glimmer';
3
3
  export { componentCapabilities as capabilities, setComponentManager } from '@ember/-internals/glimmer';
@@ -1,5 +1,4 @@
1
1
  /* eslint-disable no-implicit-coercion */
2
2
  // These versions should be the version that the deprecation was _introduced_,
3
3
  // not the version that the feature will be removed.
4
- export const ROUTER_EVENTS = !!'4.0.0';
5
4
  export const ASSIGN = !!'4.0.0-beta.1';
@@ -1 +1 @@
1
- export { LinkComponent as LinkTo } from '@ember/-internals/glimmer';
1
+ export { LinkTo } from '@ember/-internals/glimmer';
@@ -15,8 +15,8 @@ import { _getStrings, _setStrings, dasherize, camelize, capitalize, classify, de
15
15
  import Service, { inject as injectService } from '@ember/service';
16
16
  import { action, computed } from '@ember/object';
17
17
  import { dependentKeyCompat } from '@ember/object/compat';
18
- import { Object as EmberObject, RegistryProxyMixin, ContainerProxyMixin, compare, isEqual, Array as EmberArray, MutableEnumerable, MutableArray, TargetActionSupport, Evented, PromiseProxyMixin, Observable, typeOf, isArray, _ProxyMixin, RSVP, Comparable, Namespace, Enumerable, ArrayProxy, ObjectProxy, ActionHandler, CoreObject, NativeArray, A } from '@ember/-internals/runtime';
19
- import { Checkbox, Component, componentCapabilities, modifierCapabilities, setComponentManager, escapeExpression, getTemplates, Helper, helper, htmlSafe, isHTMLSafe, LinkComponent, setTemplates, template, TextField, TextArea, Input, isSerializationFirstNode } from '@ember/-internals/glimmer'; // eslint-disable-next-line import/no-unresolved
18
+ import { Object as EmberObject, RegistryProxyMixin, ContainerProxyMixin, compare, isEqual, Array as EmberArray, MutableEnumerable, MutableArray, Evented, PromiseProxyMixin, Observable, typeOf, isArray, _ProxyMixin, RSVP, Comparable, Namespace, Enumerable, ArrayProxy, ObjectProxy, ActionHandler, CoreObject, NativeArray, A } from '@ember/-internals/runtime';
19
+ import { Component, componentCapabilities, modifierCapabilities, setComponentManager, escapeExpression, getTemplates, Helper, helper, htmlSafe, isHTMLSafe, setTemplates, template, Input, isSerializationFirstNode } from '@ember/-internals/glimmer'; // eslint-disable-next-line import/no-unresolved
20
20
 
21
21
  import VERSION from './version';
22
22
  import * as views from '@ember/-internals/views';
@@ -300,52 +300,6 @@ Object.defineProperty(Ember, 'BOOTED', {
300
300
  Ember.Component = Component;
301
301
  Helper.helper = helper;
302
302
  Ember.Helper = Helper;
303
-
304
- if (true
305
- /* EMBER_MODERNIZED_BUILT_IN_COMPONENTS */
306
- ) {
307
- [['Checkbox', '@ember/component/checkbox', Checkbox, true], ['TextField', '@ember/component/text-field', TextField, true], ['TextArea', '@ember/component/text-area', TextArea, true], ['LinkComponent', '@ember/routing/link-component', LinkComponent, true], ['TextSupport', null, views.TextSupport, false], ['TargetActionSupport', null, TargetActionSupport, false]].forEach(([name, path, value, availableInLegacyAddon]) => {
308
- Object.defineProperty(Ember, name, {
309
- get() {
310
- let message = `Using Ember.${name}`;
311
-
312
- if (path !== null) {
313
- message += ` or importing from '${path}'`;
314
- }
315
-
316
- message += ` is deprecated.`;
317
-
318
- if (availableInLegacyAddon) {
319
- message += ` Install the \`@ember/legacy-built-in-components\` addon and use ` + `\`import { ${name} } from '@ember/legacy-built-in-components';\` instead.`;
320
- }
321
-
322
- deprecate(message, false, {
323
- id: 'ember.built-in-components.import',
324
- until: '4.0.0',
325
- for: 'ember-source',
326
- since: {
327
- enabled: '3.27.0'
328
- },
329
- url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-import'
330
- });
331
- return value;
332
- },
333
-
334
- configurable: true,
335
- enumerable: true
336
- }); // Expose a non-deprecated version for tests and the @ember/legacy-built-in-components addon
337
-
338
- Ember[`_Legacy${name}`] = value;
339
- });
340
- } else {
341
- Ember.Checkbox = Checkbox;
342
- Ember.TextField = TextField;
343
- Ember.TextArea = TextArea;
344
- Ember.LinkComponent = LinkComponent;
345
- Ember.TextSupport = views.TextSupport;
346
- Ember.TargetActionSupport = TargetActionSupport;
347
- }
348
-
349
303
  Ember._setComponentManager = setComponentManager;
350
304
  Ember._componentManagerCapabilities = componentCapabilities;
351
305
  Ember._setModifierManager = setModifierManager;
@@ -1 +1 @@
1
- export default "4.0.0-beta.8";
1
+ export default "4.0.0-beta.9";