ember-source 7.1.0-beta.1 → 7.1.0
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/glimmer/index.js +5 -5
- package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +1 -1
- package/dist/dev/packages/@ember/application/index.js +1 -1
- package/dist/dev/packages/@ember/application/instance.js +1 -1
- package/dist/dev/packages/@ember/array/index.js +4 -0
- package/dist/dev/packages/@ember/component/helper.js +1 -1
- package/dist/dev/packages/@ember/component/index.js +9 -3
- package/dist/dev/packages/@ember/engine/index.js +1 -1
- package/dist/dev/packages/@ember/helper/index.js +4 -23
- package/dist/dev/packages/@ember/modifier/on.js +1 -1
- package/dist/dev/packages/@ember/object/index.js +22 -17
- package/dist/dev/packages/@ember/renderer/index.js +1 -1
- package/dist/dev/packages/@ember/routing/index.js +8 -4
- package/dist/dev/packages/@ember/routing/route.js +1 -1
- package/dist/dev/packages/@ember/routing/router-service.js +19 -12
- package/dist/dev/packages/@ember/template-compiler/lib/compile-options.js +3 -3
- package/dist/dev/packages/@glimmer/runtime/index.js +4 -4
- package/dist/dev/packages/ember/version.js +1 -1
- package/dist/dev/packages/shared-chunks/{element-DQJOvSlQ.js → element-Cf3hqNOD.js} +2 -0
- package/dist/dev/packages/shared-chunks/{get-D5b5QlqE.js → get-BehtPmsu.js} +30 -33
- package/dist/dev/packages/shared-chunks/{hash-BRRFQJ99.js → hash-BTwOuDGQ.js} +15 -9
- package/dist/dev/packages/shared-chunks/{helper-Do7NCZHI.js → helper-BubrhyuN.js} +18 -6
- package/dist/dev/packages/shared-chunks/{index-CwnQYqK5.js → index-CL1zjHwo.js} +80 -102
- package/dist/dev/packages/shared-chunks/{on-BueSMv9L.js → on-BQii6ILK.js} +6 -6
- package/dist/dev/packages/shared-chunks/{or-O0eJQ4K-.js → or-BTH3yuFG.js} +1 -1
- package/dist/dev/packages/shared-chunks/{setup-registry-BC5VMvei.js → setup-registry-BQZJfq-Y.js} +2 -2
- package/dist/dev/packages/shared-chunks/{textarea-WSlUEr0y.js → textarea-lD4apgrP.js} +6 -2
- package/dist/prod/packages/@ember/-internals/glimmer/index.js +5 -5
- package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +1 -1
- package/dist/prod/packages/@ember/application/index.js +1 -1
- package/dist/prod/packages/@ember/application/instance.js +1 -1
- package/dist/prod/packages/@ember/array/index.js +4 -0
- package/dist/prod/packages/@ember/component/helper.js +1 -1
- package/dist/prod/packages/@ember/component/index.js +9 -3
- package/dist/prod/packages/@ember/engine/index.js +1 -1
- package/dist/prod/packages/@ember/helper/index.js +4 -23
- package/dist/prod/packages/@ember/modifier/on.js +1 -1
- package/dist/prod/packages/@ember/object/index.js +22 -17
- package/dist/prod/packages/@ember/renderer/index.js +1 -1
- package/dist/prod/packages/@ember/routing/index.js +8 -4
- package/dist/prod/packages/@ember/routing/route.js +1 -1
- package/dist/prod/packages/@ember/routing/router-service.js +19 -12
- package/dist/prod/packages/@ember/template-compiler/lib/compile-options.js +3 -3
- package/dist/prod/packages/@glimmer/runtime/index.js +4 -4
- package/dist/prod/packages/ember/version.js +1 -1
- package/dist/prod/packages/shared-chunks/{element-DUOVW5Ho.js → element-9DRa_9dO.js} +2 -0
- package/dist/prod/packages/shared-chunks/{get-t0-itmA-.js → get-Dt5L0TcU.js} +30 -33
- package/dist/prod/packages/shared-chunks/{hash-mcs3pEFO.js → hash-Dkj3I4L4.js} +15 -9
- package/dist/prod/packages/shared-chunks/{helper-DLjV2ZZW.js → helper-CN6UzshW.js} +18 -6
- package/dist/prod/packages/shared-chunks/{index-qDFz6Mfe.js → index-ClxHbCe9.js} +80 -102
- package/dist/prod/packages/shared-chunks/{on-B5NVufs_.js → on-CWgOWNSL.js} +6 -6
- package/dist/prod/packages/shared-chunks/{or-3AxY5TPj.js → or-Crsa2wci.js} +1 -1
- package/dist/prod/packages/shared-chunks/{setup-registry-C2KfZJWI.js → setup-registry-B3DhqtxX.js} +2 -2
- package/dist/prod/packages/shared-chunks/{textarea-CHqL0Rdh.js → textarea-Byj32raR.js} +6 -2
- package/docs/data.json +180 -180
- package/package.json +3 -6
- package/types/stable/@ember/-internals/glimmer/index.d.ts +165 -121
- package/types/stable/@ember/-internals/glimmer/lib/component.d.ts +8 -2
- package/types/stable/@ember/-internals/glimmer/lib/glimmer-tracking-docs.d.ts +12 -12
- package/types/stable/@ember/-internals/glimmer/lib/helper.d.ts +18 -6
- package/types/stable/@ember/-internals/glimmer/lib/helpers/array.d.ts +3 -1
- package/types/stable/@ember/-internals/glimmer/lib/helpers/component.d.ts +65 -121
- package/types/stable/@ember/-internals/glimmer/lib/helpers/concat.d.ts +8 -4
- package/types/stable/@ember/-internals/glimmer/lib/helpers/each-in.d.ts +16 -14
- package/types/stable/@ember/-internals/glimmer/lib/helpers/element.d.ts +2 -0
- package/types/stable/@ember/-internals/glimmer/lib/helpers/fn.d.ts +11 -7
- package/types/stable/@ember/-internals/glimmer/lib/helpers/get.d.ts +23 -29
- package/types/stable/@ember/-internals/glimmer/lib/helpers/hash.d.ts +3 -1
- package/types/stable/@ember/-internals/glimmer/lib/helpers/if-unless.d.ts +95 -49
- package/types/stable/@ember/-internals/glimmer/lib/helpers/mut.d.ts +23 -54
- package/types/stable/@ember/-internals/glimmer/lib/helpers/page-title.d.ts +6 -2
- package/types/stable/@ember/-internals/glimmer/lib/helpers/readonly.d.ts +4 -8
- package/types/stable/@ember/-internals/glimmer/lib/modifiers/on.d.ts +10 -10
- package/types/stable/@ember/-internals/glimmer/lib/syntax/in-element.d.ts +2 -0
- package/types/stable/@ember/-internals/glimmer/lib/syntax/let.d.ts +2 -14
- package/types/stable/@ember/-internals/glimmer/lib/syntax/mount.d.ts +15 -11
- package/types/stable/@ember/-internals/glimmer/lib/syntax/outlet.d.ts +17 -10
- package/types/stable/@ember/-internals/runtime/lib/mixins/target_action_support.d.ts +1 -1
- package/types/stable/@ember/array/index.d.ts +4 -0
- package/types/stable/@ember/controller/index.d.ts +1 -1
- package/types/stable/@ember/helper/index.d.ts +0 -19
- package/types/stable/@ember/object/index.d.ts +4 -3
- package/types/stable/@ember/object/observable.d.ts +4 -0
- package/types/stable/@ember/routing/route.d.ts +1 -1
- package/types/stable/@ember/routing/router-service.d.ts +20 -12
- package/types/stable/@glimmer/runtime/lib/helpers/array.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/helpers/concat.d.ts +8 -3
- package/types/stable/@glimmer/runtime/lib/helpers/fn.d.ts +13 -7
- package/types/stable/@glimmer/runtime/lib/helpers/get.d.ts +21 -29
- package/types/stable/@glimmer/runtime/lib/helpers/hash.d.ts +1 -1
- package/types/stable/@glimmer/syntax/lib/get-template-locals.d.ts +1 -1
- package/types/stable/@glimmer/tracking/index.d.ts +12 -12
package/build-metadata.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "7.1.0
|
|
2
|
+
"version": "7.1.0",
|
|
3
3
|
"buildType": "tag",
|
|
4
|
-
"SHA": "
|
|
5
|
-
"assetPath": "/tag/shas/
|
|
4
|
+
"SHA": "7c6f1709c1844fd40dc725150a67c9b0653d3492",
|
|
5
|
+
"assetPath": "/tag/shas/7c6f1709c1844fd40dc725150a67c9b0653d3492.tgz"
|
|
6
6
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
export { t as template, a as templateCacheCounters } from '../../../shared-chunks/index-CyZiGiEI.js';
|
|
2
|
-
export { R as RootTemplate, s as setupApplicationRegistry, a as setupEngineRegistry } from '../../../shared-chunks/setup-registry-
|
|
3
|
-
export { I as Input, T as Textarea } from '../../../shared-chunks/textarea-
|
|
2
|
+
export { R as RootTemplate, s as setupApplicationRegistry, a as setupEngineRegistry } from '../../../shared-chunks/setup-registry-BQZJfq-Y.js';
|
|
3
|
+
export { I as Input, T as Textarea } from '../../../shared-chunks/textarea-lD4apgrP.js';
|
|
4
4
|
export { LinkTo } from '../../routing/index.js';
|
|
5
5
|
export { default as Component, setComponentManager } from '../../component/index.js';
|
|
6
|
-
export { H as Helper, h as helper } from '../../../shared-chunks/helper-
|
|
6
|
+
export { H as Helper, h as helper } from '../../../shared-chunks/helper-BubrhyuN.js';
|
|
7
7
|
export { S as SafeString, T as TrustedHTML, h as htmlSafe, i as isHTMLSafe, a as isTrustedHTML, t as trustHTML } from '../../../shared-chunks/index-D-xTBV4B.js';
|
|
8
|
-
export { O as OutletView, R as Renderer, _ as _resetRenderers, a as renderComponent, r as renderSettled } from '../../../shared-chunks/index-
|
|
8
|
+
export { O as OutletView, R as Renderer, _ as _resetRenderers, a as renderComponent, r as renderSettled } from '../../../shared-chunks/index-CL1zjHwo.js';
|
|
9
9
|
export { D as DOMChanges } from '../../../shared-chunks/render-CpKaO-BO.js';
|
|
10
10
|
export { D as DOMTreeConstruction } from '../../../shared-chunks/element-builder--iTIJyCB.js';
|
|
11
11
|
import '../../../@glimmer/destroyable/index.js';
|
|
12
12
|
export { i as isSerializationFirstNode } from '../../../shared-chunks/rehydrate-builder-DCyIgnCR.js';
|
|
13
13
|
export { NodeDOMTreeConstruction } from '../../../@glimmer/node/index.js';
|
|
14
|
-
export { e as element } from '../../../shared-chunks/element-
|
|
14
|
+
export { e as element } from '../../../shared-chunks/element-Cf3hqNOD.js';
|
|
15
15
|
export { u as uniqueId } from '../../../shared-chunks/unique-id-CgmHQiwi.js';
|
|
16
16
|
export { c as componentCapabilities, m as modifierCapabilities } from '../../../shared-chunks/api-BAmlf_CN.js';
|
|
17
17
|
|
|
@@ -12,7 +12,7 @@ import { assert } from '../../../../debug/lib/assert.js';
|
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
`TargetActionSupport` is a mixin that can be included in a class
|
|
15
|
-
to add a `triggerAction` method with semantics similar to the
|
|
15
|
+
to add a `triggerAction` method with semantics similar to the
|
|
16
16
|
`{{action}}` helper. In normal Ember usage, the `{{action}}` helper is
|
|
17
17
|
usually the best choice. This mixin is most often useful when you are
|
|
18
18
|
doing more complex event handling in Components.
|
|
@@ -24,7 +24,7 @@ import BucketCache from '../routing/lib/cache.js';
|
|
|
24
24
|
import ApplicationInstance from './instance.js';
|
|
25
25
|
import Engine, { buildInitializerMethod } from '../engine/index.js';
|
|
26
26
|
import { privatize } from '../-internals/container/index.js';
|
|
27
|
-
import { s as setupApplicationRegistry } from '../../shared-chunks/setup-registry-
|
|
27
|
+
import { s as setupApplicationRegistry } from '../../shared-chunks/setup-registry-BQZJfq-Y.js';
|
|
28
28
|
import RouterService from '../routing/router-service.js';
|
|
29
29
|
import { assert } from '../debug/lib/assert.js';
|
|
30
30
|
|
|
@@ -2,7 +2,7 @@ import { g as get } from '../../shared-chunks/property_get-CIBS9umw.js';
|
|
|
2
2
|
import { s as set } from '../../shared-chunks/property_set-D3PKyisF.js';
|
|
3
3
|
import { h as hasDOM, e as environment } from '../../shared-chunks/index-BGP1rw3B.js';
|
|
4
4
|
import EngineInstance from '../engine/instance.js';
|
|
5
|
-
import { r as renderSettled } from '../../shared-chunks/index-
|
|
5
|
+
import { r as renderSettled } from '../../shared-chunks/index-CL1zjHwo.js';
|
|
6
6
|
import '../debug/index.js';
|
|
7
7
|
import EmberRouter from '../routing/router.js';
|
|
8
8
|
import EventDispatcher from '../-internals/views/lib/system/event_dispatcher.js';
|
|
@@ -514,6 +514,10 @@ const MutableArray = Mixin.create(EmberArray, MutableEnumerable, {
|
|
|
514
514
|
/**
|
|
515
515
|
Creates an `NativeArray` from an Array-like object.
|
|
516
516
|
Does not modify the original object's contents.
|
|
517
|
+
|
|
518
|
+
This exists primarily for historic reasons and should not be used
|
|
519
|
+
in new code. Prefer native [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)
|
|
520
|
+
or [trackedArray](/ember/release/functions/@ember%2Freactive%2Fcollections/trackedArray).
|
|
517
521
|
|
|
518
522
|
Example
|
|
519
523
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { H as default, h as helper } from '../../shared-chunks/helper-
|
|
1
|
+
export { H as default, h as helper } from '../../shared-chunks/helper-BubrhyuN.js';
|
|
@@ -18,7 +18,7 @@ import { I as IS_DISPATCHING_ATTRS, D as DIRTY_TAG, B as BOUNDS, g as getCompone
|
|
|
18
18
|
import { h as hasDOM } from '../../shared-chunks/index-BGP1rw3B.js';
|
|
19
19
|
import { a as decorateMethodV2 } from '../../shared-chunks/runtime-CYyqkz5q-BOdRhmsS.js';
|
|
20
20
|
import { assert } from '../debug/lib/assert.js';
|
|
21
|
-
export { I as Input, T as Textarea } from '../../shared-chunks/textarea-
|
|
21
|
+
export { I as Input, T as Textarea } from '../../shared-chunks/textarea-lD4apgrP.js';
|
|
22
22
|
import { s as setComponentManager$1 } from '../../shared-chunks/api-BAmlf_CN.js';
|
|
23
23
|
export { c as capabilities } from '../../shared-chunks/api-BAmlf_CN.js';
|
|
24
24
|
import '../../@glimmer/destroyable/index.js';
|
|
@@ -73,6 +73,12 @@ function matches(el, selector) {
|
|
|
73
73
|
API documentation for Template-only or Glimmer components, it is [available
|
|
74
74
|
here](/ember/release/modules/@glimmer%2Fcomponent).
|
|
75
75
|
|
|
76
|
+
Note: Prior to Ember 6.8, by default, components were authored in paired `.hbs` and `.js`
|
|
77
|
+
files. This is still supported, but the default authoring format is now `.gjs` or "template tag".
|
|
78
|
+
The documentation for `@ember/component` still refers to the older authoring format. To read about
|
|
79
|
+
the new authoring format, see the
|
|
80
|
+
[Glimmer Component API documentation](/ember/release/modules/@glimmer%2Fcomponent).
|
|
81
|
+
|
|
76
82
|
## Defining a Classic Component
|
|
77
83
|
|
|
78
84
|
If you want to customize the component in order to handle events, transform
|
|
@@ -99,7 +105,7 @@ function matches(el, selector) {
|
|
|
99
105
|
|
|
100
106
|
And then use it in the component's template:
|
|
101
107
|
|
|
102
|
-
```app/
|
|
108
|
+
```app/components/person-profile.hbs
|
|
103
109
|
<h1>{{this.displayName}}</h1>
|
|
104
110
|
{{yield}}
|
|
105
111
|
```
|
|
@@ -487,7 +493,7 @@ function matches(el, selector) {
|
|
|
487
493
|
The `layout` property should be set to the default export of a template
|
|
488
494
|
module, which is the name of a template file without the `.hbs` extension.
|
|
489
495
|
|
|
490
|
-
```app/
|
|
496
|
+
```app/components/person-profile.hbs
|
|
491
497
|
<h1>Person's Title</h1>
|
|
492
498
|
<div class='details'>{{yield}}</div>
|
|
493
499
|
```
|
|
@@ -13,7 +13,7 @@ import '../../route-recognizer/index.js';
|
|
|
13
13
|
import '../../shared-chunks/rsvp-CnCSY930.js';
|
|
14
14
|
import '../../shared-chunks/unrecognized-url-error-B3wUTorp.js';
|
|
15
15
|
import RoutingService from '../routing/lib/routing-service.js';
|
|
16
|
-
import { a as setupEngineRegistry } from '../../shared-chunks/setup-registry-
|
|
16
|
+
import { a as setupEngineRegistry } from '../../shared-chunks/setup-registry-BQZJfq-Y.js';
|
|
17
17
|
import RegistryProxyMixin from '../-internals/runtime/lib/mixins/registry_proxy.js';
|
|
18
18
|
import { assert } from '../debug/lib/assert.js';
|
|
19
19
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { b as setHelperManager$1 } from '../../shared-chunks/api-BAmlf_CN.js';
|
|
2
2
|
import { i as helperCapabilities } from '../../shared-chunks/api-BawZUDYD.js';
|
|
3
3
|
import { i as invokeHelper$1 } from '../../shared-chunks/invoke-B8M5fQQS.js';
|
|
4
|
-
import { a as array$1, f as fn$1, h as hash$1 } from '../../shared-chunks/hash-
|
|
5
|
-
import { c as concat$1, g as get$1 } from '../../shared-chunks/get-
|
|
6
|
-
import { a as and$1, e as eq$1, g as gt$1, b as gte$1, l as lt$1, c as lte$1, n as neq$1, d as not$1, o as or$1 } from '../../shared-chunks/or-
|
|
7
|
-
import { e as element$1 } from '../../shared-chunks/element-
|
|
4
|
+
import { a as array$1, f as fn$1, h as hash$1 } from '../../shared-chunks/hash-BTwOuDGQ.js';
|
|
5
|
+
import { c as concat$1, g as get$1 } from '../../shared-chunks/get-BehtPmsu.js';
|
|
6
|
+
import { a as and$1, e as eq$1, g as gt$1, b as gte$1, l as lt$1, c as lte$1, n as neq$1, d as not$1, o as or$1 } from '../../shared-chunks/or-BTH3yuFG.js';
|
|
7
|
+
import { e as element$1 } from '../../shared-chunks/element-Cf3hqNOD.js';
|
|
8
8
|
import { u as uniqueId$1 } from '../../shared-chunks/unique-id-CgmHQiwi.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -336,18 +336,12 @@ const invokeHelper = invokeHelper$1;
|
|
|
336
336
|
* as an argument to your components.
|
|
337
337
|
*
|
|
338
338
|
* ```
|
|
339
|
-
* import { hash } from '@ember/helper';
|
|
340
|
-
*
|
|
341
339
|
* <template>
|
|
342
340
|
* {{#each-in (hash givenName='Jen' familyName='Weber') as |key value|}}
|
|
343
341
|
* <p>{{key}}: {{value}}</p>
|
|
344
342
|
* {{/each-in}}
|
|
345
343
|
* </template>
|
|
346
344
|
* ```
|
|
347
|
-
*
|
|
348
|
-
* **NOTE:** this example uses the experimental `<template>` feature, which is
|
|
349
|
-
* the only place you need to import `hash` to use it (it is a built-in when
|
|
350
|
-
* writing standalone `.hbs` files).
|
|
351
345
|
*/
|
|
352
346
|
const hash = hash$1;
|
|
353
347
|
/**
|
|
@@ -355,7 +349,6 @@ const hash = hash$1;
|
|
|
355
349
|
* as an argument to your components.
|
|
356
350
|
*
|
|
357
351
|
* ```js
|
|
358
|
-
* import { array } from '@ember/helper';
|
|
359
352
|
*
|
|
360
353
|
* <template>
|
|
361
354
|
* <ul>
|
|
@@ -364,10 +357,6 @@ const hash = hash$1;
|
|
|
364
357
|
* {{/each}}
|
|
365
358
|
* </ul>
|
|
366
359
|
* </template>
|
|
367
|
-
*
|
|
368
|
-
* **NOTE:** this example uses the experimental `<template>` feature, which is
|
|
369
|
-
* the only place you need to import `array` to use it (it is a built-in when
|
|
370
|
-
* writing standalone `.hbs` files).
|
|
371
360
|
* ```
|
|
372
361
|
*/
|
|
373
362
|
const array = array$1;
|
|
@@ -388,10 +377,6 @@ const array = array$1;
|
|
|
388
377
|
*
|
|
389
378
|
* This will display the result of `@foo.item1` when `index` is `1`, and
|
|
390
379
|
* `this.foo.item2` when `index` is `2`, etc.
|
|
391
|
-
*
|
|
392
|
-
* **NOTE:** this example uses the experimental `<template>` feature, which is
|
|
393
|
-
* the only place you need to import `concat` to use it (it is a built-in when
|
|
394
|
-
* writing standalone `.hbs` files).
|
|
395
380
|
*/
|
|
396
381
|
const concat = concat$1;
|
|
397
382
|
/**
|
|
@@ -431,10 +416,6 @@ const concat = concat$1;
|
|
|
431
416
|
*
|
|
432
417
|
* This will display the result of `@foo.item1` when `index` is `1`, and
|
|
433
418
|
* `this.foo.item2` when `index` is `2`, etc.
|
|
434
|
-
*
|
|
435
|
-
* **NOTE:** this example uses the experimental `<template>` feature, which is
|
|
436
|
-
* the only place you need to import `concat` to use it (it is a built-in when
|
|
437
|
-
* writing standalone `.hbs` files).
|
|
438
419
|
*/
|
|
439
420
|
const get = get$1;
|
|
440
421
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as on$1 } from '../../shared-chunks/on-
|
|
1
|
+
import { o as on$1 } from '../../shared-chunks/on-BQii6ILK.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,
|
|
@@ -40,8 +40,8 @@ class EmberObject extends CoreObject.extend(Observable) {
|
|
|
40
40
|
Decorator that turns the target function into an Action which can be accessed
|
|
41
41
|
directly by reference.
|
|
42
42
|
|
|
43
|
-
```
|
|
44
|
-
import Component from '@
|
|
43
|
+
```gjs
|
|
44
|
+
import Component from '@glimmer/component';
|
|
45
45
|
import { tracked } from '@glimmer/tracking';
|
|
46
46
|
import { action } from '@ember/object';
|
|
47
47
|
|
|
@@ -52,24 +52,24 @@ class EmberObject extends CoreObject.extend(Observable) {
|
|
|
52
52
|
toggleShowing() {
|
|
53
53
|
this.isShowing = !this.isShowing;
|
|
54
54
|
}
|
|
55
|
+
|
|
56
|
+
<template>
|
|
57
|
+
<button {{on "click" this.toggleShowing}}>Show tooltip</button>
|
|
58
|
+
|
|
59
|
+
{{#if isShowing}}
|
|
60
|
+
<div class="tooltip">
|
|
61
|
+
I'm a tooltip!
|
|
62
|
+
</div>
|
|
63
|
+
{{/if}}
|
|
64
|
+
</template>
|
|
55
65
|
}
|
|
56
66
|
```
|
|
57
|
-
```hbs
|
|
58
|
-
<!-- template.hbs -->
|
|
59
|
-
<button {{on "click" this.toggleShowing}}>Show tooltip</button>
|
|
60
|
-
|
|
61
|
-
{{#if isShowing}}
|
|
62
|
-
<div class="tooltip">
|
|
63
|
-
I'm a tooltip!
|
|
64
|
-
</div>
|
|
65
|
-
{{/if}}
|
|
66
|
-
```
|
|
67
67
|
|
|
68
68
|
It also binds the function directly to the instance, so it can be used in any
|
|
69
69
|
context and will correctly refer to the class it came from:
|
|
70
70
|
|
|
71
|
-
```
|
|
72
|
-
import Component from '@
|
|
71
|
+
```gjs
|
|
72
|
+
import Component from '@glimmer/component';
|
|
73
73
|
import { tracked } from '@glimmer/tracking';
|
|
74
74
|
import { action } from '@ember/object';
|
|
75
75
|
|
|
@@ -88,6 +88,10 @@ class EmberObject extends CoreObject.extend(Observable) {
|
|
|
88
88
|
toggleShowing() {
|
|
89
89
|
this.isShowing = !this.isShowing;
|
|
90
90
|
}
|
|
91
|
+
|
|
92
|
+
<template>
|
|
93
|
+
{{!-- ...--}}
|
|
94
|
+
</template>
|
|
91
95
|
}
|
|
92
96
|
```
|
|
93
97
|
|
|
@@ -170,9 +174,10 @@ setClassicDecorator(action);
|
|
|
170
174
|
});
|
|
171
175
|
```
|
|
172
176
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
177
|
+
While observers are still supported, there are [plans to deprecate them](https://github.com/emberjs/rfcs/pull/1115)
|
|
178
|
+
See the [in-progress deprecation guide](https://github.com/ember-learn/deprecation-app/pull/1407)
|
|
179
|
+
for guidance on how to avoid using observers.
|
|
180
|
+
|
|
176
181
|
@method observer
|
|
177
182
|
@for @ember/object
|
|
178
183
|
@param {String} propertyNames*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { a as renderComponent, r as renderSettled } from '../../shared-chunks/index-
|
|
1
|
+
export { a as renderComponent, r as renderSettled } from '../../shared-chunks/index-CL1zjHwo.js';
|
|
@@ -63,10 +63,14 @@ function isQueryParams(value) {
|
|
|
63
63
|
supplied model to the route as its `model` context of the route. The block for `LinkTo`
|
|
64
64
|
becomes the contents of the rendered element:
|
|
65
65
|
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
```gjs
|
|
67
|
+
import { LinkTo } from '@ember/routing';
|
|
68
|
+
|
|
69
|
+
<template>
|
|
70
|
+
<LinkTo @route='photoGallery'>
|
|
71
|
+
Great Hamster Photos
|
|
72
|
+
</LinkTo>
|
|
73
|
+
</template>
|
|
70
74
|
```
|
|
71
75
|
|
|
72
76
|
This will result in:
|
|
@@ -769,7 +769,7 @@ class Route extends EmberObject.extend(ActionHandler, Evented) {
|
|
|
769
769
|
```
|
|
770
770
|
Note that for routes with dynamic segments, this hook is not always
|
|
771
771
|
executed. If the route is entered through a transition (e.g. when
|
|
772
|
-
using the `link-to`
|
|
772
|
+
using the `link-to` helper or the `transitionTo` method
|
|
773
773
|
of routes), and a model context is already provided this hook
|
|
774
774
|
is not called.
|
|
775
775
|
A model context does not include a primitive string or number,
|
|
@@ -41,7 +41,7 @@ function cleanURL(url, rootURL) {
|
|
|
41
41
|
In this example, the Router service is injected into a component to initiate a transition
|
|
42
42
|
to a dedicated route:
|
|
43
43
|
|
|
44
|
-
```app/components/example.
|
|
44
|
+
```app/components/example.gjs
|
|
45
45
|
import Component from '@glimmer/component';
|
|
46
46
|
import { action } from '@ember/object';
|
|
47
47
|
import { service } from '@ember/service';
|
|
@@ -90,7 +90,7 @@ class RouterService extends Service.extend(Evented) {
|
|
|
90
90
|
In the following example we use the Router service to navigate to a route with a
|
|
91
91
|
specific model from a Component in the first action, and in the second we trigger
|
|
92
92
|
a query-params only transition.
|
|
93
|
-
```app/components/example.
|
|
93
|
+
```app/components/example.gjs
|
|
94
94
|
import Component from '@glimmer/component';
|
|
95
95
|
import { action } from '@ember/object';
|
|
96
96
|
import { service } from '@ember/service';
|
|
@@ -175,10 +175,14 @@ class RouterService extends Service.extend(Evented) {
|
|
|
175
175
|
URL is returned as a string that can be used for any purpose.
|
|
176
176
|
In this example, the URL for the `author.books` route for a given author
|
|
177
177
|
is copied to the clipboard.
|
|
178
|
-
```app/templates/application.
|
|
179
|
-
|
|
178
|
+
```app/templates/application.gjs
|
|
179
|
+
import CopyLink from '../components/copy-link';
|
|
180
|
+
|
|
181
|
+
<template>
|
|
182
|
+
<CopyLink @author={{hash id="tomster" name="Tomster"}} />
|
|
183
|
+
</template>
|
|
180
184
|
```
|
|
181
|
-
```app/components/copy-link.
|
|
185
|
+
```app/components/copy-link.gjs
|
|
182
186
|
import Component from '@glimmer/component';
|
|
183
187
|
import { service } from '@ember/service';
|
|
184
188
|
import { action } from '@ember/object';
|
|
@@ -197,10 +201,13 @@ class RouterService extends Service.extend(Evented) {
|
|
|
197
201
|
```
|
|
198
202
|
Just like with `transitionTo` and `replaceWith`, `urlFor` can also handle
|
|
199
203
|
query parameters.
|
|
200
|
-
```app/templates/application.
|
|
201
|
-
|
|
204
|
+
```app/templates/application.gjs
|
|
205
|
+
import CopyLink from '../components/copy-link';
|
|
206
|
+
<template>
|
|
207
|
+
<CopyLink @author={{hash id="tomster" name="Tomster"}} />
|
|
208
|
+
</template>
|
|
202
209
|
```
|
|
203
|
-
```app/components/copy-link.
|
|
210
|
+
```app/components/copy-link.gjs
|
|
204
211
|
import Component from '@glimmer/component';
|
|
205
212
|
import { service } from '@ember/service';
|
|
206
213
|
import { action } from '@ember/object';
|
|
@@ -237,7 +244,7 @@ class RouterService extends Service.extend(Evented) {
|
|
|
237
244
|
See [model](api/ember/release/classes/Route/methods/model?anchor=model) and
|
|
238
245
|
[queryParams](/api/ember/3.7/classes/Route/properties/queryParams?anchor=queryParams) for more information about these arguments.
|
|
239
246
|
In the following example, `isActive` will return `true` if the current route is `/posts`.
|
|
240
|
-
```app/components/posts.
|
|
247
|
+
```app/components/posts.gjs
|
|
241
248
|
import Component from '@glimmer/component';
|
|
242
249
|
import { service } from '@ember/service';
|
|
243
250
|
export default class extends Component {
|
|
@@ -249,7 +256,7 @@ class RouterService extends Service.extend(Evented) {
|
|
|
249
256
|
```
|
|
250
257
|
The next example includes a dynamic segment, and will return `true` if the current route is `/posts/1`,
|
|
251
258
|
assuming the post has an id of 1:
|
|
252
|
-
```app/components/posts.
|
|
259
|
+
```app/components/posts.gjs
|
|
253
260
|
import Component from '@glimmer/component';
|
|
254
261
|
import { service } from '@ember/service';
|
|
255
262
|
export default class extends Component {
|
|
@@ -323,7 +330,7 @@ class RouterService extends Service.extend(Evented) {
|
|
|
323
330
|
See [RouteInfo](/ember/release/classes/RouteInfo) for more info.
|
|
324
331
|
In the following example `recognize` is used to verify if a path belongs to our
|
|
325
332
|
application before transitioning to it.
|
|
326
|
-
```
|
|
333
|
+
```js
|
|
327
334
|
import Component from '@ember/component';
|
|
328
335
|
import { service } from '@ember/service';
|
|
329
336
|
export default class extends Component {
|
|
@@ -626,7 +633,7 @@ class RouterService extends Service.extend(Evented) {
|
|
|
626
633
|
happens (even when that transition only changes parameters
|
|
627
634
|
and doesn't change the active route).
|
|
628
635
|
Usage example:
|
|
629
|
-
```app/components/header.
|
|
636
|
+
```app/components/header.gjs
|
|
630
637
|
import Component from '@glimmer/component';
|
|
631
638
|
import { service } from '@ember/service';
|
|
632
639
|
import { notEmpty } from '@ember/object/computed';
|
|
@@ -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/or-
|
|
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/or-BTH3yuFG.js';
|
|
2
|
+
import { h as hash, f as fn, a as array } from '../../../shared-chunks/hash-BTwOuDGQ.js';
|
|
3
|
+
import { e as element } from '../../../shared-chunks/element-Cf3hqNOD.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';
|
|
@@ -3,11 +3,11 @@ export { D as DOMChanges, a as DynamicScopeImpl, E as EnvironmentImpl, b as IDOM
|
|
|
3
3
|
export { T as TEMPLATE_ONLY_COMPONENT_MANAGER, a as TemplateOnlyComponent, b as TemplateOnlyComponentManager, t as templateOnlyComponent } from '../../shared-chunks/template-only-BqOt8bDl.js';
|
|
4
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/untouchable-this-B3DVwpHS.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/or-
|
|
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-
|
|
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/or-BTH3yuFG.js';
|
|
7
|
+
export { a as array, f as fn, h as hash } from '../../shared-chunks/hash-BTwOuDGQ.js';
|
|
8
|
+
export { c as concat, g as get } from '../../shared-chunks/get-BehtPmsu.js';
|
|
9
9
|
export { i as invokeHelper } from '../../shared-chunks/invoke-B8M5fQQS.js';
|
|
10
|
-
export { o as on } from '../../shared-chunks/on-
|
|
10
|
+
export { o as on } from '../../shared-chunks/on-BQii6ILK.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-B7dqAS38.js';
|
|
@@ -84,6 +84,8 @@ function getElementDefinition(tagName) {
|
|
|
84
84
|
Passing `null`, `undefined`, or non-string values will throw an assertion error.
|
|
85
85
|
|
|
86
86
|
Changing the tag name will tear down and recreate the element and its contents.
|
|
87
|
+
|
|
88
|
+
The `element` helper is built-in and does not need to be imported.
|
|
87
89
|
|
|
88
90
|
@method element
|
|
89
91
|
@for Ember.Templates.helpers
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as createComputeRef, U as UNDEFINED_REFERENCE, v as valueForRef } from './reference-BoPB2LfI.js';
|
|
2
2
|
import { f as reifyPositional } from './untouchable-this-B3DVwpHS.js';
|
|
3
|
-
import { i as internalHelper } from './hash-
|
|
3
|
+
import { i as internalHelper } from './hash-BTwOuDGQ.js';
|
|
4
4
|
import { setPath, getPath } from '../@glimmer/global-context/index.js';
|
|
5
5
|
import { i as isDict } from './collections-DPkjqeA3.js';
|
|
6
6
|
|
|
@@ -19,10 +19,15 @@ const normalizeTextValue = value => {
|
|
|
19
19
|
|
|
20
20
|
Example:
|
|
21
21
|
|
|
22
|
-
```handlebars
|
|
23
|
-
{{some-component name=(concat firstName " " lastName)}}
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
```gjs
|
|
24
|
+
import { concat } from '@ember/helper';
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
{{yield (concat firstName " " lastName)}}
|
|
28
|
+
|
|
29
|
+
{{! would yield name="<first name value> <last name value>" to the component}}
|
|
30
|
+
</template>
|
|
26
31
|
```
|
|
27
32
|
|
|
28
33
|
or for angle bracket invocation, you actually don't need concat at all.
|
|
@@ -46,28 +51,31 @@ const concat = internalHelper(({
|
|
|
46
51
|
|
|
47
52
|
For example, these two usages are equivalent:
|
|
48
53
|
|
|
49
|
-
```app/components/developer-detail.
|
|
54
|
+
```app/components/developer-detail.gjs
|
|
50
55
|
import Component from '@glimmer/component';
|
|
51
56
|
import { tracked } from '@glimmer/tracking';
|
|
57
|
+
import { get } from '@ember/object';
|
|
52
58
|
|
|
53
59
|
export default class extends Component {
|
|
54
60
|
@tracked developer = {
|
|
55
61
|
name: "Sandi Metz",
|
|
56
62
|
language: "Ruby"
|
|
57
63
|
}
|
|
64
|
+
|
|
65
|
+
<template>
|
|
66
|
+
{{this.developer.name}}
|
|
67
|
+
{{get this.developer "name"}}
|
|
68
|
+
</template>
|
|
58
69
|
}
|
|
59
70
|
```
|
|
60
71
|
|
|
61
|
-
```handlebars
|
|
62
|
-
{{this.developer.name}}
|
|
63
|
-
{{get this.developer "name"}}
|
|
64
|
-
```
|
|
65
|
-
|
|
66
72
|
If there were several facts about a person, the `{{get}}` helper can dynamically
|
|
67
73
|
pick one:
|
|
68
74
|
|
|
69
|
-
```app/templates/application.
|
|
70
|
-
<
|
|
75
|
+
```app/templates/application.gjs
|
|
76
|
+
<template>
|
|
77
|
+
<DeveloperDetail @factName="language" />
|
|
78
|
+
</template>
|
|
71
79
|
```
|
|
72
80
|
|
|
73
81
|
```handlebars
|
|
@@ -77,10 +85,11 @@ const concat = internalHelper(({
|
|
|
77
85
|
For a more complex example, this template would allow the user to switch
|
|
78
86
|
between showing the user's height and weight with a click:
|
|
79
87
|
|
|
80
|
-
```app/components/developer-detail.
|
|
88
|
+
```app/components/developer-detail.gjs
|
|
81
89
|
import Component from '@glimmer/component';
|
|
82
90
|
import { tracked } from '@glimmer/tracking';
|
|
83
|
-
|
|
91
|
+
import { get } from '@ember/object';
|
|
92
|
+
|
|
84
93
|
export default class extends Component {
|
|
85
94
|
@tracked developer = {
|
|
86
95
|
name: "Sandi Metz",
|
|
@@ -92,28 +101,16 @@ const concat = internalHelper(({
|
|
|
92
101
|
showFact = (fact) => {
|
|
93
102
|
this.currentFact = fact;
|
|
94
103
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
```app/components/developer-detail.js
|
|
99
|
-
{{get this.developer this.currentFact}}
|
|
100
|
-
|
|
101
|
-
<button {{on 'click' (fn this.showFact "name")}}>Show name</button>
|
|
102
|
-
<button {{on 'click' (fn this.showFact "language")}}>Show language</button>
|
|
103
|
-
```
|
|
104
|
+
|
|
105
|
+
<template>
|
|
106
|
+
{{get this.developer this.currentFact}}
|
|
104
107
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
<button {{on 'click' (fn this.showFact "name")}}>Show name</button>
|
|
111
|
-
<button {{on 'click' (fn this.showFact "language")}}>Show language</button>
|
|
108
|
+
<button {{on 'click' (fn this.showFact "name")}}>Show name</button>
|
|
109
|
+
<button {{on 'click' (fn this.showFact "language")}}>Show language</button>
|
|
110
|
+
</template>
|
|
111
|
+
}
|
|
112
112
|
```
|
|
113
113
|
|
|
114
|
-
Would allow the user to swap what fact is being displayed, and also edit
|
|
115
|
-
that fact via a two-way mutable binding.
|
|
116
|
-
|
|
117
114
|
@public
|
|
118
115
|
@method get
|
|
119
116
|
*/
|
|
@@ -19,7 +19,7 @@ function internalHelper(helper) {
|
|
|
19
19
|
```
|
|
20
20
|
or
|
|
21
21
|
```handlebars
|
|
22
|
-
{{
|
|
22
|
+
{{yield people=(array
|
|
23
23
|
'Tom Dale'
|
|
24
24
|
'Yehuda Katz'
|
|
25
25
|
this.myOtherPerson)
|
|
@@ -58,13 +58,17 @@ const context = buildUntouchableThis('`fn` helper');
|
|
|
58
58
|
to a component invoked within the loop. Here's how you could use the `fn`
|
|
59
59
|
helper to pass both the function and its arguments together:
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
```app/components/items-listing.gjs
|
|
62
|
+
import DisplayItem from './display-item';
|
|
63
|
+
|
|
64
|
+
<template>
|
|
65
|
+
{{#each @items as |item|}}
|
|
66
|
+
<DisplayItem @item=item @select={{fn this.handleSelected item}} />
|
|
67
|
+
{{/each}}
|
|
68
|
+
</template>
|
|
65
69
|
```
|
|
66
70
|
|
|
67
|
-
```app/components/items-list.
|
|
71
|
+
```app/components/items-list.gjs
|
|
68
72
|
import Component from '@glimmer/component';
|
|
69
73
|
import { action } from '@ember/object';
|
|
70
74
|
|
|
@@ -75,7 +79,7 @@ const context = buildUntouchableThis('`fn` helper');
|
|
|
75
79
|
}
|
|
76
80
|
```
|
|
77
81
|
|
|
78
|
-
In this case the `
|
|
82
|
+
In this case the `DisplayItem` component will receive a normal function
|
|
79
83
|
that it can invoke. When it invokes the function, the `handleSelected`
|
|
80
84
|
function will receive the `item` and any arguments passed, thanks to the
|
|
81
85
|
`fn` helper.
|
|
@@ -92,7 +96,7 @@ const context = buildUntouchableThis('`fn` helper');
|
|
|
92
96
|
`handleSelected` is properly bound to the `items-list`, but let's explore what
|
|
93
97
|
happens if we left out the arrow function:
|
|
94
98
|
|
|
95
|
-
```app/components/items-list.
|
|
99
|
+
```app/components/items-list.gjs
|
|
96
100
|
import Component from '@glimmer/component';
|
|
97
101
|
|
|
98
102
|
export default class ItemsList extends Component {
|
|
@@ -109,6 +113,8 @@ const context = buildUntouchableThis('`fn` helper');
|
|
|
109
113
|
|
|
110
114
|
See also [partial application](https://en.wikipedia.org/wiki/Partial_application).
|
|
111
115
|
|
|
116
|
+
`fn` is built-in and does not require any additional imports.
|
|
117
|
+
|
|
112
118
|
@method fn
|
|
113
119
|
@public
|
|
114
120
|
*/
|
|
@@ -138,7 +144,7 @@ function assertCallbackIsFn(callbackRef) {
|
|
|
138
144
|
|
|
139
145
|
/**
|
|
140
146
|
Use the `{{hash}}` helper to create a hash to pass as an option to your
|
|
141
|
-
components. This is
|
|
147
|
+
components. This is especially useful for contextual components where you can
|
|
142
148
|
just yield a hash:
|
|
143
149
|
|
|
144
150
|
```handlebars
|