ember-source 3.28.5 → 4.0.0-beta.10

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 (115) hide show
  1. package/CHANGELOG.md +113 -10
  2. package/blueprints/acceptance-test/qunit-files/tests/acceptance/__name__-test.js +1 -1
  3. package/blueprints/acceptance-test/qunit-rfc-232-files/tests/acceptance/__name__-test.js +1 -1
  4. package/blueprints/component-test/qunit-files/__root__/__testType__/__path__/__test__.js +3 -3
  5. package/blueprints/helper-test/index.js +4 -22
  6. package/blueprints/helper-test/mocha-0.12-files/__root__/__testType__/__collection__/__name__-test.js +1 -13
  7. package/blueprints/helper-test/mocha-files/__root__/__testType__/__collection__/__name__-test.js +0 -13
  8. package/blueprints/helper-test/mocha-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js +2 -12
  9. package/blueprints/helper-test/qunit-files/__root__/__testType__/__collection__/__name__-test.js +2 -13
  10. package/blueprints/helper-test/qunit-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js +2 -14
  11. package/blueprints/initializer/files/__root__/initializers/__name__.js +0 -1
  12. package/blueprints/instance-initializer/files/__root__/instance-initializers/__name__.js +0 -1
  13. package/build-metadata.json +3 -3
  14. package/dist/dependencies/@glimmer/manager.js +19 -98
  15. package/dist/dependencies/@glimmer/opcode-compiler.js +9 -146
  16. package/dist/dependencies/@glimmer/runtime.js +1 -55
  17. package/dist/dependencies/@glimmer/validator.js +19 -51
  18. package/dist/ember-template-compiler.js +3692 -5667
  19. package/dist/ember-template-compiler.map +1 -1
  20. package/dist/ember-testing.js +12 -560
  21. package/dist/ember-testing.map +1 -1
  22. package/dist/ember.debug.js +4357 -12470
  23. package/dist/ember.debug.map +1 -1
  24. package/dist/header/license.js +1 -1
  25. package/dist/packages/@ember/-internals/bootstrap/index.js +2 -55
  26. package/dist/packages/@ember/-internals/container/index.js +35 -206
  27. package/dist/packages/@ember/-internals/environment/index.js +3 -46
  28. package/dist/packages/@ember/-internals/extension-support/lib/container_debug_adapter.js +7 -0
  29. package/dist/packages/@ember/-internals/extension-support/lib/data_adapter.js +1 -2
  30. package/dist/packages/@ember/-internals/glimmer/index.js +4774 -7035
  31. package/dist/packages/@ember/-internals/meta/lib/meta.js +2 -50
  32. package/dist/packages/@ember/-internals/metal/index.js +785 -1109
  33. package/dist/packages/@ember/-internals/overrides/index.js +1 -3
  34. package/dist/packages/@ember/-internals/owner/index.js +1 -19
  35. package/dist/packages/@ember/-internals/routing/lib/location/auto_location.js +1 -51
  36. package/dist/packages/@ember/-internals/routing/lib/location/hash_location.js +1 -0
  37. package/dist/packages/@ember/-internals/routing/lib/location/history_location.js +3 -1
  38. package/dist/packages/@ember/-internals/routing/lib/location/none_location.js +0 -7
  39. package/dist/packages/@ember/-internals/routing/lib/services/router.js +34 -2
  40. package/dist/packages/@ember/-internals/routing/lib/services/routing.js +2 -3
  41. package/dist/packages/@ember/-internals/routing/lib/system/dsl.js +5 -6
  42. package/dist/packages/@ember/-internals/routing/lib/system/route.js +192 -652
  43. package/dist/packages/@ember/-internals/routing/lib/system/router.js +119 -248
  44. package/dist/packages/@ember/-internals/routing/lib/system/router_state.js +1 -2
  45. package/dist/packages/@ember/-internals/routing/lib/utils.js +1 -2
  46. package/dist/packages/@ember/-internals/runtime/index.js +1 -4
  47. package/dist/packages/@ember/-internals/runtime/lib/mixins/array.js +4 -175
  48. package/dist/packages/@ember/-internals/runtime/lib/mixins/observable.js +1 -18
  49. package/dist/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +3 -43
  50. package/dist/packages/@ember/-internals/runtime/lib/system/array_proxy.js +8 -15
  51. package/dist/packages/@ember/-internals/runtime/lib/system/core_object.js +10 -141
  52. package/dist/packages/@ember/-internals/utils/index.js +3 -59
  53. package/dist/packages/@ember/-internals/views/index.js +0 -2
  54. package/dist/packages/@ember/-internals/views/lib/mixins/action_support.js +1 -121
  55. package/dist/packages/@ember/-internals/views/lib/mixins/view_support.js +4 -40
  56. package/dist/packages/@ember/-internals/views/lib/system/event_dispatcher.js +115 -190
  57. package/dist/packages/@ember/-internals/views/lib/views/states/destroying.js +1 -2
  58. package/dist/packages/@ember/-internals/views/lib/views/states/has_element.js +1 -2
  59. package/dist/packages/@ember/-internals/views/lib/views/states/in_dom.js +1 -2
  60. package/dist/packages/@ember/-internals/views/lib/views/states/pre_render.js +1 -2
  61. package/dist/packages/@ember/application/instance.js +3 -25
  62. package/dist/packages/@ember/application/lib/application.js +14 -32
  63. package/dist/packages/@ember/canary-features/index.js +5 -6
  64. package/dist/packages/@ember/component/index.js +1 -1
  65. package/dist/packages/@ember/component/template-only.js +2 -0
  66. package/dist/packages/@ember/debug/lib/deprecate.js +7 -41
  67. package/dist/packages/@ember/deprecated-features/index.js +1 -14
  68. package/dist/packages/@ember/engine/index.js +3 -17
  69. package/dist/packages/@ember/engine/instance.js +0 -4
  70. package/dist/packages/@ember/helper/index.js +12 -4
  71. package/dist/packages/@ember/object/index.js +3 -101
  72. package/dist/packages/@ember/object/internals.js +0 -1
  73. package/dist/packages/@ember/object/lib/computed/computed_macros.js +12 -384
  74. package/dist/packages/@ember/object/lib/computed/reduce_computed_macros.js +9 -360
  75. package/dist/packages/@ember/polyfills/index.js +1 -6
  76. package/dist/packages/@ember/polyfills/lib/assign.js +12 -28
  77. package/dist/packages/@ember/routing/index.js +1 -1
  78. package/dist/packages/@ember/runloop/index.js +1 -83
  79. package/dist/packages/@ember/string/index.js +1 -206
  80. package/dist/packages/@ember/utils/index.js +0 -1
  81. package/dist/packages/ember/index.js +17 -180
  82. package/dist/packages/ember/version.js +1 -1
  83. package/dist/packages/ember-testing/index.js +0 -2
  84. package/dist/packages/ember-testing/lib/helpers.js +0 -12
  85. package/dist/packages/ember-testing/lib/setup_for_testing.js +0 -10
  86. package/docs/data.json +1637 -3659
  87. package/lib/index.js +14 -59
  88. package/lib/overrides.js +0 -61
  89. package/lib/transforms/inject-babel-helpers.js +1 -3
  90. package/package.json +27 -23
  91. package/dist/packages/@ember/-internals/console/index.js +0 -190
  92. package/dist/packages/@ember/-internals/runtime/lib/copy.js +0 -119
  93. package/dist/packages/@ember/-internals/runtime/lib/ext/function.js +0 -155
  94. package/dist/packages/@ember/-internals/runtime/lib/mixins/copyable.js +0 -31
  95. package/dist/packages/@ember/-internals/views/lib/mixins/text_support.js +0 -357
  96. package/dist/packages/@ember/-internals/views/lib/system/jquery.js +0 -26
  97. package/dist/packages/@ember/-internals/views/lib/system/jquery_event_deprecation.js +0 -60
  98. package/dist/packages/@ember/application/deprecations.js +0 -25
  99. package/dist/packages/@ember/application/globals-resolver.js +0 -434
  100. package/dist/packages/@ember/application/resolver.js +0 -1
  101. package/dist/packages/@ember/component/checkbox.js +0 -17
  102. package/dist/packages/@ember/component/text-area.js +0 -17
  103. package/dist/packages/@ember/component/text-field.js +0 -17
  104. package/dist/packages/@ember/polyfills/lib/merge.js +0 -50
  105. package/dist/packages/@ember/routing/link-component.js +0 -17
  106. package/dist/packages/ember-testing/lib/events.js +0 -102
  107. package/dist/packages/ember-testing/lib/helpers/-is-form-control.js +0 -19
  108. package/dist/packages/ember-testing/lib/helpers/click.js +0 -32
  109. package/dist/packages/ember-testing/lib/helpers/fill_in.js +0 -47
  110. package/dist/packages/ember-testing/lib/helpers/find.js +0 -40
  111. package/dist/packages/ember-testing/lib/helpers/find_with_assert.js +0 -37
  112. package/dist/packages/ember-testing/lib/helpers/key_event.js +0 -37
  113. package/dist/packages/ember-testing/lib/helpers/trigger_event.js +0 -61
  114. package/dist/packages/ember-testing/lib/support.js +0 -57
  115. package/dist/packages/jquery/index.js +0 -2
