ember-source 4.7.0-alpha.1 → 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.
- package/build-metadata.json +3 -3
- package/dist/ember-template-compiler.js +5 -7
- package/dist/ember-template-compiler.map +1 -1
- package/dist/ember-testing.js +1 -1
- package/dist/ember-testing.map +1 -1
- package/dist/ember.debug.js +30 -30
- package/dist/ember.debug.map +1 -1
- package/dist/header/license.js +1 -1
- package/dist/packages/@ember/-internals/browser-environment/index.js +2 -3
- package/dist/packages/@ember/-internals/glimmer/index.js +4 -2
- package/dist/packages/@ember/-internals/metal/index.js +1 -1
- package/dist/packages/@ember/-internals/routing/lib/location/auto_location.js +5 -5
- package/dist/packages/@ember/-internals/routing/lib/location/hash_location.js +1 -1
- package/dist/packages/@ember/-internals/routing/lib/location/util.js +1 -1
- package/dist/packages/@ember/-internals/routing/lib/services/router.js +1 -1
- package/dist/packages/@ember/-internals/routing/lib/utils.js +1 -1
- package/dist/packages/@ember/application/instance.js +1 -1
- package/dist/packages/@ember/application/lib/application.js +11 -11
- package/dist/packages/ember/version.js +1 -1
- package/docs/data.json +4 -4
- package/package.json +2 -2
package/dist/header/license.js
CHANGED
|
@@ -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 ?
|
|
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,
|
|
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 ([
|
|
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.
|
|
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.
|
|
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.
|
|
204
|
+
if (hash.substring(0, 2) === '#/') {
|
|
205
205
|
// There could be extra hash segments after the route
|
|
206
|
-
hashParts = hash.
|
|
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.
|
|
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.
|
|
239
|
+
let routePath = historyPath.substring(rootURL.length);
|
|
240
240
|
|
|
241
241
|
if (routePath !== '') {
|
|
242
242
|
if (routePath[0] !== '/') {
|
|
@@ -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.
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
109
|
-
rootElement
|
|
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.7.0-alpha.
|
|
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.7.0-alpha.
|
|
6
|
+
"version": "4.7.0-alpha.2"
|
|
7
7
|
},
|
|
8
8
|
"files": {
|
|
9
9
|
"node_modules/rsvp/lib/rsvp/promise/all.js": {
|
|
@@ -3506,7 +3506,7 @@
|
|
|
3506
3506
|
"namespace": "",
|
|
3507
3507
|
"file": "packages/@ember/application/lib/application.ts",
|
|
3508
3508
|
"line": 34,
|
|
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\
|
|
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.",
|
|
3510
3510
|
"extends": "Engine",
|
|
3511
3511
|
"access": "public",
|
|
3512
3512
|
"tagname": ""
|
|
@@ -15224,7 +15224,7 @@
|
|
|
15224
15224
|
{
|
|
15225
15225
|
"file": "packages/@ember/application/instance.ts",
|
|
15226
15226
|
"line": 247,
|
|
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
|
|
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.",
|
|
15228
15228
|
"access": "public",
|
|
15229
15229
|
"tagname": "",
|
|
15230
15230
|
"params": [
|
|
@@ -19103,7 +19103,7 @@
|
|
|
19103
19103
|
"line": " packages/@ember/application/instance.ts:232"
|
|
19104
19104
|
},
|
|
19105
19105
|
{
|
|
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
|
|
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.",
|
|
19107
19107
|
"line": " packages/@ember/application/instance.ts:247"
|
|
19108
19108
|
},
|
|
19109
19109
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-source",
|
|
3
|
-
"version": "4.7.0-alpha.
|
|
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.7.0-alpha.
|
|
163
|
+
"_originalVersion": "4.7.0-alpha.2",
|
|
164
164
|
"_versionPreviouslyCalculated": true,
|
|
165
165
|
"publishConfig": {
|
|
166
166
|
"tag": "alpha"
|