ember-source 6.7.0-alpha.2 → 6.7.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/build-metadata.json +3 -3
  2. package/dist/ember-template-compiler.js +2 -16
  3. package/dist/ember-template-compiler.js.map +1 -1
  4. package/dist/ember-testing.js +1 -1
  5. package/dist/ember.debug.js +108 -48
  6. package/dist/ember.debug.js.map +1 -1
  7. package/dist/ember.prod.js +108 -48
  8. package/dist/ember.prod.js.map +1 -1
  9. package/dist/packages/@ember/-internals/deprecations/index.js +1 -17
  10. package/dist/packages/@ember/-internals/environment/index.js +1 -1
  11. package/dist/packages/@ember/-internals/glimmer/index.js +2 -2
  12. package/dist/packages/@ember/-internals/metal/index.js +8 -8
  13. package/dist/packages/@ember/-internals/routing/index.js +2 -2
  14. package/dist/packages/@ember/-internals/runtime/lib/mixins/-proxy.js +3 -3
  15. package/dist/packages/@ember/-internals/runtime/lib/mixins/action_handler.js +2 -2
  16. package/dist/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +2 -2
  17. package/dist/packages/@ember/-internals/views/lib/mixins/action_support.js +2 -2
  18. package/dist/packages/@ember/-internals/views/lib/system/event_dispatcher.js +3 -3
  19. package/dist/packages/@ember/-internals/views/lib/views/core_view.js +2 -2
  20. package/dist/packages/@ember/application/index.js +4 -4
  21. package/dist/packages/@ember/application/instance.js +4 -4
  22. package/dist/packages/@ember/application/lib/lazy_load.js +1 -1
  23. package/dist/packages/@ember/application/namespace.js +2 -2
  24. package/dist/packages/@ember/array/index.js +4 -7
  25. package/dist/packages/@ember/array/proxy.js +4 -4
  26. package/dist/packages/@ember/canary-features/index.js +1 -1
  27. package/dist/packages/@ember/component/helper.js +1 -1
  28. package/dist/packages/@ember/component/index.js +1 -1
  29. package/dist/packages/@ember/controller/index.js +2 -2
  30. package/dist/packages/@ember/debug/container-debug-adapter.js +2 -2
  31. package/dist/packages/@ember/debug/data-adapter.js +2 -2
  32. package/dist/packages/@ember/debug/lib/deprecate.js +1 -1
  33. package/dist/packages/@ember/engine/index.js +5 -5
  34. package/dist/packages/@ember/helper/index.js +1 -1
  35. package/dist/packages/@ember/instrumentation/index.js +1 -1
  36. package/dist/packages/@ember/modifier/index.js +1 -1
  37. package/dist/packages/@ember/object/-internals.js +2 -2
  38. package/dist/packages/@ember/object/compat.js +2 -2
  39. package/dist/packages/@ember/object/computed.js +3 -3
  40. package/dist/packages/@ember/object/core.js +2 -2
  41. package/dist/packages/@ember/object/evented.js +3 -3
  42. package/dist/packages/@ember/object/events.js +2 -2
  43. package/dist/packages/@ember/object/index.js +5 -5
  44. package/dist/packages/@ember/object/lib/computed/computed_macros.js +4 -4
  45. package/dist/packages/@ember/object/lib/computed/reduce_computed_macros.js +2 -2
  46. package/dist/packages/@ember/object/mixin.js +2 -2
  47. package/dist/packages/@ember/object/observable.js +4 -4
  48. package/dist/packages/@ember/object/observers.js +2 -2
  49. package/dist/packages/@ember/object/promise-proxy-mixin.js +3 -3
  50. package/dist/packages/@ember/renderer/index.js +1 -1
  51. package/dist/packages/@ember/routing/index.js +1 -1
  52. package/dist/packages/@ember/routing/lib/generate_controller.js +2 -2
  53. package/dist/packages/@ember/routing/lib/routing-service.js +2 -2
  54. package/dist/packages/@ember/routing/lib/utils.js +2 -2
  55. package/dist/packages/@ember/routing/route.js +4 -4
  56. package/dist/packages/@ember/routing/router-service.js +2 -2
  57. package/dist/packages/@ember/routing/router.js +3 -3
  58. package/dist/packages/@ember/runloop/index.js +2 -2
  59. package/dist/packages/@ember/service/index.js +2 -2
  60. package/dist/packages/@ember/template/index.js +1 -1
  61. package/dist/packages/@ember/utils/lib/is_empty.js +2 -2
  62. package/dist/packages/@glimmer/tracking/index.js +2 -2
  63. package/dist/packages/@glimmer/tracking/primitives/cache.js +2 -2
  64. package/dist/packages/ember/barrel.js +6 -6
  65. package/dist/packages/ember/version.js +1 -1
  66. package/dist/packages/ember-testing/lib/helpers/current_path.js +2 -2
  67. package/dist/packages/ember-testing/lib/helpers/current_route_name.js +2 -2
  68. package/dist/packages/ember-testing/lib/helpers/current_url.js +2 -2
  69. package/dist/packages/ember-testing/lib/initializers.js +3 -3
  70. package/dist/packages/shared-chunks/{alias-2kjf2oSj.js → alias-CPqbuwcg.js} +2 -2
  71. package/dist/packages/shared-chunks/{array-BGH9y76r.js → array-CVk-fNjW.js} +1 -1
  72. package/dist/packages/shared-chunks/{cache-fCezwMOy.js → cache-DtDz7X5V.js} +1 -1
  73. package/dist/packages/shared-chunks/{env-CwR5CFCu.js → env-DxZ20QzS.js} +0 -14
  74. package/dist/packages/shared-chunks/{index-PMsLQ_2V.js → index-D-GTx_Yt.js} +104 -16
  75. package/dist/packages/shared-chunks/{namespace_search-XjyoxHzL.js → namespace_search-Dh_YNV5f.js} +1 -1
  76. package/dist/packages/shared-chunks/{property_set-2JtwI-ab.js → property_set-n9lAuzYY.js} +1 -1
  77. package/dist/packages/shared-chunks/{set_properties-CAos5Wl4.js → set_properties-D2_u0phU.js} +2 -2
  78. package/dist/packages/shared-chunks/{setup-registry-D5XjF_Xz.js → setup-registry-Rh-QLzcd.js} +1 -1
  79. package/docs/data.json +145 -87
  80. package/package.json +2 -2
  81. package/types/stable/@ember/-internals/deprecations/index.d.ts +0 -6
  82. package/types/stable/@ember/-internals/glimmer/index.d.ts +1 -1
  83. package/types/stable/@ember/-internals/glimmer/lib/utils/string.d.ts +98 -11
  84. package/types/stable/@ember/template/index.d.ts +1 -1