@@ -1,32 +0,0 @@
1
- /**
2
- @module ember
3
- */
4
- import { focus, fireEvent } from '../events';
5
- /**
6
- Clicks an element and triggers any actions triggered by the element's `click`
7
- event.
8
-
9
- Example:
10
-
11
- ```javascript
12
- click('.some-jQuery-selector').then(function() {
13
- // assert something
14
- });
15
- ```
16
-
17
- @method click
18
- @param {String} selector jQuery selector for finding element on the DOM
19
- @param {Object} context A DOM Element, Document, or jQuery to use as context
20
- @return {RSVP.Promise<undefined>}
21
- @public
22
- */
23
-
24
- export default function click(app, selector, context) {
25
- let $el = app.testHelpers.findWithAssert(selector, context);
26
- let el = $el[0];
27
- fireEvent(el, 'mousedown');
28
- focus(el);
29
- fireEvent(el, 'mouseup');
30
- fireEvent(el, 'click');
31
- return app.testHelpers.wait();
32
- }
@@ -1,47 +0,0 @@
1
- /**
2
- @module ember
3
- */
4
- import { focus, fireEvent } from '../events';
5
- import isFormControl from './-is-form-control';
6
- /**
7
- Fills in an input element with some text.
8
-
9
- Example:
10
-
11
- ```javascript
12
- fillIn('#email', 'you@example.com').then(function() {
13
- // assert something
14
- });
15
- ```
16
-
17
- @method fillIn
18
- @param {String} selector jQuery selector finding an input element on the DOM
19
- to fill text with
20
- @param {String} text text to place inside the input element
21
- @return {RSVP.Promise<undefined>}
22
- @public
23
- */
24
-
25
- export default function fillIn(app, selector, contextOrText, text) {
26
- let $el, el, context;
27
-
28
- if (text === undefined) {
29
- text = contextOrText;
30
- } else {
31
- context = contextOrText;
32
- }
33
-
34
- $el = app.testHelpers.findWithAssert(selector, context);
35
- el = $el[0];
36
- focus(el);
37
-
38
- if (isFormControl(el)) {
39
- el.value = text;
40
- } else {
41
- el.innerHTML = text;
42
- }
43
-
44
- fireEvent(el, 'input');
45
- fireEvent(el, 'change');
46
- return app.testHelpers.wait();
47
- }
@@ -1,40 +0,0 @@
1
- /**
2
- @module ember
3
- */
4
- import { get } from '@ember/-internals/metal';
5
- import { assert } from '@ember/debug';
6
- import { jQueryDisabled } from '@ember/-internals/views';
7
- /**
8
- Finds an element in the context of the app's container element. A simple alias
9
- for `app.$(selector)`.
10
-
11
- Example:
12
-
13
- ```javascript
14
- var $el = find('.my-selector');
15
- ```
16
-
17
- With the `context` param:
18
-
19
- ```javascript
20
- var $el = find('.my-selector', '.parent-element-class');
21
- ```
22
-
23
- @method find
24
- @param {String} selector jQuery selector for element lookup
25
- @param {String} [context] (optional) jQuery selector that will limit the selector
26
- argument to find only within the context's children
27
- @return {Object} DOM element representing the results of the query
28
- @public
29
- */
30
-
31
- export default function find(app, selector, context) {
32
- if (jQueryDisabled) {
33
- assert('If jQuery is disabled, please import and use helpers from @ember/test-helpers [https://github.com/emberjs/ember-test-helpers]. Note: `find` is not an available helper.');
34
- }
35
-
36
- let $el;
37
- context = context || get(app, 'rootElement');
38
- $el = app.$(selector, context);
39
- return $el;
40
- }
@@ -1,37 +0,0 @@
1
- /**
2
- @module ember
3
- */
4
-
5
- /**
6
- Like `find`, but throws an error if the element selector returns no results.
7
-
8
- Example:
9
-
10
- ```javascript
11
- var $el = findWithAssert('.doesnt-exist'); // throws error
12
- ```
13
-
14
- With the `context` param:
15
-
16
- ```javascript
17
- var $el = findWithAssert('.selector-id', '.parent-element-class'); // assert will pass
18
- ```
19
-
20
- @method findWithAssert
21
- @param {String} selector jQuery selector string for finding an element within
22
- the DOM
23
- @param {String} [context] (optional) jQuery selector that will limit the
24
- selector argument to find only within the context's children
25
- @return {Object} jQuery object representing the results of the query
26
- @throws {Error} throws error if object returned has a length of 0
27
- @public
28
- */
29
- export default function findWithAssert(app, selector, context) {
30
- let $el = app.testHelpers.find(selector, context);
31
-
32
- if ($el.length === 0) {
33
- throw new Error('Element ' + selector + ' not found.');
34
- }
35
-
36
- return $el;
37
- }
@@ -1,37 +0,0 @@
1
- /**
2
- @module ember
3
- */
4
-
5
- /**
6
- Simulates a key event, e.g. `keypress`, `keydown`, `keyup` with the desired keyCode
7
- Example:
8
- ```javascript
9
- keyEvent('.some-jQuery-selector', 'keypress', 13).then(function() {
10
- // assert something
11
- });
12
- ```
13
- @method keyEvent
14
- @param {String} selector jQuery selector for finding element on the DOM
15
- @param {String} type the type of key event, e.g. `keypress`, `keydown`, `keyup`
16
- @param {Number} keyCode the keyCode of the simulated key event
17
- @return {RSVP.Promise<undefined>}
18
- @since 1.5.0
19
- @public
20
- */
21
- export default function keyEvent(app, selector, contextOrType, typeOrKeyCode, keyCode) {
22
- let context, type;
23
-
24
- if (keyCode === undefined) {
25
- context = null;
26
- keyCode = typeOrKeyCode;
27
- type = contextOrType;
28
- } else {
29
- context = contextOrType;
30
- type = typeOrKeyCode;
31
- }
32
-
33
- return app.testHelpers.triggerEvent(selector, context, type, {
34
- keyCode,
35
- which: keyCode
36
- });
37
- }
@@ -1,61 +0,0 @@
1
- /**
2
- @module ember
3
- */
4
- import { fireEvent } from '../events';
5
- /**
6
- Triggers the given DOM event on the element identified by the provided selector.
7
- Example:
8
- ```javascript
9
- triggerEvent('#some-elem-id', 'blur');
10
- ```
11
- This is actually used internally by the `keyEvent` helper like so:
12
- ```javascript
13
- triggerEvent('#some-elem-id', 'keypress', { keyCode: 13 });
14
- ```
15
- @method triggerEvent
16
- @param {String} selector jQuery selector for finding element on the DOM
17
- @param {String} [context] jQuery selector that will limit the selector
18
- argument to find only within the context's children
19
- @param {String} type The event type to be triggered.
20
- @param {Object} [options] The options to be passed to jQuery.Event.
21
- @return {RSVP.Promise<undefined>}
22
- @since 1.5.0
23
- @public
24
- */
25
-
26
- export default function triggerEvent(app, selector, contextOrType, typeOrOptions, possibleOptions) {
27
- let arity = arguments.length;
28
- let context, type, options;
29
-
30
- if (arity === 3) {
31
- // context and options are optional, so this is
32
- // app, selector, type
33
- context = null;
34
- type = contextOrType;
35
- options = {};
36
- } else if (arity === 4) {
37
- // context and options are optional, so this is
38
- if (typeof typeOrOptions === 'object') {
39
- // either
40
- // app, selector, type, options
41
- context = null;
42
- type = contextOrType;
43
- options = typeOrOptions;
44
- } else {
45
- // or
46
- // app, selector, context, type
47
- context = contextOrType;
48
- type = typeOrOptions;
49
- options = {};
50
- }
51
- } else {
52
- context = contextOrType;
53
- type = typeOrOptions;
54
- options = possibleOptions;
55
- }
56
-
57
- let $el = app.testHelpers.findWithAssert(selector, context);
58
- let el = $el[0];
59
- fireEvent(el, type, options);
60
- return app.testHelpers.wait();
61
- }
@@ -1,57 +0,0 @@
1
- import { warn } from '@ember/debug';
2
- import { jQuery, jQueryDisabled } from '@ember/-internals/views';
3
- import { hasDOM } from '@ember/-internals/browser-environment';
4
- /**
5
- @module ember
6
- */
7
-
8
- const $ = jQuery;
9
- /**
10
- This method creates a checkbox and triggers the click event to fire the
11
- passed in handler. It is used to correct for a bug in older versions
12
- of jQuery (e.g 1.8.3).
13
-
14
- @private
15
- @method testCheckboxClick
16
- */
17
-
18
- function testCheckboxClick(handler) {
19
- let input = document.createElement('input');
20
- $(input).attr('type', 'checkbox').css({
21
- position: 'absolute',
22
- left: '-1000px',
23
- top: '-1000px'
24
- }).appendTo('body').on('click', handler).trigger('click').remove();
25
- }
26
-
27
- if (hasDOM && !jQueryDisabled) {
28
- $(function () {
29
- /*
30
- Determine whether a checkbox checked using jQuery's "click" method will have
31
- the correct value for its checked property.
32
- If we determine that the current jQuery version exhibits this behavior,
33
- patch it to work correctly as in the commit for the actual fix:
34
- https://github.com/jquery/jquery/commit/1fb2f92.
35
- */
36
- testCheckboxClick(function () {
37
- if (!this.checked && !$.event.special.click) {
38
- $.event.special.click = {
39
- // For checkbox, fire native event so checked state will be right
40
- trigger() {
41
- if (this.nodeName === 'INPUT' && this.type === 'checkbox' && this.click) {
42
- this.click();
43
- return false;
44
- }
45
- }
46
-
47
- };
48
- }
49
- }); // Try again to verify that the patch took effect or blow up.
50
-
51
- testCheckboxClick(function () {
52
- warn("clicked checkboxes should be checked! the jQuery patch didn't work", this.checked, {
53
- id: 'ember-testing.test-checkbox-click'
54
- });
55
- });
56
- });
57
- }
@@ -1,2 +0,0 @@
1
- import { jQuery } from '@ember/-internals/views';
2
- export default jQuery;