ember-source 7.3.0-alpha.5 → 7.4.0-alpha.1
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/dev/packages/@ember/-internals/deprecations/index.js +9 -0
- package/dist/dev/packages/@ember/-internals/glimmer/index.js +7 -7
- package/dist/dev/packages/@ember/-internals/routing/index.js +2 -2
- package/dist/dev/packages/@ember/-internals/runtime/index.js +1 -1
- package/dist/dev/packages/@ember/-internals/runtime/lib/ext/rsvp.js +1 -1
- package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/action_handler.js +4 -0
- package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +3 -0
- package/dist/dev/packages/@ember/-internals/views/lib/mixins/action_support.js +2 -0
- package/dist/dev/packages/@ember/application/index.js +3 -3
- package/dist/dev/packages/@ember/application/instance.js +9 -9
- package/dist/dev/packages/@ember/component/helper.js +2 -2
- package/dist/dev/packages/@ember/component/index.js +3 -3
- package/dist/dev/packages/@ember/engine/index.js +3 -3
- package/dist/dev/packages/@ember/engine/instance.js +1 -1
- package/dist/dev/packages/@ember/helper/index.js +1132 -79
- package/dist/dev/packages/@ember/modifier/on.js +1 -1
- package/dist/dev/packages/@ember/object/compat.js +0 -32
- package/dist/dev/packages/@ember/renderer/index.js +1 -1
- package/dist/dev/packages/@ember/routing/-internals.js +2 -2
- package/dist/dev/packages/@ember/routing/index.js +11 -28
- package/dist/dev/packages/@ember/routing/lib/utils.js +2 -2
- package/dist/dev/packages/@ember/routing/route.js +2 -2
- package/dist/dev/packages/@ember/routing/router-service.js +9 -9
- package/dist/dev/packages/@ember/routing/router.js +2 -2
- package/dist/dev/packages/@ember/template-compiler/lib/compile-options.js +3 -3
- package/dist/dev/packages/@ember/template-compiler/lib/template.js +2 -2
- package/dist/dev/packages/@ember/template-factory/index.js +1 -1
- package/dist/dev/packages/@glimmer/opcode-compiler/index.js +2 -2
- package/dist/dev/packages/@glimmer/program/index.js +3 -3
- package/dist/dev/packages/@glimmer/runtime/index.js +7 -7
- package/dist/dev/packages/@glimmer/wire-format/index.js +2 -5
- package/dist/dev/packages/ember/version.js +1 -1
- package/dist/dev/packages/ember-template-compiler/index.js +2 -2
- package/dist/dev/packages/router_js/index.js +2 -2
- package/dist/dev/packages/rsvp/index.js +1 -2281
- package/dist/dev/packages/shared-chunks/{arguments-CDkbOqTS.js → arguments-DniR8eF2.js} +5 -18
- package/dist/dev/packages/shared-chunks/{compiler-QUSl_urU.js → compiler-BHFFl-fv.js} +1 -1
- package/dist/dev/packages/shared-chunks/{curly-BbL6STF2.js → curly-BCD_vyHq.js} +1 -1
- package/dist/dev/packages/shared-chunks/{element-BYLB-q7a.js → element-Cgoi4ldD.js} +0 -24
- package/dist/dev/packages/shared-chunks/get-zsePWrJL.js +40 -0
- package/dist/dev/packages/shared-chunks/hash-BFu91gtE.js +57 -0
- package/dist/dev/packages/shared-chunks/{index-DaFzpTIE.js → index-BYUSIu_W.js} +3 -3
- package/dist/dev/packages/shared-chunks/{index-Czn34wUZ.js → index-Bv9SQpEx.js} +218 -78
- package/dist/dev/packages/shared-chunks/{invoke-d9sqa50M.js → invoke-CgF42joE.js} +1 -1
- package/dist/dev/packages/shared-chunks/{not-DYh6AY9Z.js → not-0cVb-rLf.js} +1 -1
- package/dist/dev/packages/shared-chunks/{on-DlF0Wy7P.js → on-CVIjn2C-.js} +22 -11
- package/dist/dev/packages/shared-chunks/{opcodes-CplRyHl_.js → opcodes-DDajoGhq.js} +0 -4
- package/dist/dev/packages/shared-chunks/{outlet-B4qORyui.js → outlet-BO5-QFmm.js} +3 -3
- package/dist/dev/packages/shared-chunks/{program-context-Dq8xN2HI.js → program-context-BBB1Ga5h.js} +2 -2
- package/dist/dev/packages/shared-chunks/{render-CtH73XOv.js → render-D_Rawf-r.js} +2 -2
- package/dist/{prod/packages/shared-chunks/rsvp.es-DR7yS7qg.js → dev/packages/shared-chunks/rsvp-aLN_pQtn.js} +152 -148
- package/dist/dev/packages/shared-chunks/{setup-registry-h519ZsHS.js → setup-registry-Ci8Af2Bz.js} +35 -13
- package/dist/{prod/packages/shared-chunks/syscall-ops-CN7STuUn.js → dev/packages/shared-chunks/syscall-ops-CkPT1Kfx.js} +1 -2
- package/dist/dev/packages/shared-chunks/{textarea-DEvw4ezm.js → textarea-DvS6Xmdh.js} +3 -23
- package/dist/dev/packages/shared-chunks/{unique-id-DQOhouG1.js → unique-id-Csxuh1I7.js} +0 -4
- package/dist/dev/packages/shared-chunks/{unrecognized-url-error-B8loxkay.js → unrecognized-url-error-cXUp-SK3.js} +1 -1
- package/dist/prod/packages/@ember/-internals/deprecations/index.js +9 -0
- package/dist/prod/packages/@ember/-internals/glimmer/index.js +7 -7
- package/dist/prod/packages/@ember/-internals/routing/index.js +2 -2
- package/dist/prod/packages/@ember/-internals/runtime/index.js +1 -1
- package/dist/prod/packages/@ember/-internals/runtime/lib/ext/rsvp.js +1 -1
- package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/action_handler.js +4 -0
- package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +3 -0
- package/dist/prod/packages/@ember/-internals/views/lib/mixins/action_support.js +2 -0
- package/dist/prod/packages/@ember/application/index.js +3 -3
- package/dist/prod/packages/@ember/application/instance.js +9 -9
- package/dist/prod/packages/@ember/component/helper.js +2 -2
- package/dist/prod/packages/@ember/component/index.js +3 -3
- package/dist/prod/packages/@ember/engine/index.js +3 -3
- package/dist/prod/packages/@ember/engine/instance.js +1 -1
- package/dist/prod/packages/@ember/helper/index.js +1132 -79
- package/dist/prod/packages/@ember/modifier/on.js +1 -1
- package/dist/prod/packages/@ember/object/compat.js +0 -32
- package/dist/prod/packages/@ember/renderer/index.js +1 -1
- package/dist/prod/packages/@ember/routing/index.js +10 -27
- package/dist/prod/packages/@ember/routing/lib/utils.js +2 -2
- package/dist/prod/packages/@ember/routing/route.js +2 -2
- package/dist/prod/packages/@ember/routing/router-service.js +9 -9
- package/dist/prod/packages/@ember/routing/router.js +2 -2
- package/dist/prod/packages/@ember/template-compiler/lib/compile-options.js +3 -3
- package/dist/prod/packages/@ember/template-compiler/lib/template.js +2 -2
- package/dist/prod/packages/@ember/template-factory/index.js +1 -1
- package/dist/prod/packages/@glimmer/opcode-compiler/index.js +2 -2
- package/dist/prod/packages/@glimmer/program/index.js +3 -3
- package/dist/prod/packages/@glimmer/runtime/index.js +7 -7
- package/dist/prod/packages/@glimmer/wire-format/index.js +2 -5
- package/dist/prod/packages/ember/version.js +1 -1
- package/dist/prod/packages/ember-template-compiler/index.js +2 -2
- package/dist/prod/packages/router_js/index.js +2 -2
- package/dist/prod/packages/rsvp/index.js +1 -2281
- package/dist/prod/packages/shared-chunks/{arguments-BzAkZVBa.js → arguments-CCYATlEH.js} +1 -18
- package/dist/prod/packages/shared-chunks/{compiler-lBSssiWp.js → compiler-Wt5SWcrF.js} +1 -1
- package/dist/prod/packages/shared-chunks/{curly-CU2jYOtm.js → curly-CdvJuTyW.js} +1 -1
- package/dist/prod/packages/shared-chunks/{element-DgHdPZ8u.js → element-BmBjPjkQ.js} +0 -24
- package/dist/prod/packages/shared-chunks/get-CEjFJzGs.js +40 -0
- package/dist/prod/packages/shared-chunks/hash-BitfXhCx.js +57 -0
- package/dist/prod/packages/shared-chunks/{index-XmtQRWbX.js → index-D8cl-pfl.js} +218 -78
- package/dist/prod/packages/shared-chunks/{index-Bf53M8eS.js → index-kwuZeaNz.js} +3 -3
- package/dist/prod/packages/shared-chunks/{invoke-DhQ5QRp2.js → invoke-4JGJYH7Z.js} +1 -1
- package/dist/prod/packages/shared-chunks/{not-BOIVROuv.js → not-Dn5s9qVZ.js} +1 -1
- package/dist/prod/packages/shared-chunks/{on-BZHAxzdq.js → on-ov4KAucw.js} +22 -11
- package/dist/prod/packages/shared-chunks/{opcodes-CplRyHl_.js → opcodes-DDajoGhq.js} +0 -4
- package/dist/prod/packages/shared-chunks/{outlet-CsNMfeOj.js → outlet-BWnaVOrA.js} +3 -3
- package/dist/prod/packages/shared-chunks/{program-context-COSioH46.js → program-context-WVlzpPdi.js} +2 -2
- package/dist/prod/packages/shared-chunks/{render-Bf7GviCY.js → render-BAVl5E6X.js} +2 -2
- package/dist/{dev/packages/shared-chunks/rsvp.es-DR7yS7qg.js → prod/packages/shared-chunks/rsvp-aLN_pQtn.js} +152 -148
- package/dist/prod/packages/shared-chunks/{setup-registry-DFSQHIUs.js → setup-registry-DeyoFe6Q.js} +35 -13
- package/dist/{dev/packages/shared-chunks/syscall-ops-CN7STuUn.js → prod/packages/shared-chunks/syscall-ops-CkPT1Kfx.js} +1 -2
- package/dist/prod/packages/shared-chunks/{textarea-DMmdvgk2.js → textarea-B-sssXGa.js} +3 -23
- package/dist/prod/packages/shared-chunks/{unique-id-o2pS74go.js → unique-id-BJb1p8EG.js} +0 -4
- package/dist/prod/packages/shared-chunks/{unrecognized-url-error-jjQ-FqKB.js → unrecognized-url-error-xC654tCo.js} +1 -1
- package/docs/data.json +1237 -1395
- package/package.json +52 -47
- package/types/stable/@ember/-internals/deprecations/index.d.ts +6 -0
- package/types/stable/@ember/-internals/glimmer/index.d.ts +7 -380
- package/types/stable/@ember/-internals/glimmer/lib/component.d.ts +1 -1
- package/types/stable/@ember/-internals/glimmer/lib/helper.d.ts +2 -2
- package/types/stable/@ember/-internals/glimmer/lib/helpers/each-in.d.ts +196 -63
- package/types/stable/@ember/-internals/glimmer/lib/helpers/element.d.ts +0 -24
- package/types/stable/@ember/-internals/glimmer/lib/helpers/mut.d.ts +3 -2
- package/types/stable/@ember/-internals/glimmer/lib/helpers/readonly.d.ts +3 -1
- package/types/stable/@ember/-internals/glimmer/lib/helpers/unbound.d.ts +6 -2
- package/types/stable/@ember/-internals/glimmer/lib/helpers/unique-id.d.ts +0 -3
- package/types/stable/@ember/-internals/glimmer/lib/syntax/mount.d.ts +4 -2
- package/types/stable/@ember/-internals/glimmer/lib/syntax/outlet.d.ts +7 -2
- package/types/stable/@ember/helper/index.d.ts +1113 -73
- package/types/stable/@ember/object/compat.d.ts +0 -32
- package/types/stable/@ember/object/core.d.ts +1 -1
- package/types/stable/@ember/routing/router-service.d.ts +9 -9
- package/types/stable/@glimmer/interfaces/lib/compile/wire-format/api.d.ts +1 -9
- package/types/stable/@glimmer/interfaces/lib/compile/wire-format/opcodes.d.ts +0 -4
- package/types/stable/@glimmer/interfaces/lib/vm-opcodes.d.ts +0 -4
- package/types/stable/@glimmer/opcode-compiler/lib/opcode-builder/helpers/conditional.d.ts +1 -1
- package/types/stable/@glimmer/opcode-compiler/lib/syntax/statements.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/helpers/array.d.ts +0 -33
- package/types/stable/@glimmer/runtime/lib/helpers/concat.d.ts +0 -25
- package/types/stable/@glimmer/runtime/lib/helpers/fn.d.ts +0 -70
- package/types/stable/@glimmer/runtime/lib/helpers/get.d.ts +0 -69
- package/types/stable/@glimmer/runtime/lib/helpers/hash.d.ts +0 -36
- package/types/stable/index.d.ts +0 -14
- package/dist/dev/packages/shared-chunks/get-6I3sjd-I.js +0 -135
- package/dist/dev/packages/shared-chunks/hash-6NDs_5_f.js +0 -198
- package/dist/prod/packages/shared-chunks/get-Dago5uGl.js +0 -135
- package/dist/prod/packages/shared-chunks/hash-gEXIsSO4.js +0 -198
- package/types/stable/@ember/-internals/glimmer/lib/helpers/array.d.ts +0 -43
- package/types/stable/@ember/-internals/glimmer/lib/helpers/component.d.ts +0 -93
- package/types/stable/@ember/-internals/glimmer/lib/helpers/concat.d.ts +0 -32
- package/types/stable/@ember/-internals/glimmer/lib/helpers/fn.d.ts +0 -77
- package/types/stable/@ember/-internals/glimmer/lib/helpers/get.d.ts +0 -94
- package/types/stable/@ember/-internals/glimmer/lib/helpers/hash.d.ts +0 -46
- package/types/stable/@ember/-internals/glimmer/lib/helpers/helper.d.ts +0 -43
- package/types/stable/@ember/-internals/glimmer/lib/helpers/if-unless.d.ts +0 -228
- package/types/stable/@ember/-internals/glimmer/lib/helpers/log.d.ts +0 -19
- package/types/stable/@ember/-internals/glimmer/lib/helpers/modifier.d.ts +0 -42
- package/types/stable/@ember/-internals/glimmer/lib/helpers/page-title.d.ts +0 -24
- package/types/stable/@ember/-internals/glimmer/lib/modifiers/on.d.ts +0 -95
- package/types/stable/@ember/-internals/glimmer/lib/syntax/in-element.d.ts +0 -49
- package/types/stable/@ember/-internals/glimmer/lib/syntax/let.d.ts +0 -43
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as on$1 } from '../../shared-chunks/on-
|
|
1
|
+
import { o as on$1 } from '../../shared-chunks/on-CVIjn2C-.js';
|
|
2
2
|
|
|
3
3
|
// In normal TypeScript, this modifier is essentially an opaque token that just
|
|
4
4
|
// needs to be importable. Declaring it with a unique interface like this,
|
|
@@ -59,38 +59,6 @@ let wrapGetterSetter = function (target, key, desc) {
|
|
|
59
59
|
}
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
Classic Example:
|
|
63
|
-
|
|
64
|
-
```js
|
|
65
|
-
import { tracked } from '@glimmer/tracking';
|
|
66
|
-
import { dependentKeyCompat } from '@ember/object/compat';
|
|
67
|
-
import EmberObject, { computed, observer, set } from '@ember/object';
|
|
68
|
-
|
|
69
|
-
const Person = EmberObject.extend({
|
|
70
|
-
firstName: tracked(),
|
|
71
|
-
lastName: tracked(),
|
|
72
|
-
|
|
73
|
-
fullName: dependentKeyCompat(function() {
|
|
74
|
-
return `${this.firstName} ${this.lastName}`;
|
|
75
|
-
}),
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
const Profile = EmberObject.extend({
|
|
79
|
-
person: null,
|
|
80
|
-
|
|
81
|
-
helloMessage: computed('person.fullName', function() {
|
|
82
|
-
return `Hello, ${this.person.fullName}!`;
|
|
83
|
-
}),
|
|
84
|
-
|
|
85
|
-
onNameUpdated: observer('person.fullName', function() {
|
|
86
|
-
console.log('person name updated!');
|
|
87
|
-
}),
|
|
88
|
-
});
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
`dependentKeyCompat()` can receive a getter function or an object containing
|
|
92
|
-
`get`/`set` methods when used in classic classes, like computed properties.
|
|
93
|
-
|
|
94
62
|
In general, only properties which you _expect_ to be watched by older,
|
|
95
63
|
untracked clases should be marked as dependency compatible. The decorator is
|
|
96
64
|
meant as an interop layer for parts of Ember's older classic APIs, and should
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { r as renderComponent, a as renderSettled } from '../../shared-chunks/index-
|
|
1
|
+
export { r as renderComponent, a as renderSettled } from '../../shared-chunks/index-Bv9SQpEx.js';
|
|
@@ -9,5 +9,5 @@ import '../../shared-chunks/property_get-DXwpgTe7.js';
|
|
|
9
9
|
import '../debug/index.js';
|
|
10
10
|
import '../engine/instance.js';
|
|
11
11
|
import '../../route-recognizer/index.js';
|
|
12
|
-
import '../../shared-chunks/rsvp
|
|
13
|
-
import '../../shared-chunks/unrecognized-url-error-
|
|
12
|
+
import '../../shared-chunks/rsvp-aLN_pQtn.js';
|
|
13
|
+
import '../../shared-chunks/unrecognized-url-error-cXUp-SK3.js';
|
|
@@ -8,7 +8,7 @@ import { service } from '../service/index.js';
|
|
|
8
8
|
import { c as consumeTag, g as createCache, h as getValue, u as untrack } from '../../shared-chunks/cache-DGDPVCpC.js';
|
|
9
9
|
import { t as tagFor } from '../../shared-chunks/meta-BqC7f9Ia.js';
|
|
10
10
|
import { on } from '../modifier/on.js';
|
|
11
|
-
import { t as templateFactory } from '../../shared-chunks/index-
|
|
11
|
+
import { t as templateFactory } from '../../shared-chunks/index-BYUSIu_W.js';
|
|
12
12
|
import { I as InternalComponent, o as opaquify } from '../../shared-chunks/internal-DTOXyEGM.js';
|
|
13
13
|
import { d as decorateFieldV2, i as initializeDeferredDecorator, a as decorateMethodV2 } from '../../shared-chunks/runtime-CYyqkz5q-BOdRhmsS.js';
|
|
14
14
|
import { assert } from '../debug/lib/assert.js';
|
|
@@ -58,6 +58,10 @@ function isQueryParams(value) {
|
|
|
58
58
|
return typeof value === 'object' && value !== null && value['isQueryParams'] === true;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
/**
|
|
62
|
+
@module @ember/routing
|
|
63
|
+
*/
|
|
64
|
+
|
|
61
65
|
/**
|
|
62
66
|
The `LinkTo` component renders a link to the supplied `routeName` passing an optionally
|
|
63
67
|
supplied model to the route as its `model` context of the route. The block for `LinkTo`
|
|
@@ -265,35 +269,11 @@ function isQueryParams(value) {
|
|
|
265
269
|
</a>
|
|
266
270
|
```
|
|
267
271
|
|
|
268
|
-
@for Ember.Templates.components
|
|
269
|
-
@method LinkTo
|
|
270
|
-
@public
|
|
271
|
-
*/
|
|
272
|
-
|
|
273
|
-
/**
|
|
274
|
-
@module @ember/routing
|
|
275
|
-
*/
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
See [Ember.Templates.components.LinkTo](/ember/release/classes/Ember.Templates.components/methods/input?anchor=LinkTo).
|
|
279
|
-
|
|
280
|
-
@for Ember.Templates.helpers
|
|
281
|
-
@method link-to
|
|
282
|
-
@see {Ember.Templates.components.LinkTo}
|
|
283
|
-
@public
|
|
284
|
-
**/
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
An opaque interface which can be imported and used in strict-mode
|
|
288
|
-
templates to call <LinkTo>.
|
|
289
|
-
|
|
290
|
-
See [Ember.Templates.components.LinkTo](/ember/release/classes/Ember.Templates.components/methods/input?anchor=LinkTo).
|
|
291
|
-
|
|
292
272
|
@for @ember/routing
|
|
293
273
|
@method LinkTo
|
|
294
|
-
@
|
|
274
|
+
@static
|
|
295
275
|
@public
|
|
296
|
-
|
|
276
|
+
*/
|
|
297
277
|
|
|
298
278
|
class _LinkTo extends InternalComponent {
|
|
299
279
|
static toString() {
|
|
@@ -431,7 +411,10 @@ class _LinkTo extends InternalComponent {
|
|
|
431
411
|
get query() {
|
|
432
412
|
if ('query' in this.args.named) {
|
|
433
413
|
let query = this.named('query');
|
|
434
|
-
(
|
|
414
|
+
if (query === null || query === undefined) {
|
|
415
|
+
return EMPTY_QUERY_PARAMS;
|
|
416
|
+
}
|
|
417
|
+
(!(typeof query === 'object') && assert('The `@query` argument to the <LinkTo> component must be an object.', typeof query === 'object'));
|
|
435
418
|
return {
|
|
436
419
|
...query
|
|
437
420
|
};
|
|
@@ -3,8 +3,8 @@ import { getOwner } from '../../-internals/owner/index.js';
|
|
|
3
3
|
import '../../debug/index.js';
|
|
4
4
|
import EngineInstance from '../../engine/instance.js';
|
|
5
5
|
import '../../../route-recognizer/index.js';
|
|
6
|
-
import '../../../shared-chunks/rsvp
|
|
7
|
-
import { S as STATE_SYMBOL } from '../../../shared-chunks/unrecognized-url-error-
|
|
6
|
+
import '../../../shared-chunks/rsvp-aLN_pQtn.js';
|
|
7
|
+
import { S as STATE_SYMBOL } from '../../../shared-chunks/unrecognized-url-error-cXUp-SK3.js';
|
|
8
8
|
import { assert } from '../../debug/lib/assert.js';
|
|
9
9
|
|
|
10
10
|
const ALL_PERIODS_REGEX = /\./g;
|
|
@@ -22,8 +22,8 @@ import { dependentKeyCompat } from '../object/compat.js';
|
|
|
22
22
|
import { once } from '../runloop/index.js';
|
|
23
23
|
import { c as hasInternalComponentManager } from '../../shared-chunks/api-DuLOZMO_.js';
|
|
24
24
|
import '../../route-recognizer/index.js';
|
|
25
|
-
import '../../shared-chunks/rsvp
|
|
26
|
-
import { S as STATE_SYMBOL, P as PARAMS_SYMBOL } from '../../shared-chunks/unrecognized-url-error-
|
|
25
|
+
import '../../shared-chunks/rsvp-aLN_pQtn.js';
|
|
26
|
+
import { S as STATE_SYMBOL, P as PARAMS_SYMBOL } from '../../shared-chunks/unrecognized-url-error-cXUp-SK3.js';
|
|
27
27
|
import generateController from './lib/generate_controller.js';
|
|
28
28
|
import { prefixRouteNameArg, stashParamNames, calculateCacheKey, normalizeControllerQueryParams } from './lib/utils.js';
|
|
29
29
|
import { a as decorateMethodV2 } from '../../shared-chunks/runtime-CYyqkz5q-BOdRhmsS.js';
|
|
@@ -40,7 +40,7 @@ function cleanURL(url, rootURL) {
|
|
|
40
40
|
In this example, the Router service is injected into a component to initiate a transition
|
|
41
41
|
to a dedicated route:
|
|
42
42
|
|
|
43
|
-
```app/components/example.gjs
|
|
43
|
+
```gjs {data-filename="app/components/example.gjs"}
|
|
44
44
|
import Component from '@glimmer/component';
|
|
45
45
|
import { action } from '@ember/object';
|
|
46
46
|
import { service } from '@ember/service';
|
|
@@ -89,7 +89,7 @@ class RouterService extends Service.extend(Evented) {
|
|
|
89
89
|
In the following example we use the Router service to navigate to a route with a
|
|
90
90
|
specific model from a Component in the first action, and in the second we trigger
|
|
91
91
|
a query-params only transition.
|
|
92
|
-
```app/components/example.gjs
|
|
92
|
+
```gjs {data-filename="app/components/example.gjs"}
|
|
93
93
|
import Component from '@glimmer/component';
|
|
94
94
|
import { action } from '@ember/object';
|
|
95
95
|
import { service } from '@ember/service';
|
|
@@ -174,14 +174,14 @@ class RouterService extends Service.extend(Evented) {
|
|
|
174
174
|
URL is returned as a string that can be used for any purpose.
|
|
175
175
|
In this example, the URL for the `author.books` route for a given author
|
|
176
176
|
is copied to the clipboard.
|
|
177
|
-
```app/templates/application.gjs
|
|
177
|
+
```gjs {data-filename="app/templates/application.gjs"}
|
|
178
178
|
import CopyLink from '../components/copy-link';
|
|
179
179
|
|
|
180
180
|
<template>
|
|
181
181
|
<CopyLink @author={{hash id="tomster" name="Tomster"}} />
|
|
182
182
|
</template>
|
|
183
183
|
```
|
|
184
|
-
```app/components/copy-link.gjs
|
|
184
|
+
```gjs {data-filename="app/components/copy-link.gjs"}
|
|
185
185
|
import Component from '@glimmer/component';
|
|
186
186
|
import { service } from '@ember/service';
|
|
187
187
|
import { action } from '@ember/object';
|
|
@@ -200,13 +200,13 @@ class RouterService extends Service.extend(Evented) {
|
|
|
200
200
|
```
|
|
201
201
|
Just like with `transitionTo` and `replaceWith`, `urlFor` can also handle
|
|
202
202
|
query parameters.
|
|
203
|
-
```app/templates/application.gjs
|
|
203
|
+
```gjs {data-filename="app/templates/application.gjs"}
|
|
204
204
|
import CopyLink from '../components/copy-link';
|
|
205
205
|
<template>
|
|
206
206
|
<CopyLink @author={{hash id="tomster" name="Tomster"}} />
|
|
207
207
|
</template>
|
|
208
208
|
```
|
|
209
|
-
```app/components/copy-link.gjs
|
|
209
|
+
```gjs {data-filename="app/components/copy-link.gjs"}
|
|
210
210
|
import Component from '@glimmer/component';
|
|
211
211
|
import { service } from '@ember/service';
|
|
212
212
|
import { action } from '@ember/object';
|
|
@@ -243,7 +243,7 @@ class RouterService extends Service.extend(Evented) {
|
|
|
243
243
|
See [model](api/ember/release/classes/Route/methods/model?anchor=model) and
|
|
244
244
|
[queryParams](/api/ember/3.7/classes/Route/properties/queryParams?anchor=queryParams) for more information about these arguments.
|
|
245
245
|
In the following example, `isActive` will return `true` if the current route is `/posts`.
|
|
246
|
-
```app/components/posts.gjs
|
|
246
|
+
```gjs {data-filename="app/components/posts.gjs"}
|
|
247
247
|
import Component from '@glimmer/component';
|
|
248
248
|
import { service } from '@ember/service';
|
|
249
249
|
export default class extends Component {
|
|
@@ -255,7 +255,7 @@ class RouterService extends Service.extend(Evented) {
|
|
|
255
255
|
```
|
|
256
256
|
The next example includes a dynamic segment, and will return `true` if the current route is `/posts/1`,
|
|
257
257
|
assuming the post has an id of 1:
|
|
258
|
-
```app/components/posts.gjs
|
|
258
|
+
```gjs {data-filename="app/components/posts.gjs"}
|
|
259
259
|
import Component from '@glimmer/component';
|
|
260
260
|
import { service } from '@ember/service';
|
|
261
261
|
export default class extends Component {
|
|
@@ -632,7 +632,7 @@ class RouterService extends Service.extend(Evented) {
|
|
|
632
632
|
happens (even when that transition only changes parameters
|
|
633
633
|
and doesn't change the active route).
|
|
634
634
|
Usage example:
|
|
635
|
-
```app/components/header.gjs
|
|
635
|
+
```gjs {data-filename="app/components/header.gjs"}
|
|
636
636
|
import Component from '@glimmer/component';
|
|
637
637
|
import { service } from '@ember/service';
|
|
638
638
|
import { notEmpty } from '@ember/object/computed';
|
|
@@ -15,8 +15,8 @@ import { info } from '../debug/index.js';
|
|
|
15
15
|
import { run, once, scheduleOnce, cancel } from '../runloop/index.js';
|
|
16
16
|
import { getRenderState, getFullQueryParams, hasDefaultSerialize, defaultSerialize } from './route.js';
|
|
17
17
|
import Router from '../../router_js/index.js';
|
|
18
|
-
import { S as STATE_SYMBOL, l as logAbort } from '../../shared-chunks/unrecognized-url-error-
|
|
19
|
-
import '../../shared-chunks/rsvp
|
|
18
|
+
import { S as STATE_SYMBOL, l as logAbort } from '../../shared-chunks/unrecognized-url-error-cXUp-SK3.js';
|
|
19
|
+
import '../../shared-chunks/rsvp-aLN_pQtn.js';
|
|
20
20
|
import EngineInstance from '../engine/instance.js';
|
|
21
21
|
import { assert } from '../debug/lib/assert.js';
|
|
22
22
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { o as or, d as not, c as lte, l as lt, b as gte, g as gt, n as neq, a as and, e as eq } from '../../../shared-chunks/not-
|
|
2
|
-
import { h as hash, f as fn, a as array } from '../../../shared-chunks/hash-
|
|
3
|
-
import { e as element } from '../../../shared-chunks/element-
|
|
1
|
+
import { o as or, d as not, c as lte, l as lt, b as gte, g as gt, n as neq, a as and, e as eq } from '../../../shared-chunks/not-0cVb-rLf.js';
|
|
2
|
+
import { h as hash, f as fn, a as array } from '../../../shared-chunks/hash-BFu91gtE.js';
|
|
3
|
+
import { e as element } from '../../../shared-chunks/element-Cgoi4ldD.js';
|
|
4
4
|
import { on } from '../../modifier/on.js';
|
|
5
5
|
import '../../debug/index.js';
|
|
6
6
|
import { STRICT_MODE_KEYWORDS, STRICT_MODE_TRANSFORMS, RESOLUTION_MODE_TRANSFORMS } from './plugins/index.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import './plugins/allowed-globals.js';
|
|
2
2
|
import templateOnly from '../../component/template-only.js';
|
|
3
|
-
import { p as precompile } from '../../../shared-chunks/compiler-
|
|
3
|
+
import { p as precompile } from '../../../shared-chunks/compiler-BHFFl-fv.js';
|
|
4
4
|
import { s as setComponentTemplate } from '../../../shared-chunks/template-R_5UMHhb.js';
|
|
5
|
-
import { t as templateFactory } from '../../../shared-chunks/index-
|
|
5
|
+
import { t as templateFactory } from '../../../shared-chunks/index-BYUSIu_W.js';
|
|
6
6
|
import compileOptions, { RUNTIME_KEYWORDS_NAME, keywords } from './compile-options.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as createTemplateFactory } from '../../shared-chunks/index-
|
|
1
|
+
export { t as createTemplateFactory } from '../../shared-chunks/index-BYUSIu_W.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { E as EMPTY_BLOCKS, W as WrappedBuilder, c as compilable, b as compileStatements, I as invokeStaticBlock, d as invokeStaticBlockWithStack, m as meta, a as templateCacheCounters, e as templateCompilationContext, t as templateFactory } from '../../shared-chunks/index-
|
|
2
|
-
export { E as EvaluationContextImpl, S as StdLib, c as compileStd } from '../../shared-chunks/program-context-
|
|
1
|
+
export { E as EMPTY_BLOCKS, W as WrappedBuilder, c as compilable, b as compileStatements, I as invokeStaticBlock, d as invokeStaticBlockWithStack, m as meta, a as templateCacheCounters, e as templateCompilationContext, t as templateFactory } from '../../shared-chunks/index-BYUSIu_W.js';
|
|
2
|
+
export { E as EvaluationContextImpl, S as StdLib, c as compileStd } from '../../shared-chunks/program-context-BBB1Ga5h.js';
|
|
3
3
|
|
|
4
4
|
let debugCompiler;
|
|
5
5
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aG as constants } from '../../shared-chunks/syscall-ops-CkPT1Kfx.js';
|
|
2
2
|
import { e as expect } from '../../shared-chunks/collections-DPkjqeA3.js';
|
|
3
3
|
import { u as unwrapTemplate } from '../../shared-chunks/template-BRrQR6KS.js';
|
|
4
4
|
import { c as capabilityFlagsFrom, m as managerHasCapability } from '../../shared-chunks/capabilities-CajW4QjE.js';
|
|
5
5
|
import { g as getComponentTemplate } from '../../shared-chunks/template-R_5UMHhb.js';
|
|
6
6
|
import { a as getInternalHelperManager, b as getInternalModifierManager, g as getInternalComponentManager } from '../../shared-chunks/api-DuLOZMO_.js';
|
|
7
|
-
import { t as templateFactory } from '../../shared-chunks/index-
|
|
7
|
+
import { t as templateFactory } from '../../shared-chunks/index-BYUSIu_W.js';
|
|
8
8
|
import { e as enumerate } from '../../shared-chunks/array-utils-CZQxrdD3.js';
|
|
9
9
|
import { I as InternalComponentCapabilities } from '../../shared-chunks/flags-BZxHQ0yn.js';
|
|
10
|
-
import { o as opcodes } from '../../shared-chunks/opcodes-
|
|
10
|
+
import { o as opcodes } from '../../shared-chunks/opcodes-DDajoGhq.js';
|
|
11
11
|
import { a as ProgramHeapImpl } from '../../shared-chunks/program-DlgjqLa6.js';
|
|
12
12
|
export { P as ProgramImpl, R as RuntimeOpImpl } from '../../shared-chunks/program-DlgjqLa6.js';
|
|
13
13
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export { C as ConcreteBounds, a as CursorImpl, c as clear } from '../../shared-chunks/normalize-CKySQVU7.js';
|
|
2
|
-
export { D as DOMChanges, a as DynamicScopeImpl, E as EnvironmentImpl, b as IDOMChanges, L as LowLevelVM, S as ScopeImpl, U as UpdatingVM, i as inTransaction, c as isWhitespace, r as renderComponent, d as renderMain, e as renderSync, f as resetDebuggerCallback, g as runtimeOptions, s as setDebuggerCallback } from '../../shared-chunks/render-
|
|
2
|
+
export { D as DOMChanges, a as DynamicScopeImpl, E as EnvironmentImpl, b as IDOMChanges, L as LowLevelVM, S as ScopeImpl, U as UpdatingVM, i as inTransaction, c as isWhitespace, r as renderComponent, d as renderMain, e as renderSync, f as resetDebuggerCallback, g as runtimeOptions, s as setDebuggerCallback } from '../../shared-chunks/render-D_Rawf-r.js';
|
|
3
3
|
export { T as TEMPLATE_ONLY_COMPONENT_MANAGER, a as TemplateOnlyComponent, b as TemplateOnlyComponentManager, t as templateOnlyComponent } from '../../shared-chunks/template-only-Cu639ICT.js';
|
|
4
|
-
export { C as CurriedValue, E as EMPTY_ARGS, a as EMPTY_NAMED, b as EMPTY_POSITIONAL, c as createCapturedArgs, d as curry, r as reifyArgs, e as reifyNamed, f as reifyPositional } from '../../shared-chunks/arguments-
|
|
4
|
+
export { C as CurriedValue, E as EMPTY_ARGS, a as EMPTY_NAMED, b as EMPTY_POSITIONAL, c as createCapturedArgs, d as curry, r as reifyArgs, e as reifyNamed, f as reifyPositional } from '../../shared-chunks/arguments-DniR8eF2.js';
|
|
5
5
|
export { n as normalizeProperty } from '../../shared-chunks/props-fiqxqhAH.js';
|
|
6
|
-
export { a as and, e as eq, g as gt, b as gte, l as lt, c as lte, n as neq, d as not, o as or } from '../../shared-chunks/not-
|
|
7
|
-
export { a as array, f as fn, h as hash } from '../../shared-chunks/hash-
|
|
8
|
-
export { c as concat, g as get } from '../../shared-chunks/get-
|
|
9
|
-
export { i as invokeHelper } from '../../shared-chunks/invoke-
|
|
10
|
-
export { o as on } from '../../shared-chunks/on-
|
|
6
|
+
export { a as and, e as eq, g as gt, b as gte, l as lt, c as lte, n as neq, d as not, o as or } from '../../shared-chunks/not-0cVb-rLf.js';
|
|
7
|
+
export { a as array, f as fn, h as hash } from '../../shared-chunks/hash-BFu91gtE.js';
|
|
8
|
+
export { c as concat, g as get } from '../../shared-chunks/get-zsePWrJL.js';
|
|
9
|
+
export { i as invokeHelper } from '../../shared-chunks/invoke-CgF42joE.js';
|
|
10
|
+
export { o as on } from '../../shared-chunks/on-CVIjn2C-.js';
|
|
11
11
|
export { destroy, isDestroyed, isDestroying, registerDestructor } from '../destroyable/index.js';
|
|
12
12
|
import '../global-context/index.js';
|
|
13
13
|
import '../../shared-chunks/cache-DGDPVCpC.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as opcodes } from '../../shared-chunks/opcodes-
|
|
1
|
+
import { o as opcodes } from '../../shared-chunks/opcodes-DDajoGhq.js';
|
|
2
2
|
export { W as WellKnownAttrNames, a as WellKnownTagNames } from '../../shared-chunks/well-known-_EVO9RaV.js';
|
|
3
3
|
|
|
4
4
|
const resolution = {
|
|
@@ -27,9 +27,6 @@ function isStringLiteral(expr) {
|
|
|
27
27
|
function getStringFromValue(expr) {
|
|
28
28
|
return expr;
|
|
29
29
|
}
|
|
30
|
-
function isArgument(val) {
|
|
31
|
-
return val[0] === opcodes.StaticArg || val[0] === opcodes.DynamicArg;
|
|
32
|
-
}
|
|
33
30
|
function isHelper(expr) {
|
|
34
31
|
return Array.isArray(expr) && expr[0] === opcodes.Call;
|
|
35
32
|
}
|
|
@@ -37,4 +34,4 @@ function isHelper(expr) {
|
|
|
37
34
|
// Expressions
|
|
38
35
|
const isGet = is(opcodes.GetSymbol);
|
|
39
36
|
|
|
40
|
-
export { opcodes as SexpOpcodes, resolution as VariableResolutionContext, getStringFromValue, is,
|
|
37
|
+
export { opcodes as SexpOpcodes, resolution as VariableResolutionContext, getStringFromValue, is, isAttribute, isFlushElement, isGet, isHelper, isStringLiteral };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as precompile$1 } from '../shared-chunks/compiler-
|
|
2
|
-
export { a as _preprocess } from '../shared-chunks/compiler-
|
|
1
|
+
import { p as precompile$1 } from '../shared-chunks/compiler-BHFFl-fv.js';
|
|
2
|
+
export { a as _preprocess } from '../shared-chunks/compiler-BHFFl-fv.js';
|
|
3
3
|
import '../@ember/debug/index.js';
|
|
4
4
|
import { STRICT_MODE_KEYWORDS, STRICT_MODE_TRANSFORMS, RESOLUTION_MODE_TRANSFORMS } from '../@ember/template-compiler/lib/plugins/index.js';
|
|
5
5
|
import '../shared-chunks/get-debug-name-CSniHBsn.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import RouteRecognizer from '../route-recognizer/index.js';
|
|
2
|
-
import { P as Promise$1 } from '../shared-chunks/rsvp
|
|
3
|
-
import { Q as QUERY_PARAMS_SYMBOL, m as merge, i as isTransition, a as isParam, t as throwIfAborted, P as PARAMS_SYMBOL, p as prepareResult, b as isPromise, f as forEach, c as promiseLabel, U as UnrecognizedURLError, T as Transition, S as STATE_SYMBOL, g as getChangelist, d as log, l as logAbort, e as isTransitionAborted, h as extractQueryParams } from '../shared-chunks/unrecognized-url-error-
|
|
2
|
+
import { P as Promise$1 } from '../shared-chunks/rsvp-aLN_pQtn.js';
|
|
3
|
+
import { Q as QUERY_PARAMS_SYMBOL, m as merge, i as isTransition, a as isParam, t as throwIfAborted, P as PARAMS_SYMBOL, p as prepareResult, b as isPromise, f as forEach, c as promiseLabel, U as UnrecognizedURLError, T as Transition, S as STATE_SYMBOL, g as getChangelist, d as log, l as logAbort, e as isTransitionAborted, h as extractQueryParams } from '../shared-chunks/unrecognized-url-error-cXUp-SK3.js';
|
|
4
4
|
|
|
5
5
|
/* eslint-disable no-prototype-builtins */
|
|
6
6
|
let ROUTE_INFOS = new WeakMap();
|