@@ -5,7 +5,7 @@
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 6.7.0-alpha.2
8
+ * @version 6.7.0-alpha.4
9
9
  */
10
10
  /* eslint-disable no-var */
11
11
  /* globals global globalThis self */
@@ -742,20 +742,6 @@ var define, require;
742
742
  }
743
743
  }
744
744
 
745
- // TODO: Remove in Ember 6.5. This setting code for EXTEND_PROTOTYPES
746
- // should stay for at least an LTS cycle so that users get the explicit
747
- // deprecation exception when it breaks in >= 6.0.0.
748
- let {
749
- EXTEND_PROTOTYPES
750
- } = EmberENV;
751
- if (EXTEND_PROTOTYPES !== undefined) {
752
- if (typeof EXTEND_PROTOTYPES === 'object' && EXTEND_PROTOTYPES !== null) {
753
- ENV.EXTEND_PROTOTYPES.Array = EXTEND_PROTOTYPES.Array !== false;
754
- } else {
755
- ENV.EXTEND_PROTOTYPES.Array = EXTEND_PROTOTYPES !== false;
756
- }
757
- }
758
-
759
745
  // TODO this does not seem to be used by anything,
760
746
  // can we remove it? do we need to deprecate it?
761
747
  let {
@@ -2130,7 +2116,7 @@ var define, require;
2130
2116
  }, Symbol.toStringTag, { value: 'Module' });
