ember-source 4.6.0-alpha.6 → 4.7.0-alpha.2

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 (62) hide show
  1. package/CHANGELOG.md +11 -7
  2. package/blueprints/-utils.js +9 -0
  3. package/blueprints/acceptance-test/index.js +3 -1
  4. package/blueprints/acceptance-test/mocha-rfc-232-files/tests/acceptance/__name__-test.ts +1 -1
  5. package/blueprints/acceptance-test/qunit-rfc-232-files/tests/acceptance/__name__-test.ts +1 -1
  6. package/blueprints/component-test/index.js +2 -0
  7. package/blueprints/component-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.ts +2 -2
  8. package/blueprints/component-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.ts +2 -2
  9. package/blueprints/controller-test/index.js +2 -0
  10. package/blueprints/controller-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.ts +1 -1
  11. package/blueprints/controller-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.ts +1 -1
  12. package/blueprints/helper-test/index.js +2 -3
  13. package/blueprints/helper-test/mocha-rfc-232-files/__root__/__testType__/__collection__/__name__-test.ts +1 -1
  14. package/blueprints/helper-test/qunit-rfc-232-files/__root__/__testType__/__collection__/__name__-test.ts +1 -1
  15. package/blueprints/initializer-test/index.js +2 -3
  16. package/blueprints/instance-initializer-test/index.js +2 -4
  17. package/blueprints/route-test/index.js +2 -0
  18. package/blueprints/route-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.ts +1 -1
  19. package/blueprints/route-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.ts +1 -1
  20. package/blueprints/service-test/index.js +2 -0
  21. package/blueprints/service-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.ts +1 -1
  22. package/blueprints/service-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.ts +1 -1
  23. package/blueprints/util-test/index.js +2 -2
  24. package/blueprints/util-test/qunit-files/__root__/__testType__/__name__-test.js +1 -1
  25. package/blueprints/util-test/qunit-rfc-232-files/__root__/__testType__/__name__-test.ts +1 -1
  26. package/blueprints-js/acceptance-test/mocha-rfc-232-files/tests/acceptance/__name__-test.js +1 -1
  27. package/blueprints-js/acceptance-test/qunit-rfc-232-files/tests/acceptance/__name__-test.js +1 -1
  28. package/blueprints-js/component-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js +2 -2
  29. package/blueprints-js/component-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js +2 -2
  30. package/blueprints-js/controller-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js +1 -1
  31. package/blueprints-js/controller-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js +1 -1
  32. package/blueprints-js/helper-test/mocha-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js +1 -1
  33. package/blueprints-js/helper-test/qunit-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js +1 -1
  34. package/blueprints-js/route-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js +1 -1
  35. package/blueprints-js/route-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js +1 -1
  36. package/blueprints-js/service-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js +1 -1
  37. package/blueprints-js/service-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js +1 -1
  38. package/blueprints-js/util-test/qunit-files/__root__/__testType__/__name__-test.js +1 -1
  39. package/blueprints-js/util-test/qunit-rfc-232-files/__root__/__testType__/__name__-test.js +1 -1
  40. package/build-metadata.json +3 -3
  41. package/dist/ember-template-compiler.js +5 -7
  42. package/dist/ember-template-compiler.map +1 -1
  43. package/dist/ember-testing.js +1 -1
  44. package/dist/ember-testing.map +1 -1
  45. package/dist/ember.debug.js +30 -30
  46. package/dist/ember.debug.map +1 -1
  47. package/dist/header/license.js +1 -1
  48. package/dist/packages/@ember/-internals/browser-environment/index.js +2 -3
  49. package/dist/packages/@ember/-internals/glimmer/index.js +4 -2
  50. package/dist/packages/@ember/-internals/metal/index.js +1 -1
  51. package/dist/packages/@ember/-internals/routing/lib/location/auto_location.js +5 -5
  52. package/dist/packages/@ember/-internals/routing/lib/location/hash_location.js +1 -1
  53. package/dist/packages/@ember/-internals/routing/lib/location/util.js +1 -1
  54. package/dist/packages/@ember/-internals/routing/lib/services/router.js +1 -1
  55. package/dist/packages/@ember/-internals/routing/lib/utils.js +1 -1
  56. package/dist/packages/@ember/application/instance.js +1 -1
  57. package/dist/packages/@ember/application/lib/application.js +11 -11
  58. package/dist/packages/ember/version.js +1 -1
  59. package/docs/data.json +46 -4
  60. package/package.json +2 -2
  61. package/blueprints-js/-addon-import.js +0 -48
  62. package/blueprints-js/test-framework-detector.js +0 -60
