ember-source 5.4.0-alpha.2 → 5.4.0-alpha.3

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.
@@ -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 5.4.0-alpha.2
8
+ * @version 5.4.0-alpha.3
9
9
  */
@@ -197,7 +197,7 @@ class ApplicationInstance extends EngineInstance {
197
197
  }
198
198
  };
199
199
  let handleTransitionReject = error => {
200
- if (error.error) {
200
+ if (error.error && error.error instanceof Error) {
201
201
  throw error.error;
202
202
  } else if (error.name === 'TransitionAborted' && router._routerMicrolib.activeTransition) {
203
203
  return router._routerMicrolib.activeTransition.then(handleTransitionResolve, handleTransitionReject);
@@ -43,13 +43,13 @@
43
43
  <ProfileCard @name={{this.person.name}} />
44
44
  `);
45
45
 
46
- assert.dom(this.element).hasText('John');
46
+ assert.dom().hasText('John');
47
47
 
48
48
  this.person.name = 'Jane';
49
49
 
50
50
  await renderSettled(); // Wait until rendering has completed.
51
51
 
52
- assert.dom(this.element).hasText('Jane');
52
+ assert.dom().hasText('Jane');
53
53
  });
54
54
  });
55
55
  ```
@@ -1,5 +1,5 @@
1
1
  /**
2
- @module ember/routing
2
+ @module @ember/routing
3
3
  */
4
4
  /**
5
5
  Finds a controller instance.
@@ -3,7 +3,7 @@ import Controller from '@ember/controller';
3
3
  import { assert, info } from '@ember/debug';
4
4
  import { DEBUG } from '@glimmer/env';
5
5
  /**
6
- @module ember/routing
6
+ @module @ember/routing
7
7
  */
8
8
  /**
9
9
  Generates a controller factory
@@ -613,9 +613,11 @@ class Route extends EmberObject.extend(ActionHandler, Evented) {
613
613
  id: 'deprecate-implicit-route-model',
614
614
  for: 'ember-source',
615
615
  since: {
616
- available: '5.3.0'
616
+ available: '5.3.0',
617
+ enabled: '5.3.0'
617
618
  },
618
- until: '6.0.0'
619
+ until: '6.0.0',
620
+ url: 'https://deprecations.emberjs.com/v5.x/#toc_deprecate-implicit-route-model'
619
621
  });
620
622
  const store = 'store' in this ? this.store : get(this, '_store');
621
623
  assert('Expected route to have a store with a find method', isStoreLike(store));
@@ -1 +1 @@
1
- export default "5.4.0-alpha.2";
1
+ export default "5.4.0-alpha.3";
@@ -1,17 +1,7 @@
1
1
  import { RSVP } from '@ember/-internals/runtime';
2
2
  import { _backburner } from '@ember/runloop';
3
- import { isTesting } from '@ember/debug';
4
- import { asyncStart, asyncEnd } from '../test/adapter';
5
3
  RSVP.configure('async', function (callback, promise) {
6
4
  // if schedule will cause autorun, we need to inform adapter
7
- if (isTesting() && !_backburner.currentInstance) {
8
- asyncStart();
9
- _backburner.schedule('actions', () => {
10
- asyncEnd();
11
- callback(promise);
12
- });
13
- } else {
14
- _backburner.schedule('actions', () => callback(promise));
15
- }
5
+ _backburner.schedule('actions', () => callback(promise));
16
6
  });
17
7
  export default RSVP;
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": "5.4.0-alpha.2"
6
+ "version": "5.4.0-alpha.3"
7
7
  },
8
8
  "files": {
9
9
  "node_modules/rsvp/lib/rsvp/promise/all.js": {
@@ -229,9 +229,7 @@
229
229
  },
230
230
  "packages/@ember/-internals/glimmer/lib/components/link-to.ts": {
231
231
  "name": "packages/@ember/-internals/glimmer/lib/components/link-to.ts",
232
- "modules": {
233
- "@ember/routing": 1
234
- },
232
+ "modules": {},
235
233
  "classes": {},
236
234
  "fors": {
237
235
  "Ember.Templates.components": 1,
@@ -1382,7 +1380,7 @@
1382
1380
  "packages/@ember/routing/lib/controller_for.ts": {
1383
1381
  "name": "packages/@ember/routing/lib/controller_for.ts",
1384
1382
  "modules": {
1385
- "ember/routing": 1
1383
+ "@ember/routing": 1
1386
1384
  },
1387
1385
  "classes": {},
1388
1386
  "fors": {
@@ -1798,12 +1796,13 @@
1798
1796
  },
1799
1797
  "fors": {
1800
1798
  "Ember.Templates.helpers": 1,
1801
- "@ember/routing": 1
1799
+ "@ember/routing": 1,
1800
+ "Ember": 1
1802
1801
  },
1803
1802
  "namespaces": {},
1804
1803
  "tag": "module",
1805
- "file": "packages/@ember/-internals/glimmer/lib/components/link-to.ts",
1806
- "line": 251
1804
+ "file": "packages/@ember/routing/lib/controller_for.ts",
1805
+ "line": 5
1807
1806
  },
1808
1807
  "ember": {
1809
1808
  "name": "ember",
@@ -2337,19 +2336,6 @@
2337
2336
  "access": "public",
2338
2337
  "tagname": ""
2339
2338
  },
2340
- "ember/routing": {
2341
- "name": "ember/routing",
2342
- "submodules": {},
2343
- "elements": {},
2344
- "classes": {},
2345
- "fors": {
2346
- "Ember": 1
2347
- },
2348
- "namespaces": {},
2349
- "tag": "module",
2350
- "file": "packages/@ember/routing/lib/controller_for.ts",
2351
- "line": 5
2352
- },
2353
2339
  "@ember/routing/hash-location": {
2354
2340
  "name": "@ember/routing/hash-location",
2355
2341
  "submodules": {},
@@ -15034,7 +15020,7 @@
15034
15020
  {
15035
15021
  "file": "packages/@ember/renderer/index.ts",
15036
15022
  "line": 11,
15037
- "description": "Returns a promise which will resolve when rendering has completed. In\nthis context, rendering is completed when all auto-tracked state that is\nconsumed in the template (including any tracked state in models, services,\netc. that are then used in a template) has been updated in the DOM.\n\nFor example, in a test you might want to update some tracked state and\nthen run some assertions after rendering has completed. You _could_ use\n`await settled()` in that location, but in some contexts you don't want to\nwait for full settledness (which includes test waiters, pending AJAX/fetch,\nrun loops, etc) but instead only want to know when that updated value has\nbeen rendered in the DOM. **THAT** is what `await renderSettled()` is\n_perfect_ for.\n\n```js\nimport { renderSettled } from '@ember/renderer';\nimport { render } from '@ember/test-helpers';\nimport { tracked } from '@glimmer/tracking';\nimport { hbs } from 'ember-cli-htmlbars';\nimport { setupRenderingTest } from 'my-app/tests/helpers';\nimport { module, test } from 'qunit';\n\nmodule('Integration | Component | profile-card', function (hooks) {\n setupRenderingTest(hooks);\n\n test(\"it renders the person's name\", async function (assert) {\n class Person {\n @tracked name = '';\n }\n\n this.person = new Person();\n this.person.name = 'John';\n\n await render(hbs`\n <ProfileCard @name={{this.person.name}} />\n `);\n\n assert.dom(this.element).hasText('John');\n\n this.person.name = 'Jane';\n\n await renderSettled(); // Wait until rendering has completed.\n\n assert.dom(this.element).hasText('Jane');\n });\n});\n```",
15023
+ "description": "Returns a promise which will resolve when rendering has completed. In\nthis context, rendering is completed when all auto-tracked state that is\nconsumed in the template (including any tracked state in models, services,\netc. that are then used in a template) has been updated in the DOM.\n\nFor example, in a test you might want to update some tracked state and\nthen run some assertions after rendering has completed. You _could_ use\n`await settled()` in that location, but in some contexts you don't want to\nwait for full settledness (which includes test waiters, pending AJAX/fetch,\nrun loops, etc) but instead only want to know when that updated value has\nbeen rendered in the DOM. **THAT** is what `await renderSettled()` is\n_perfect_ for.\n\n```js\nimport { renderSettled } from '@ember/renderer';\nimport { render } from '@ember/test-helpers';\nimport { tracked } from '@glimmer/tracking';\nimport { hbs } from 'ember-cli-htmlbars';\nimport { setupRenderingTest } from 'my-app/tests/helpers';\nimport { module, test } from 'qunit';\n\nmodule('Integration | Component | profile-card', function (hooks) {\n setupRenderingTest(hooks);\n\n test(\"it renders the person's name\", async function (assert) {\n class Person {\n @tracked name = '';\n }\n\n this.person = new Person();\n this.person.name = 'John';\n\n await render(hbs`\n <ProfileCard @name={{this.person.name}} />\n `);\n\n assert.dom().hasText('John');\n\n this.person.name = 'Jane';\n\n await renderSettled(); // Wait until rendering has completed.\n\n assert.dom().hasText('Jane');\n });\n});\n```",
15038
15024
  "itemtype": "method",
15039
15025
  "name": "renderSettled",
15040
15026
  "return": {
@@ -15055,7 +15041,7 @@
15055
15041
  "access": "private",
15056
15042
  "tagname": "",
15057
15043
  "class": "Ember",
15058
- "module": "ember/routing"
15044
+ "module": "@ember/routing"
15059
15045
  },
15060
15046
  {
15061
15047
  "file": "packages/@ember/routing/lib/generate_controller.ts",
@@ -15066,7 +15052,7 @@
15066
15052
  "access": "private",
15067
15053
  "tagname": "",
15068
15054
  "class": "Ember",
15069
- "module": "ember/routing"
15055
+ "module": "@ember/routing"
15070
15056
  },
15071
15057
  {
15072
15058
  "file": "packages/@ember/routing/lib/generate_controller.ts",
@@ -15078,7 +15064,7 @@
15078
15064
  "tagname": "",
15079
15065
  "since": "1.3.0",
15080
15066
  "class": "Ember",
15081
- "module": "ember/routing"
15067
+ "module": "@ember/routing"
15082
15068
  },
15083
15069
  {
15084
15070
  "file": "packages/@ember/routing/lib/location-utils.ts",
@@ -15086,7 +15072,7 @@
15086
15072
  "access": "private",
15087
15073
  "tagname": "Returns the current `location.pathname`, normalized for IE inconsistencies.",
15088
15074
  "class": "RoutingService",
15089
- "module": "ember/routing"
15075
+ "module": "@ember/routing"
15090
15076
  },
15091
15077
  {
15092
15078
  "file": "packages/@ember/routing/lib/location-utils.ts",
@@ -15094,7 +15080,7 @@
15094
15080
  "access": "private",
15095
15081
  "tagname": "Returns the current `location.search`.",
15096
15082
  "class": "RoutingService",
15097
- "module": "ember/routing"
15083
+ "module": "@ember/routing"
15098
15084
  },
15099
15085
  {
15100
15086
  "file": "packages/@ember/routing/lib/location-utils.ts",
@@ -15102,7 +15088,7 @@
15102
15088
  "access": "private",
15103
15089
  "tagname": "Returns the hash or empty string",
15104
15090
  "class": "RoutingService",
15105
- "module": "ember/routing"
15091
+ "module": "@ember/routing"
15106
15092
  },
15107
15093
  {
15108
15094
  "file": "packages/@ember/routing/lib/location-utils.ts",
@@ -15111,7 +15097,7 @@
15111
15097
  "access": "private",
15112
15098
  "tagname": "",
15113
15099
  "class": "RoutingService",
15114
- "module": "ember/routing"
15100
+ "module": "@ember/routing"
15115
15101
  },
15116
15102
  {
15117
15103
  "file": "packages/@ember/routing/hash-location.ts",
@@ -16425,7 +16411,7 @@
16425
16411
  },
16426
16412
  {
16427
16413
  "file": "packages/@ember/routing/route.ts",
16428
- "line": 1266,
16414
+ "line": 1267,
16429
16415
  "description": "A hook you can use to setup the controller for the current route.\n\nThis method is called with the controller for the current route and the\nmodel supplied by the `model` hook.\n\nBy default, the `setupController` hook sets the `model` property of\nthe controller to the specified `model` when it is not `undefined`.\n\nIf you implement the `setupController` hook in your Route, it will\nprevent this default behavior. If you want to preserve that behavior\nwhen implementing your `setupController` function, make sure to call\n`super`:\n\n```app/routes/photos.js\nimport Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default class PhotosRoute extends Route {\n @service store;\n\n model() {\n return this.store.findAll('photo');\n }\n\n setupController(controller, model) {\n super.setupController(controller, model);\n\n this.controllerFor('application').set('showingPhotos', true);\n }\n}\n```\n\nThe provided controller will be one resolved based on the name\nof this route.\n\nIf no explicit controller is defined, Ember will automatically create one.\n\nAs an example, consider the router:\n\n```app/router.js\n// ...\n\nRouter.map(function() {\n this.route('post', { path: '/posts/:post_id' });\n});\n\nexport default Router;\n```\n\nIf you have defined a file for the post controller,\nthe framework will use it.\nIf it is not defined, a basic `Controller` instance would be used.",
16430
16416
  "example": [
16431
16417
  " Behavior of a basic Controller\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n setupController(controller, model) {\n controller.set('model', model);\n }\n});\n```"
@@ -16458,7 +16444,7 @@
16458
16444
  },
16459
16445
  {
16460
16446
  "file": "packages/@ember/routing/route.ts",
16461
- "line": 1345,
16447
+ "line": 1346,
16462
16448
  "description": "Returns the controller of the current route, or a parent (or any ancestor)\nroute in a route hierarchy.\n\nThe controller instance must already have been created, either through entering the\nassociated route or using `generateController`.\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n setupController(controller, post) {\n super.setupController(controller, post);\n\n this.controllerFor('posts').set('currentPost', post);\n }\n}\n```",
16463
16449
  "itemtype": "method",
16464
16450
  "name": "controllerFor",
@@ -16481,7 +16467,7 @@
16481
16467
  },
16482
16468
  {
16483
16469
  "file": "packages/@ember/routing/route.ts",
16484
- "line": 1399,
16470
+ "line": 1400,
16485
16471
  "description": "Generates a controller for a route.\n\nExample\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\n\nexport default class Post extends Route {\n setupController(controller, post) {\n super.setupController(controller, post);\n\n this.generateController('posts');\n }\n}\n```",
16486
16472
  "itemtype": "method",
16487
16473
  "name": "generateController",
@@ -16499,7 +16485,7 @@
16499
16485
  },
16500
16486
  {
16501
16487
  "file": "packages/@ember/routing/route.ts",
16502
- "line": 1427,
16488
+ "line": 1428,
16503
16489
  "description": "Returns the resolved model of a parent (or any ancestor) route\nin a route hierarchy. During a transition, all routes\nmust resolve a model object, and if a route\nneeds access to a parent route's model in order to\nresolve a model (or just reuse the model from a parent),\nit can call `this.modelFor(theNameOfParentRoute)` to\nretrieve it. If the ancestor route's model was a promise,\nits resolved result is returned.\n\nExample\n\n```app/router.js\n// ...\n\nRouter.map(function() {\n this.route('post', { path: '/posts/:post_id' }, function() {\n this.route('comments');\n });\n});\n\nexport default Router;\n```\n\n```app/routes/post/comments.js\nimport Route from '@ember/routing/route';\n\nexport default class PostCommentsRoute extends Route {\n model() {\n let post = this.modelFor('post');\n\n return post.comments;\n }\n}\n```",
16504
16490
  "itemtype": "method",
16505
16491
  "name": "modelFor",
@@ -16522,7 +16508,7 @@
16522
16508
  },
16523
16509
  {
16524
16510
  "file": "packages/@ember/routing/route.ts",
16525
- "line": 1499,
16511
+ "line": 1500,
16526
16512
  "description": "`this[RENDER]` is used to render a template into a region of another template\n(indicated by an `{{outlet}}`).",
16527
16513
  "itemtype": "method",
16528
16514
  "name": "this[RENDER]",
@@ -16572,7 +16558,7 @@
16572
16558
  },
16573
16559
  {
16574
16560
  "file": "packages/@ember/routing/route.ts",
16575
- "line": 1526,
16561
+ "line": 1527,
16576
16562
  "access": "private",
16577
16563
  "tagname": "",
16578
16564
  "itemtype": "method",
@@ -16582,7 +16568,7 @@
16582
16568
  },
16583
16569
  {
16584
16570
  "file": "packages/@ember/routing/route.ts",
16585
- "line": 1539,
16571
+ "line": 1540,
16586
16572
  "description": "Allows you to produce custom metadata for the route.\nThe return value of this method will be attached to\nits corresponding RouteInfoWithAttributes object.\n\nExample\n\n```app/routes/posts/index.js\nimport Route from '@ember/routing/route';\n\nexport default class PostsIndexRoute extends Route {\n buildRouteInfoMetadata() {\n return { title: 'Posts Page' }\n }\n}\n```\n\n```app/routes/application.js\nimport Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default class ApplicationRoute extends Route {\n @service router\n\n constructor() {\n super(...arguments);\n\n this.router.on('routeDidChange', transition => {\n document.title = transition.to.metadata.title;\n // would update document's title to \"Posts Page\"\n });\n }\n}\n```",
16587
16573
  "itemtype": "method",
16588
16574
  "name": "buildRouteInfoMetadata",
@@ -16597,13 +16583,13 @@
16597
16583
  },
16598
16584
  {
16599
16585
  "file": "packages/@ember/routing/route.ts",
16600
- "line": 1590,
16586
+ "line": 1591,
16601
16587
  "class": "Route",
16602
16588
  "module": "@ember/routing/route"
16603
16589
  },
16604
16590
  {
16605
16591
  "file": "packages/@ember/routing/route.ts",
16606
- "line": 1639,
16592
+ "line": 1640,
16607
16593
  "access": "private",
16608
16594
  "tagname": "",
16609
16595
  "itemtype": "property",
@@ -16613,7 +16599,7 @@
16613
16599
  },
16614
16600
  {
16615
16601
  "file": "packages/@ember/routing/route.ts",
16616
- "line": 1778,
16602
+ "line": 1779,
16617
16603
  "description": "Sends an action to the router, which will delegate it to the currently\nactive route hierarchy per the bubbling rules explained under `actions`.\n\nExample\n\n```app/router.js\n// ...\n\nRouter.map(function() {\n this.route('index');\n});\n\nexport default Router;\n```\n\n```app/routes/application.js\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n @action\n track(arg) {\n console.log(arg, 'was clicked');\n }\n}\n```\n\n```app/routes/index.js\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n @action\n trackIfDebug(arg) {\n if (debug) {\n this.send('track', arg);\n }\n }\n}\n```",
16618
16604
  "itemtype": "method",
16619
16605
  "name": "send",
@@ -16637,7 +16623,7 @@
16637
16623
  },
16638
16624
  {
16639
16625
  "file": "packages/@ember/routing/route.ts",
16640
- "line": 2161,
16626
+ "line": 2162,
16641
16627
  "description": "The controller associated with this route.\n\nExample\n\n```app/routes/form.js\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class FormRoute extends Route {\n @action\n willTransition(transition) {\n if (this.controller.get('userHasEnteredData') &&\n !confirm('Are you sure you want to abandon progress?')) {\n transition.abort();\n } else {\n // Bubble the `willTransition` action so that\n // parent routes can decide whether or not to abort.\n return true;\n }\n }\n}\n```",
16642
16628
  "itemtype": "property",
16643
16629
  "name": "controller",
@@ -16650,7 +16636,7 @@
16650
16636
  },
16651
16637
  {
16652
16638
  "file": "packages/@ember/routing/route.ts",
16653
- "line": 2192,
16639
+ "line": 2193,
16654
16640
  "description": "This action is called when one or more query params have changed. Bubbles.",
16655
16641
  "itemtype": "method",
16656
16642
  "name": "queryParamsDidChange",
@@ -19125,7 +19111,7 @@
19125
19111
  },
19126
19112
  {
19127
19113
  "message": "replacing incorrect tag: returns with return",
19128
- "line": " packages/@ember/routing/route.ts:2192"
19114
+ "line": " packages/@ember/routing/route.ts:2193"
19129
19115
  },
19130
19116
  {
19131
19117
  "message": "unknown tag: internal",
@@ -19725,7 +19711,7 @@
19725
19711
  },
19726
19712
  {
19727
19713
  "message": "Missing item type",
19728
- "line": " packages/@ember/routing/route.ts:1590"
19714
+ "line": " packages/@ember/routing/route.ts:1591"
19729
19715
  },
19730
19716
  {
19731
19717
  "message": "Missing item type\nFinds the name of the substate route if it exists for the given route. A\nsubstate route is of the form `route_state`, such as `foo_loading`.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-source",
3
- "version": "5.4.0-alpha.2",
3
+ "version": "5.4.0-alpha.3",
4
4
  "description": "A JavaScript framework for creating ambitious web applications",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -186,7 +186,7 @@
186
186
  "node": "16.20.0",
187
187
  "yarn": "1.22.19"
188
188
  },
189
- "_originalVersion": "5.4.0-alpha.2",
189
+ "_originalVersion": "5.4.0-alpha.3",
190
190
  "_versionPreviouslyCalculated": true,
191
191
  "publishConfig": {
192
192
  "tag": "alpha"
@@ -44,13 +44,13 @@ declare module '@ember/renderer' {
44
44
  <ProfileCard @name={{this.person.name}} />
45
45
  `);
46
46
 
47
- assert.dom(this.element).hasText('John');
47
+ assert.dom().hasText('John');
48
48
 
49
49
  this.person.name = 'Jane';
50
50
 
51
51
  await renderSettled(); // Wait until rendering has completed.
52
52
 
53
- assert.dom(this.element).hasText('Jane');
53
+ assert.dom().hasText('Jane');
54
54
  });
55
55
  });
56
56
  ```
@@ -3,7 +3,7 @@ declare module '@ember/routing/lib/controller_for' {
3
3
  import type { FactoryClass, InternalFactory } from '@ember/-internals/owner';
4
4
  import type { RegisterOptions } from '@ember/owner';
5
5
  /**
6
- @module ember/routing
6
+ @module @ember/routing
7
7
  */
8
8
  /**
9
9
  Finds a controller instance.
@@ -2,7 +2,7 @@ declare module '@ember/routing/lib/generate_controller' {
2
2
  import type { InternalFactory, default as Owner } from '@ember/-internals/owner';
3
3
  import Controller from '@ember/controller';
4
4
  /**
5
- @module ember/routing
5
+ @module @ember/routing
6
6
  */
7
7
  /**
8
8
  Generates a controller factory