2131
2117
 
2132
2118
  // this file gets replaced with the real value during the build
2133
- const Version = '6.7.0-alpha.2';
2119
+ const Version = '6.7.0-alpha.4';
2134
2120
 
2135
2121
  const emberVersion = /*#__PURE__*/Object.defineProperty({
2136
2122
  __proto__: null,
@@ -2325,16 +2311,6 @@ var define, require;
2325
2311
  url: `https://deprecations.emberjs.com/id/import-${dasherize(importName).toLowerCase()}-from-ember`
2326
2312
  });
2327
2313
  },
2328
- DEPRECATE_ARRAY_PROTOTYPE_EXTENSIONS: deprecation({
2329
- id: 'deprecate-array-prototype-extensions',
2330
- url: 'https://deprecations.emberjs.com/id/deprecate-array-prototype-extensions',
2331
- until: '6.0.0',
2332
- for: 'ember-source',
2333
- since: {
2334
- available: '5.10.0',
2335
- enabled: '5.10.0'
2336
- }
2337
- }),
2338
2314
  DEPRECATE_IMPORT_INJECT: deprecation({
2339
2315
  for: 'ember-source',
2340
2316
  id: 'importing-inject-from-ember-service',
@@ -2354,12 +2330,6 @@ var define, require;
2354
2330
  throw new Error(`The API deprecated by ${options.id} was removed in ember-source ${options.until}. The message was: ${message}. Please see ${options.url} for more details.`);
2355
2331
  }
2356
2332
  }
2357
- const {
2358
- EXTEND_PROTOTYPES
2359
- } = ENV;
2360
- if (EXTEND_PROTOTYPES.Array !== false) {
2361
- deprecateUntil('Array prototype extensions are deprecated. Follow the deprecation guide for migration instructions, and set EmberENV.EXTEND_PROTOTYPES to false in your config/environment.js', DEPRECATIONS.DEPRECATE_ARRAY_PROTOTYPE_EXTENSIONS);
2362
- }
2363
2333
 