@@ -5,5 +5,5 @@
5
5
  * Portions Copyright 2008-2011 Apple Inc. All rights reserved.
6
6
  * @license Licensed under MIT license
7
7
  * See https://raw.github.com/emberjs/ember.js/master/LICENSE
8
- * @version 4.6.0-alpha.6
8
+ * @version 4.7.0-alpha.2
9
9
  */
@@ -6,7 +6,6 @@ const location$1 = hasDom ? self.location : null;
6
6
  const history$1 = hasDom ? self.history : null;
7
7
  const userAgent = hasDom ? self.navigator.userAgent : 'Lynx (textmode)';
8
8
  const isChrome = hasDom ? typeof chrome === 'object' && !(typeof opera === 'object') : false;
9
- const isFirefox = hasDom ? typeof InstallTrigger !== 'undefined' : false;
10
- const isIE = hasDom ? typeof MSInputMethodContext !== 'undefined' && typeof documentMode !== 'undefined' : false;
9
+ const isFirefox = hasDom ? /Firefox|FxiOS/.test(userAgent) : false;
11
10
 
12
- export { window, location$1 as location, history$1 as history, userAgent, isChrome, isFirefox, isIE, hasDom as hasDOM };
11
+ export { window, location$1 as location, history$1 as history, userAgent, isChrome, isFirefox, hasDom as hasDOM };
@@ -4222,13 +4222,15 @@ var uniqueId = internalHelper(() => {
4222
4222
  // This code should be reasonably fast, and provide a unique value every time
4223
4223
  // it's called, which is what we need here. It produces a string formatted as a
4224
4224
  // standard UUID, which avoids accidentally turning Ember-specific
4225
- // implementation details into an intimate API.
4225
+ // implementation details into an intimate API. It also ensures that the UUID
4226
+ // always starts with a letter, to avoid creating invalid IDs with a numeric
4227
+ // digit at the start.
4226
4228
 
4227
4229
  function uniqueId$1() {
4228
4230
  // @ts-expect-error this one-liner abuses weird JavaScript semantics that
4229
4231
  // TypeScript (legitimately) doesn't like, but they're nonetheless valid and
4230
4232
  // specced.
4231
- return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, a => (a ^ Math.random() * 16 >> a / 4).toString(16));
4233
+ return ([3e7] + -1e3 + -4e3 + -2e3 + -1e11).replace(/[0-3]/g, a => (a * 4 ^ Math.random() * 16 >> (a & 2)).toString(16));
4232
4234
  }
4233
4235
 
4234
4236
  const MODIFIERS = ['alt', 'shift', 'meta', 'ctrl'];
@@ -818,7 +818,7 @@ function getChainTags(chainTags, obj, path, tagMeta, meta$$1) {
818
818
  } else {
819
819
  // use metaFor here to ensure we have the meta for the instance
820
820
  let lazyChains = instanceMeta.writableLazyChainsFor(segment);
821
- let rest = path.substr(segmentEnd + 1);
821
+ let rest = path.substring(segmentEnd + 1);
822
822
  let placeholderTag = createUpdatableTag();
823
823
  lazyChains.push([placeholderTag, rest]);
824
824
  chainTags.push(placeholderTag);
@@ -151,7 +151,7 @@ function detectImplementation(options) {
151
151
 
152
152
  if (currentPath === historyPath) {
153
153
  implementation = 'history';
154
- } else if (currentPath.substr(0, 2) === '/#') {
154
+ } else if (currentPath.substring(0, 2) === '/#') {
155
155
  history.replaceState({
156
156
  path: historyPath
157
157
  }, '', historyPath);
@@ -201,15 +201,15 @@ export function getHistoryPath(rootURL, location) {
201
201
  // with `#/`. Anything else should NOT be considered a route and should
202
202
  // be passed straight through, without transformation.
203
203
 
204
- if (hash.substr(0, 2) === '#/') {
204
+ if (hash.substring(0, 2) === '#/') {
205
205
  // There could be extra hash segments after the route
206
- hashParts = hash.substr(1).split('#'); // The first one is always the route url
206
+ hashParts = hash.substring(1).split('#'); // The first one is always the route url
207
207
 
208
208
  routeHash = hashParts.shift(); // If the path already has a trailing slash, remove the one
209
209
  // from the hashed route so we don't double up.
210
210
 
211
211
  if (path.charAt(path.length - 1) === '/') {
212
- routeHash = routeHash.substr(1);
212
+ routeHash = routeHash.substring(1);
213
213
  } // This is the "expected" final order
214
214
 
215
215
 
@@ -236,7 +236,7 @@ export function getHistoryPath(rootURL, location) {
236
236
  export function getHashPath(rootURL, location) {
237
237
  let path = rootURL;
238
238
  let historyPath = getHistoryPath(rootURL, location);
239
- let routePath = historyPath.substr(rootURL.length);
239
+ let routePath = historyPath.substring(rootURL.length);
240
240
 
241
241
  if (routePath !== '') {
242
242
  if (routePath[0] !== '/') {
@@ -68,7 +68,7 @@ export default class HashLocation extends EmberObject {
68
68
 
69
69
 
70
70
  getURL() {
71
- let originalPath = this.getHash().substr(1);
71
+ let originalPath = this.getHash().substring(1);
72
72
  let outPath = originalPath;
73
73
 
74
74
  if (outPath[0] !== '/') {
@@ -29,7 +29,7 @@ export function getQuery(location) {
29
29
 
30
30
  export function getHash(location) {
31
31
  if (location.hash !== undefined) {
32
- return location.hash.substr(0);
32
+ return location.hash.substring(0);
33
33
  }
34
34
 
35
35
  return '';
@@ -21,7 +21,7 @@ function cleanURL(url, rootURL) {
21
21
  return url;
22
22
  }
23
23
 
24
- return url.substr(rootURL.length, url.length);
24
+ return url.substring(rootURL.length);
25
25
  }
26
26
 
27
27
  class RouterService extends Service.extend(Evented) {
@@ -113,7 +113,7 @@ export function calculateCacheKey(prefix, parts = [], values) {
113
113
 
114
114
  if (values) {
115
115
  if (cacheValuePrefix && cacheValuePrefix in values) {
116
- let partRemovedPrefix = part.indexOf(cacheValuePrefix) === 0 ? part.substr(cacheValuePrefix.length + 1) : part;
116
+ let partRemovedPrefix = part.indexOf(cacheValuePrefix) === 0 ? part.substring(cacheValuePrefix.length + 1) : part;
117
117
  value = get(values[cacheValuePrefix], partRemovedPrefix);
118
118
  } else {
119
119
  value = get(values, part);
@@ -206,7 +206,7 @@ class ApplicationInstance extends EngineInstance {
206
206
  Navigate the instance to a particular URL. This is useful in tests, for
207
207
  example, or to tell the app to start at a particular URL. This method
208
208
  returns a promise that resolves with the app instance when the transition
209
- is complete, or rejects if the transion was aborted due to an error.
209
+ is complete, or rejects if the transition was aborted due to an error.
210
210
  @public
211
211
  @param url {String} the destination URL
212
212
  @return {Promise<ApplicationInstance>}
@@ -29,11 +29,11 @@ import { RouterService } from '@ember/-internals/routing';
29
29
  initialized.
30
30
 
31
31
  ```app/app.js
32
- const App = Application.extend({
32
+ export default class App extends Application {
33
33
  ready() {
34
34
  // your code here
35
35
  }
36
- })
36
+ }
37
37
  ```
38
38
 
39
39
  Because `Application` ultimately inherits from `Ember.Namespace`, any classes
@@ -70,12 +70,12 @@ import { RouterService } from '@ember/-internals/routing';
70
70
  ```app/app.js
71
71
  import Application from '@ember/application';
72
72
 
73
- let App = Application.extend({
74
- customEvents: {
73
+ export default class App extends Application {
74
+ customEvents = {
75
75
  // add support for the paste event
76
76
  paste: 'paste'
77
77
  }
78
- });
78
+ }
79
79
  ```
80
80
 
81
81
  To prevent Ember from setting up a listener for a default event,
@@ -85,13 +85,13 @@ import { RouterService } from '@ember/-internals/routing';
85
85
  ```app/app.js
86
86
  import Application from '@ember/application';
87
87
 
88
- let App = Application.extend({
89
- customEvents: {
88
+ export default class App extends Application {
89
+ customEvents = {
90
90
  // prevent listeners for mouseenter/mouseleave events
91
91
  mouseenter: null,
92
92
  mouseleave: null
93
93
  }
94
- });
94
+ }
95
95
  ```
96
96
 
97
97
  By default, the application sets up these event listeners on the document
@@ -105,9 +105,9 @@ import { RouterService } from '@ember/-internals/routing';
105
105
  ```app/app.js
106
106
  import Application from '@ember/application';
107
107
 
108
- let App = Application.extend({
109
- rootElement: '#ember-app'
110
- });
108
+ export default class App extends Application {
109
+ rootElement = '#ember-app'
110
+ }
111
111
  ```
112
112
 
113
113
  The `rootElement` can be either a DOM element or a CSS selector
@@ -1 +1 @@
1
- export default "4.6.0-alpha.6";
1
+ export default "4.7.0-alpha.2";
package/docs/data.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "name": "The Ember API",
4
4
  "description": "The Ember API: a framework for building ambitious web applications",
5
5
  "url": "https://emberjs.com/",
6
- "version": "4.6.0-alpha.6"
6
+ "version": "4.7.0-alpha.2"
7
7
  },
8
8
  "files": {
9
9
  "node_modules/rsvp/lib/rsvp/promise/all.js": {
@@ -360,6 +360,15 @@
360
360
  },
361
361
  "namespaces": {}
362
362
  },
363
+ "packages/@ember/-internals/glimmer/lib/helpers/helper.ts": {
364
+ "name": "packages/@ember/-internals/glimmer/lib/helpers/helper.ts",
365
+ "modules": {},
366
+ "classes": {},
367
+ "fors": {
368
+ "Ember.Templates.helpers": 1
369
+ },
370
+ "namespaces": {}
371
+ },
363
372
  "packages/@ember/-internals/glimmer/lib/helpers/if-unless.ts": {
364
373
  "name": "packages/@ember/-internals/glimmer/lib/helpers/if-unless.ts",
365
374
  "modules": {},
@@ -378,6 +387,15 @@
378
387
  },
379
388
  "namespaces": {}
380
389
  },
390
+ "packages/@ember/-internals/glimmer/lib/helpers/modifier.ts": {
391
+ "name": "packages/@ember/-internals/glimmer/lib/helpers/modifier.ts",
392
+ "modules": {},
393
+ "classes": {},
394
+ "fors": {
395
+ "Ember.Templates.helpers": 1
396
+ },
397
+ "namespaces": {}
398
+ },
381
399
  "packages/@ember/-internals/glimmer/lib/helpers/mut.ts": {
382
400
  "name": "packages/@ember/-internals/glimmer/lib/helpers/mut.ts",
383
401
  "modules": {},
@@ -3488,7 +3506,7 @@
3488
3506
  "namespace": "",
3489
3507
  "file": "packages/@ember/application/lib/application.ts",
3490
3508
  "line": 34,
3491
- "description": "An instance of `Application` is the starting point for every Ember\napplication. It instantiates, initializes and coordinates the\nobjects that make up your app.\n\nEach Ember app has one and only one `Application` object. Although\nEmber CLI creates this object implicitly, the `Application` class\nis defined in the `app/app.js`. You can define a `ready` method on the\n`Application` class, which will be run by Ember when the application is\ninitialized.\n\n```app/app.js\nconst App = Application.extend({\n ready() {\n // your code here\n }\n})\n```\n\nBecause `Application` ultimately inherits from `Ember.Namespace`, any classes\nyou create will have useful string representations when calling `toString()`.\nSee the `Ember.Namespace` documentation for more information.\n\nWhile you can think of your `Application` as a container that holds the\nother classes in your application, there are several other responsibilities\ngoing on under-the-hood that you may want to understand. It is also important\nto understand that an `Application` is different from an `ApplicationInstance`.\nRefer to the Guides to understand the difference between these.\n\n### Event Delegation\n\nEmber uses a technique called _event delegation_. This allows the framework\nto set up a global, shared event listener instead of requiring each view to\ndo it manually. For example, instead of each view registering its own\n`mousedown` listener on its associated element, Ember sets up a `mousedown`\nlistener on the `body`.\n\nIf a `mousedown` event occurs, Ember will look at the target of the event and\nstart walking up the DOM node tree, finding corresponding views and invoking\ntheir `mouseDown` method as it goes.\n\n`Application` has a number of default events that it listens for, as\nwell as a mapping from lowercase events to camel-cased view method names. For\nexample, the `keypress` event causes the `keyPress` method on the view to be\ncalled, the `dblclick` event causes `doubleClick` to be called, and so on.\n\nIf there is a bubbling browser event that Ember does not listen for by\ndefault, you can specify custom events and their corresponding view method\nnames by setting the application's `customEvents` property:\n\n```app/app.js\nimport Application from '@ember/application';\n\nlet App = Application.extend({\n customEvents: {\n // add support for the paste event\n paste: 'paste'\n }\n});\n```\n\nTo prevent Ember from setting up a listener for a default event,\nspecify the event name with a `null` value in the `customEvents`\nproperty:\n\n```app/app.js\nimport Application from '@ember/application';\n\nlet App = Application.extend({\n customEvents: {\n // prevent listeners for mouseenter/mouseleave events\n mouseenter: null,\n mouseleave: null\n }\n});\n```\n\nBy default, the application sets up these event listeners on the document\nbody. However, in cases where you are embedding an Ember application inside\nan existing page, you may want it to set up the listeners on an element\ninside the body.\n\nFor example, if only events inside a DOM element with the ID of `ember-app`\nshould be delegated, set your application's `rootElement` property:\n\n```app/app.js\nimport Application from '@ember/application';\n\nlet App = Application.extend({\n rootElement: '#ember-app'\n});\n```\n\nThe `rootElement` can be either a DOM element or a CSS selector\nstring. Note that *views appended to the DOM outside the root element will\nnot receive events.* If you specify a custom root element, make sure you only\nappend views inside it!\n\nTo learn more about the events Ember components use, see\n\n[components/handling-events](https://guides.emberjs.com/release/components/handling-events/#toc_event-names).\n\n### Initializers\n\nTo add behavior to the Application's boot process, you can define initializers in\nthe `app/initializers` directory, or with `ember generate initializer` using Ember CLI.\nThese files should export a named `initialize` function which will receive the created `application`\nobject as its first argument.\n\n```javascript\nexport function initialize(application) {\n // application.inject('route', 'foo', 'service:foo');\n}\n```\n\nApplication initializers can be used for a variety of reasons including:\n\n- setting up external libraries\n- injecting dependencies\n- setting up event listeners in embedded apps\n- deferring the boot process using the `deferReadiness` and `advanceReadiness` APIs.\n\n### Routing\n\nIn addition to creating your application's router, `Application` is\nalso responsible for telling the router when to start routing. Transitions\nbetween routes can be logged with the `LOG_TRANSITIONS` flag, and more\ndetailed intra-transition logging can be logged with\nthe `LOG_TRANSITIONS_INTERNAL` flag:\n\n```javascript\nimport Application from '@ember/application';\n\nlet App = Application.create({\n LOG_TRANSITIONS: true, // basic logging of successful transitions\n LOG_TRANSITIONS_INTERNAL: true // detailed logging of all routing steps\n});\n```\n\nBy default, the router will begin trying to translate the current URL into\napplication state once the browser emits the `DOMContentReady` event. If you\nneed to defer routing, you can call the application's `deferReadiness()`\nmethod. Once routing can begin, call the `advanceReadiness()` method.\n\nIf there is any setup required before routing begins, you can implement a\n`ready()` method on your app that will be invoked immediately before routing\nbegins.",
3509
+ "description": "An instance of `Application` is the starting point for every Ember\napplication. It instantiates, initializes and coordinates the\nobjects that make up your app.\n\nEach Ember app has one and only one `Application` object. Although\nEmber CLI creates this object implicitly, the `Application` class\nis defined in the `app/app.js`. You can define a `ready` method on the\n`Application` class, which will be run by Ember when the application is\ninitialized.\n\n```app/app.js\nexport default class App extends Application {\n ready() {\n // your code here\n }\n}\n```\n\nBecause `Application` ultimately inherits from `Ember.Namespace`, any classes\nyou create will have useful string representations when calling `toString()`.\nSee the `Ember.Namespace` documentation for more information.\n\nWhile you can think of your `Application` as a container that holds the\nother classes in your application, there are several other responsibilities\ngoing on under-the-hood that you may want to understand. It is also important\nto understand that an `Application` is different from an `ApplicationInstance`.\nRefer to the Guides to understand the difference between these.\n\n### Event Delegation\n\nEmber uses a technique called _event delegation_. This allows the framework\nto set up a global, shared event listener instead of requiring each view to\ndo it manually. For example, instead of each view registering its own\n`mousedown` listener on its associated element, Ember sets up a `mousedown`\nlistener on the `body`.\n\nIf a `mousedown` event occurs, Ember will look at the target of the event and\nstart walking up the DOM node tree, finding corresponding views and invoking\ntheir `mouseDown` method as it goes.\n\n`Application` has a number of default events that it listens for, as\nwell as a mapping from lowercase events to camel-cased view method names. For\nexample, the `keypress` event causes the `keyPress` method on the view to be\ncalled, the `dblclick` event causes `doubleClick` to be called, and so on.\n\nIf there is a bubbling browser event that Ember does not listen for by\ndefault, you can specify custom events and their corresponding view method\nnames by setting the application's `customEvents` property:\n\n```app/app.js\nimport Application from '@ember/application';\n\nexport default class App extends Application {\n customEvents = {\n // add support for the paste event\n paste: 'paste'\n }\n}\n```\n\nTo prevent Ember from setting up a listener for a default event,\nspecify the event name with a `null` value in the `customEvents`\nproperty:\n\n```app/app.js\nimport Application from '@ember/application';\n\nexport default class App extends Application {\n customEvents = {\n // prevent listeners for mouseenter/mouseleave events\n mouseenter: null,\n mouseleave: null\n }\n}\n```\n\nBy default, the application sets up these event listeners on the document\nbody. However, in cases where you are embedding an Ember application inside\nan existing page, you may want it to set up the listeners on an element\ninside the body.\n\nFor example, if only events inside a DOM element with the ID of `ember-app`\nshould be delegated, set your application's `rootElement` property:\n\n```app/app.js\nimport Application from '@ember/application';\n\nexport default class App extends Application {\n rootElement = '#ember-app'\n}\n```\n\nThe `rootElement` can be either a DOM element or a CSS selector\nstring. Note that *views appended to the DOM outside the root element will\nnot receive events.* If you specify a custom root element, make sure you only\nappend views inside it!\n\nTo learn more about the events Ember components use, see\n\n[components/handling-events](https://guides.emberjs.com/release/components/handling-events/#toc_event-names).\n\n### Initializers\n\nTo add behavior to the Application's boot process, you can define initializers in\nthe `app/initializers` directory, or with `ember generate initializer` using Ember CLI.\nThese files should export a named `initialize` function which will receive the created `application`\nobject as its first argument.\n\n```javascript\nexport function initialize(application) {\n // application.inject('route', 'foo', 'service:foo');\n}\n```\n\nApplication initializers can be used for a variety of reasons including:\n\n- setting up external libraries\n- injecting dependencies\n- setting up event listeners in embedded apps\n- deferring the boot process using the `deferReadiness` and `advanceReadiness` APIs.\n\n### Routing\n\nIn addition to creating your application's router, `Application` is\nalso responsible for telling the router when to start routing. Transitions\nbetween routes can be logged with the `LOG_TRANSITIONS` flag, and more\ndetailed intra-transition logging can be logged with\nthe `LOG_TRANSITIONS_INTERNAL` flag:\n\n```javascript\nimport Application from '@ember/application';\n\nlet App = Application.create({\n LOG_TRANSITIONS: true, // basic logging of successful transitions\n LOG_TRANSITIONS_INTERNAL: true // detailed logging of all routing steps\n});\n```\n\nBy default, the router will begin trying to translate the current URL into\napplication state once the browser emits the `DOMContentReady` event. If you\nneed to defer routing, you can call the application's `deferReadiness()`\nmethod. Once routing can begin, call the `advanceReadiness()` method.\n\nIf there is any setup required before routing begins, you can implement a\n`ready()` method on your app that will be invoked immediately before routing\nbegins.",
3492
3510
  "extends": "Engine",
3493
3511
  "access": "public",
3494
3512
  "tagname": ""
@@ -5828,6 +5846,18 @@
5828
5846
  "class": "Ember.Templates.helpers",
5829
5847
  "module": "ember"
5830
5848
  },
5849
+ {
5850
+ "file": "packages/@ember/-internals/glimmer/lib/helpers/helper.ts",
5851
+ "line": 5,
5852
+ "description": "Use the `{{helper}}` helper to create contextual helper so\nthat it can be passed around as first-class values in templates.\n\n```handlebars\n{{#let (helper \"join-words\" \"foo\" \"bar\" separator=\" \") as |foo-bar|}}\n\n {{!-- this is equivalent to invoking `{{join-words \"foo\" \"bar\" separator=\" \"}}` --}}\n {{foo-bar}}\n\n {{!-- this will pass the helper itself into the component, instead of invoking it now --}}\n <MyComponent @helper={{helper foo-bar \"baz\"}} />\n\n {{!-- this will yield the helper itself (\"contextual helper\"), instead of invoking it now --}}\n {{yield foo-bar}}\n{{/let}}\n```\n\n### Arguments\n\nThe `{{helper}}` helper works similarly to the [`{{component}}`](./component?anchor=component) and\n[`{{modifier}}`](./modifier?anchor=modifier) helper:\n\n* When passed a string (e.g. `(helper \"foo\")`) as the first argument,\n it will produce an opaque, internal \"helper definition\" object\n that can be passed around and invoked elsewhere.\n\n* Any additional positional and/or named arguments (a.k.a. params and hash)\n will be stored (\"curried\") inside the definition object, such that, when invoked,\n these arguments will be passed along to the referenced helper.",
5853
+ "itemtype": "method",
5854
+ "name": "helper",
5855
+ "access": "public",
5856
+ "tagname": "",
5857
+ "since": "3.27.0",
5858
+ "class": "Ember.Templates.helpers",
5859
+ "module": "ember"
5860
+ },
5831
5861
  {
5832
5862
  "file": "packages/@ember/-internals/glimmer/lib/helpers/if-unless.ts",
5833
5863
  "line": 5,
@@ -5868,6 +5898,18 @@
5868
5898
  "class": "Ember.Templates.helpers",
5869
5899
  "module": "ember"
5870
5900
  },
5901
+ {
5902
+ "file": "packages/@ember/-internals/glimmer/lib/helpers/modifier.ts",
5903
+ "line": 5,
5904
+ "description": "Use the `{{modifier}}` helper to create contextual modifier so\nthat it can be passed around as first-class values in templates.\n\n```handlebars\n{{#let (modifier \"click-outside\" click=this.submit) as |on-click-outside|}}\n\n {{!-- this is equivalent to `<MyComponent {{click-outside click=this.submit}} />` --}}\n <MyComponent {{on-click-outside}} />\n\n {{!-- this will pass the modifier itself into the component, instead of invoking it now --}}\n <MyComponent @modifier={{modifier on-click-outside \"extra\" \"args\"}} />\n\n {{!-- this will yield the modifier itself (\"contextual modifier\"), instead of invoking it now --}}\n {{yield on-click-outside}}\n{{/let}}\n```\n\n### Arguments\n\nThe `{{modifier}}` helper works similarly to the [`{{component}}`](./component?anchor=component) and\n[`{{helper}}`](./helper?anchor=helper) helper:\n\n* When passed a string (e.g. `(modifier \"foo\")`) as the first argument,\n it will produce an opaque, internal \"modifier definition\" object\n that can be passed around and invoked elsewhere.\n\n* Any additional positional and/or named arguments (a.k.a. params and hash)\n will be stored (\"curried\") inside the definition object, such that, when invoked,\n these arguments will be passed along to the referenced modifier.",
5905
+ "itemtype": "method",
5906
+ "name": "modifier",
5907
+ "access": "public",
5908
+ "tagname": "",
5909
+ "since": "3.27.0",
5910
+ "class": "Ember.Templates.helpers",
5911
+ "module": "ember"
5912
+ },
5871
5913
  {
5872
5914
  "file": "packages/@ember/-internals/glimmer/lib/helpers/mut.ts",
5873
5915
  "line": 9,
@@ -15182,7 +15224,7 @@
15182
15224
  {
15183
15225
  "file": "packages/@ember/application/instance.ts",
15184
15226
  "line": 247,
15185
- "description": "Navigate the instance to a particular URL. This is useful in tests, for\nexample, or to tell the app to start at a particular URL. This method\nreturns a promise that resolves with the app instance when the transition\nis complete, or rejects if the transion was aborted due to an error.",
15227
+ "description": "Navigate the instance to a particular URL. This is useful in tests, for\nexample, or to tell the app to start at a particular URL. This method\nreturns a promise that resolves with the app instance when the transition\nis complete, or rejects if the transition was aborted due to an error.",
15186
15228
  "access": "public",
15187
15229
  "tagname": "",
15188
15230
  "params": [
@@ -19061,7 +19103,7 @@
19061
19103
  "line": " packages/@ember/application/instance.ts:232"
19062
19104
  },
19063
19105
  {
19064
- "message": "Missing item type\nNavigate the instance to a particular URL. This is useful in tests, for\nexample, or to tell the app to start at a particular URL. This method\nreturns a promise that resolves with the app instance when the transition\nis complete, or rejects if the transion was aborted due to an error.",
19106
+ "message": "Missing item type\nNavigate the instance to a particular URL. This is useful in tests, for\nexample, or to tell the app to start at a particular URL. This method\nreturns a promise that resolves with the app instance when the transition\nis complete, or rejects if the transition was aborted due to an error.",
19065
19107
  "line": " packages/@ember/application/instance.ts:247"
19066
19108
  },
19067
19109
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-source",
3
- "version": "4.6.0-alpha.6",
3
+ "version": "4.7.0-alpha.2",
4
4
  "description": "A JavaScript framework for creating ambitious web applications",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -160,7 +160,7 @@
160
160
  "ember-addon": {
161
161
  "after": "ember-cli-legacy-blueprints"
162
162
  },
163
- "_originalVersion": "4.6.0-alpha.6",
163
+ "_originalVersion": "4.7.0-alpha.2",
164
164
  "_versionPreviouslyCalculated": true,
165
165
  "publishConfig": {
166
166
  "tag": "alpha"
@@ -1,48 +0,0 @@
1
- 'use strict';
2
-
3
- const stringUtil = require('ember-cli-string-utils');
4
- const path = require('path');
5
- const inflector = require('inflection');
6
-
7
- module.exports = {
8
- description: 'Generates an import wrapper.',
9
-
10
- fileMapTokens: function () {
11
- return {
12
- __name__: function (options) {
13
- return options.dasherizedModuleName;
14
- },
15
- __path__: function (options) {
16
- return inflector.pluralize(options.locals.blueprintName);
17
- },
18
- __root__: function (options) {
19
- if (options.inRepoAddon) {
20
- return path.join('lib', options.inRepoAddon, 'app');
21
- }
22
- return 'app';
23
- },
24
- };
25
- },
26
-
27
- locals: function (options) {
28
- let addonRawName = options.inRepoAddon ? options.inRepoAddon : options.project.name();
29
- let addonName = stringUtil.dasherize(addonRawName);
30
- let fileName = stringUtil.dasherize(options.entity.name);
31
- let blueprintName = options.originBlueprintName;
32
- let modulePathSegments = [
33
- addonName,
34
- inflector.pluralize(options.originBlueprintName),
35
- fileName,
36
- ];
37
-
38
- if (blueprintName.match(/-addon/)) {
39
- blueprintName = blueprintName.substr(0, blueprintName.indexOf('-addon'));
40
- modulePathSegments = [addonName, inflector.pluralize(blueprintName), fileName];
41
- }
42
-
43
- return {
44
- modulePath: modulePathSegments.join('/'),
45
- blueprintName: blueprintName,
46
- };
47
- },
48
- };
@@ -1,60 +0,0 @@
1
- 'use strict';
2
-
3
- const fs = require('fs');
4
- const path = require('path');
5
- const VersionChecker = require('ember-cli-version-checker');
6
-
7
- module.exports = function (blueprint) {
8
- blueprint.supportsAddon = function () {
9
- return false;
10
- };
11
-
12
- blueprint.filesPath = function () {
13
- let type;
14
- const qunitRfcVersion = 'qunit-rfc-232';
15
- const mochaRfcVersion = 'mocha-rfc-232';
16
- const mochaVersion = 'mocha-0.12';
17
-
18
- let dependencies = this.project.dependencies();
19
- if ('ember-qunit' in dependencies) {
20
- type = qunitRfcVersion;
21
- } else if ('ember-cli-qunit' in dependencies) {
22
- let checker = new VersionChecker(this.project);
23
- if (
24
- fs.existsSync(`${this.path}/${qunitRfcVersion}-files`) &&
25
- checker.for('ember-cli-qunit', 'npm').gte('4.2.0')
26
- ) {
27
- type = qunitRfcVersion;
28
- } else {
29
- type = 'qunit';
30
- }
31
- } else if ('ember-mocha' in dependencies) {
32
- let checker = new VersionChecker(this.project);
33
- if (
34
- fs.existsSync(`${this.path}/${mochaRfcVersion}-files`) &&
35
- checker.for('ember-mocha', 'npm').gte('0.14.0')
36
- ) {
37
- type = mochaRfcVersion;
38
- } else {
39
- type = mochaVersion;
40
- }
41
- } else if ('ember-cli-mocha' in dependencies) {
42
- let checker = new VersionChecker(this.project);
43
- if (
44
- fs.existsSync(`${this.path}/${mochaVersion}-files`) &&
45
- checker.for('ember-cli-mocha', 'npm').gte('0.12.0')
46
- ) {
47
- type = mochaVersion;
48
- } else {
49
- type = 'mocha';
50
- }
51
- } else {
52
- this.ui.writeLine("Couldn't determine test style - using QUnit");
53
- type = 'qunit';
54
- }
55
-
56
- return path.join(this.path, type + '-files');
57
- };
58
-
59
- return blueprint;
60
- };