2364
2334
  const emberinternalsDeprecationsIndex = /*#__PURE__*/Object.defineProperty({
2365
2335
  __proto__: null,
@@ -24380,19 +24350,19 @@ var define, require;
24380
24350
  */
24381
24351
 
24382
24352
  /**
24383
- A wrapper around a string that has been marked as safe ("trusted"). **When
24353
+ A wrapper around a string that has been marked as "trusted". **When
24384
24354
  rendered in HTML, Ember will not perform any escaping.**
24385
24355
 
24386
24356
  Note:
24387
24357
 
24388
24358
  1. This does not *make* the string safe; it means that some code in your
24389
- application has *marked* it as safe using the `htmlSafe()` function.
24359
+ application has *marked* it as trusted using the `trustHTML()` function.
24390
24360
 
24391
- 2. The only public API for getting a `SafeString` is calling `htmlSafe()`. It
24361
+ 2. The only public API for getting a `TrutsedHTML` is calling `trustHTML()`. It
24392
24362
  is *not* user-constructible.
24393
24363
 
24394
24364
  If a string contains user inputs or other untrusted data, you must sanitize
24395
- the string before using the `htmlSafe` method. Otherwise your code is
24365
+ the string before using the `trustHTML` method. Otherwise your code is
24396
24366
  vulnerable to [Cross-Site Scripting][xss]. There are many open source
24397
24367
  sanitization libraries to choose from, both for front end and server-side
24398
24368
  sanitization.
@@ -24400,19 +24370,19 @@ var define, require;
24400
24370
  [xss]: https://owasp.org/www-community/attacks/DOM_Based_XSS
24401
24371
 
24402
24372
  ```javascript
24403
- import { htmlSafe } from '@ember/template';
24373
+ import { trustHTML } from '@ember/template';
24404
24374
 
24405
24375
  let someTrustedOrSanitizedString = "<div>Hello!</div>"
24406
24376
 
24407
- htmlSafe(someTrustedorSanitizedString);
24377
+ trustHTML(someTrustedorSanitizedString);
24408
24378
  ```
24409
24379
 
24410
24380
  @for @ember/template
24411
- @class SafeString
24412
- @since 4.12.0
24381
+ @class TrustedHTML
24382
+ @since 6.7.0
24413
24383
  @public
24414
24384
  */
24415
- class SafeString {
24385
+ class TrustedHTML {
24416
24386
  __string;
24417
24387
  constructor(string) {
24418
24388
  this.__string = string;
@@ -24439,6 +24409,40 @@ var define, require;
24439
24409
  }
24440
24410
  }
24441
24411
 
24412
+ /**
24413
+ A wrapper around a string that has been marked as safe ("trusted"). **When
24414
+ rendered in HTML, Ember will not perform any escaping.**
24415
+
24416
+ Note:
24417
+
24418
+ 1. This does not *make* the string safe; it means that some code in your
24419
+ application has *marked* it as safe using the `htmlSafe()` function.
24420
+
24421
+ 2. The only public API for getting a `SafeString` is calling `htmlSafe()`. It
24422
+ is *not* user-constructible.
24423
+
24424
+ If a string contains user inputs or other untrusted data, you must sanitize
24425
+ the string before using the `htmlSafe` method. Otherwise your code is
24426
+ vulnerable to [Cross-Site Scripting][xss]. There are many open source
24427
+ sanitization libraries to choose from, both for front end and server-side
24428
+ sanitization.
24429
+
24430
+ [xss]: https://owasp.org/www-community/attacks/DOM_Based_XSS
24431
+
24432
+ ```javascript
24433
+ import { htmlSafe } from '@ember/template';
24434
+
24435
+ let someTrustedOrSanitizedString = "<div>Hello!</div>"
24436
+
24437
+ htmlSafe(someTrustedorSanitizedString);
24438
+ ```
24439
+
24440
+ @for @ember/template
24441
+ @class SafeString
24442
+ @since 4.12.0
24443
+ @public
24444
+ */
24445
+ const SafeString = TrustedHTML;
24442
24446
  /**
24443
24447
  Use this method to indicate that a string should be rendered as HTML
24444
24448
  when the string is used in a template. To say this another way,
@@ -24468,13 +24472,46 @@ var define, require;
24468
24472
  @return {SafeString} A string that will not be HTML escaped by Handlebars.
24469
24473
  @public
24470
24474
  */
24471
- function htmlSafe(str) {
24475
+ const htmlSafe = trustHTML;
24476
+
24477
+ /**
24478
+ Use this method to indicate that a string should be rendered as HTML
24479
+ without escaping when the string is used in a template. To say this another way,
24480
+ strings marked with `trustHTML` will not be HTML escaped.
24481
+
24482
+ A word of warning - The `trustHTML` method does not make the string safe;
24483
+ it only tells the framework to treat the string as if it is safe to render
24484
+ as HTML - that we trust its contents to be safe. If a string contains user inputs or other untrusted
24485
+ data, you must sanitize the string before using the `trustHTML` method.
24486
+ Otherwise your code is vulnerable to
24487
+ [Cross-Site Scripting](https://owasp.org/www-community/attacks/DOM_Based_XSS).
24488
+ There are many open source sanitization libraries to choose from,
24489
+ both for front end and server-side sanitization.
24490
+
24491
+ ```glimmer-js
24492
+ import { trustHTML } from '@ember/template';
24493
+
24494
+ const someTrustedOrSanitizedString = "<div>Hello!</div>"
24495
+
24496
+ <template>
24497
+ {{trustHTML someTrustedOrSanitizedString}}
24498
+ </template>
24499
+ ```
24500
+
24501
+ @method trustHTML
24502
+ @for @ember/template
24503
+ @param str {String} The string to treat as trusted.
24504
+ @static
24505
+ @return {TrustedHTML} A string that will not be HTML escaped by Handlebars.
24506
+ @public
24507
+ */
24508
+ function trustHTML(str) {
24472
24509
  if (str === null || str === undefined) {
24473
24510
  str = '';
24474
24511
  } else if (typeof str !== 'string') {
24475
24512
  str = String(str);
24476
24513
  }
24477
- return new SafeString(str);
24514
+ return new TrustedHTML(str);
24478
24515
  }
24479
24516
 
24480
24517
  /**
@@ -24496,7 +24533,28 @@ var define, require;
24496
24533
  @return {Boolean} `true` if the string was decorated with `htmlSafe`, `false` otherwise.
24497
24534
  @public
24498
24535
  */
24499
- function isHTMLSafe(str) {
24536
+ const isHTMLSafe = isTrustedHTML;
24537
+
24538
+ /**
24539
+ Detects if a string was decorated using `trustHTML`.
24540
+
24541
+ ```javascript
24542
+ import { trustHTML, isTrustedHTML } from '@ember/template';
24543
+
24544
+ let plainString = 'plain string';
24545
+ let safeString = trustHTML('<div>someValue</div>');
24546
+
24547
+ isTrustedHTML(plainString); // false
24548
+ isTrustedHTML(safeString); // true
24549
+ ```
24550
+
24551
+ @method isTrustedHTML
24552
+ @for @ember/template
24553
+ @static
24554
+ @return {Boolean} `true` if the string was decorated with `htmlSafe`, `false` otherwise.
24555
+ @public
24556
+ */
24557
+ function isTrustedHTML(str) {
24500
24558
  return (
24501
24559
  // SAFETY: cast `as SafeString` only present to make this check "legal"; we
24502
24560
  // can further improve this by changing the behavior to do an `in` check
@@ -25911,9 +25969,6 @@ var define, require;
25911
25969
 
25912
25970
  /*
25913
25971
  This allows us to define computed properties that are not enumerable.
25914
- The primary reason this is important is that when `NativeArray` is
25915
- applied to `Array.prototype` we need to ensure that we do not add _any_
25916
- new enumerable properties.
25917
25972
  */
25918
25973
  function nonEnumerableComputed(callback) {
25919
25974
  let property = computed(callback);
@@ -37529,6 +37584,7 @@ var define, require;
37529
37584
  RootTemplate,
37530
37585
  SafeString,
37531
37586
  Textarea,
37587
+ TrustedHTML,
37532
37588
  _resetRenderers,
37533
37589
  componentCapabilities,
37534
37590
  getTemplate,
@@ -37538,6 +37594,7 @@ var define, require;
37538
37594
  htmlSafe,
37539
37595
  isHTMLSafe,
37540
37596
  isSerializationFirstNode,
37597
+ isTrustedHTML,
37541
37598
  modifierCapabilities,
37542
37599
  renderSettled,
37543
37600
  setComponentManager,
@@ -37547,6 +37604,7 @@ var define, require;
37547
37604
  setupEngineRegistry,
37548
37605
  template: templateFactory,
37549
37606
  templateCacheCounters,
37607
+ trustHTML,
37550
37608
  uniqueId: uniqueId$2
37551
37609
  }, Symbol.toStringTag, { value: 'Module' });
37552
37610
 
@@ -42548,7 +42606,9 @@ var define, require;
42548
42606
  const emberTemplateIndex = /*#__PURE__*/Object.defineProperty({
42549
42607
  __proto__: null,
42550
42608
  htmlSafe,
42551
- isHTMLSafe
42609
+ isHTMLSafe,
42610
+ isTrustedHTML,
42611
+ trustHTML
42552
42612
  }, Symbol.toStringTag, { value: 'Module' });
42553
42613
 
42554
42614
  function run(fn) {