ember-source 4.0.0-beta.1 → 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.
- package/CHANGELOG.md +72 -0
- package/blueprints/acceptance-test/qunit-files/tests/acceptance/__name__-test.js +1 -1
- package/blueprints/acceptance-test/qunit-rfc-232-files/tests/acceptance/__name__-test.js +1 -1
- package/blueprints/component-test/qunit-files/__root__/__testType__/__path__/__test__.js +3 -3
- package/blueprints/helper-test/index.js +4 -22
- package/blueprints/helper-test/mocha-0.12-files/__root__/__testType__/__collection__/__name__-test.js +1 -13
- package/blueprints/helper-test/mocha-files/__root__/__testType__/__collection__/__name__-test.js +0 -13
- package/blueprints/helper-test/mocha-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js +2 -12
- package/blueprints/helper-test/qunit-files/__root__/__testType__/__collection__/__name__-test.js +2 -13
- package/blueprints/helper-test/qunit-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js +2 -14
- package/blueprints/initializer/files/__root__/initializers/__name__.js +0 -1
- package/blueprints/instance-initializer/files/__root__/instance-initializers/__name__.js +0 -1
- package/build-metadata.json +3 -3
- package/dist/dependencies/@glimmer/manager.js +19 -98
- package/dist/dependencies/@glimmer/opcode-compiler.js +9 -146
- package/dist/dependencies/@glimmer/runtime.js +1 -55
- package/dist/dependencies/@glimmer/validator.js +19 -51
- package/dist/ember-template-compiler.js +383 -961
- package/dist/ember-template-compiler.map +1 -1
- package/dist/ember-testing.js +4 -513
- package/dist/ember-testing.map +1 -1
- package/dist/ember.debug.js +3246 -8084
- package/dist/ember.debug.map +1 -1
- package/dist/header/license.js +1 -1
- package/dist/packages/@ember/-internals/container/index.js +17 -183
- package/dist/packages/@ember/-internals/environment/index.js +0 -27
- package/dist/packages/@ember/-internals/extension-support/lib/container_debug_adapter.js +7 -0
- package/dist/packages/@ember/-internals/glimmer/index.js +4827 -6812
- package/dist/packages/@ember/-internals/metal/index.js +21 -45
- package/dist/packages/@ember/-internals/routing/lib/services/router.js +8 -0
- package/dist/packages/@ember/-internals/routing/lib/services/routing.js +1 -1
- package/dist/packages/@ember/-internals/routing/lib/system/route.js +1 -41
- package/dist/packages/@ember/-internals/routing/lib/system/router.js +22 -91
- package/dist/packages/@ember/-internals/runtime/lib/mixins/array.js +2 -173
- package/dist/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +3 -43
- package/dist/packages/@ember/-internals/runtime/lib/system/array_proxy.js +8 -15
- package/dist/packages/@ember/-internals/runtime/lib/system/core_object.js +4 -90
- package/dist/packages/@ember/-internals/utils/index.js +0 -3
- package/dist/packages/@ember/-internals/views/index.js +0 -2
- package/dist/packages/@ember/-internals/views/lib/mixins/view_support.js +4 -4
- package/dist/packages/@ember/-internals/views/lib/system/event_dispatcher.js +22 -72
- package/dist/packages/@ember/application/instance.js +1 -22
- package/dist/packages/@ember/application/lib/application.js +14 -32
- package/dist/packages/@ember/canary-features/index.js +0 -2
- package/dist/packages/@ember/component/index.js +1 -1
- package/dist/packages/@ember/deprecated-features/index.js +0 -4
- package/dist/packages/@ember/engine/index.js +2 -7
- package/dist/packages/@ember/engine/instance.js +0 -4
- package/dist/packages/@ember/object/lib/computed/computed_macros.js +0 -373
- package/dist/packages/@ember/object/lib/computed/reduce_computed_macros.js +0 -351
- package/dist/packages/@ember/routing/index.js +1 -1
- package/dist/packages/ember/index.js +9 -62
- package/dist/packages/ember/version.js +1 -1
- package/dist/packages/ember-testing/index.js +0 -2
- package/dist/packages/ember-testing/lib/helpers.js +0 -12
- package/dist/packages/ember-testing/lib/setup_for_testing.js +0 -10
- package/docs/data.json +598 -1901
- package/lib/index.js +13 -51
- package/package.json +18 -18
- package/dist/packages/@ember/-internals/views/lib/mixins/text_support.js +0 -345
- package/dist/packages/@ember/-internals/views/lib/system/jquery.js +0 -26
- package/dist/packages/@ember/component/checkbox.js +0 -17
- package/dist/packages/@ember/component/text-area.js +0 -17
- package/dist/packages/@ember/component/text-field.js +0 -17
- package/dist/packages/@ember/routing/link-component.js +0 -17
- package/dist/packages/ember-testing/lib/events.js +0 -101
- package/dist/packages/ember-testing/lib/helpers/-is-form-control.js +0 -19
- package/dist/packages/ember-testing/lib/helpers/click.js +0 -32
- package/dist/packages/ember-testing/lib/helpers/fill_in.js +0 -47
- package/dist/packages/ember-testing/lib/helpers/find.js +0 -40
- package/dist/packages/ember-testing/lib/helpers/find_with_assert.js +0 -37
- package/dist/packages/ember-testing/lib/helpers/key_event.js +0 -37
- package/dist/packages/ember-testing/lib/helpers/trigger_event.js +0 -61
- package/dist/packages/ember-testing/lib/support.js +0 -57
- package/dist/packages/jquery/index.js +0 -2
package/dist/header/license.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { setOwner } from '@ember/-internals/owner';
|
|
2
2
|
import { dictionary, symbol, intern } from '@ember/-internals/utils';
|
|
3
|
-
import { assert } from '@ember/debug';
|
|
3
|
+
import { assert, deprecate } from '@ember/debug';
|
|
4
4
|
import { DEBUG } from '@glimmer/env';
|
|
5
5
|
|
|
6
6
|
let leakTracking;
|
|
@@ -347,53 +347,6 @@ function instantiateFactory(container, normalizedName, fullName, options) {
|
|
|
347
347
|
throw new Error('Could not create factory');
|
|
348
348
|
}
|
|
349
349
|
|
|
350
|
-
function processInjections(container, injections, result) {
|
|
351
|
-
if (DEBUG) {
|
|
352
|
-
container.registry.validateInjections(injections);
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
let hash = result.injections;
|
|
356
|
-
|
|
357
|
-
for (let i = 0; i < injections.length; i++) {
|
|
358
|
-
let {
|
|
359
|
-
property,
|
|
360
|
-
specifier
|
|
361
|
-
} = injections[i];
|
|
362
|
-
hash[property] = lookup(container, specifier);
|
|
363
|
-
|
|
364
|
-
if (!result.isDynamic) {
|
|
365
|
-
result.isDynamic = !isSingleton(container, specifier);
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
function buildInjections(container, typeInjections, injections) {
|
|
371
|
-
let injectionsHash = {};
|
|
372
|
-
setOwner(injectionsHash, container.owner);
|
|
373
|
-
let result = {
|
|
374
|
-
injections: injectionsHash,
|
|
375
|
-
isDynamic: false
|
|
376
|
-
};
|
|
377
|
-
|
|
378
|
-
if (typeInjections !== undefined) {
|
|
379
|
-
processInjections(container, typeInjections, result);
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
if (injections !== undefined) {
|
|
383
|
-
processInjections(container, injections, result);
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
return result;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
function injectionsFor(container, fullName) {
|
|
390
|
-
let registry = container.registry;
|
|
391
|
-
let [type] = fullName.split(':');
|
|
392
|
-
let typeInjections = registry.getTypeInjections(type);
|
|
393
|
-
let injections = registry.getInjections(fullName);
|
|
394
|
-
return buildInjections(container, typeInjections, injections);
|
|
395
|
-
}
|
|
396
|
-
|
|
397
350
|
function destroyDestroyables(container) {
|
|
398
351
|
let cache = container.cache;
|
|
399
352
|
let keys = Object.keys(cache);
|
|
@@ -445,7 +398,7 @@ class FactoryManager {
|
|
|
445
398
|
this.injections = undefined;
|
|
446
399
|
setFactoryFor(this, this);
|
|
447
400
|
|
|
448
|
-
if (
|
|
401
|
+
if (isInstantiatable(container, fullName)) {
|
|
449
402
|
setFactoryFor(factory, this);
|
|
450
403
|
}
|
|
451
404
|
}
|
|
@@ -467,20 +420,9 @@ class FactoryManager {
|
|
|
467
420
|
throw new Error(`Can not create new instances after the owner has been destroyed (you attempted to create ${this.fullName})`);
|
|
468
421
|
}
|
|
469
422
|
|
|
470
|
-
let props =
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
let {
|
|
474
|
-
injections,
|
|
475
|
-
isDynamic
|
|
476
|
-
} = injectionsFor(this.container, this.normalizedName);
|
|
477
|
-
setFactoryFor(injections, this);
|
|
478
|
-
props = injections;
|
|
479
|
-
|
|
480
|
-
if (!isDynamic) {
|
|
481
|
-
this.injections = injections;
|
|
482
|
-
}
|
|
483
|
-
}
|
|
423
|
+
let props = {};
|
|
424
|
+
setOwner(props, container.owner);
|
|
425
|
+
setFactoryFor(props, this);
|
|
484
426
|
|
|
485
427
|
if (options !== undefined) {
|
|
486
428
|
props = Object.assign({}, props, options);
|
|
@@ -525,8 +467,6 @@ class Registry {
|
|
|
525
467
|
this.fallback = options.fallback || null;
|
|
526
468
|
this.resolver = options.resolver || null;
|
|
527
469
|
this.registrations = dictionary(options.registrations || null);
|
|
528
|
-
this._typeInjections = dictionary(null);
|
|
529
|
-
this._injections = dictionary(null);
|
|
530
470
|
this._localLookupCache = Object.create(null);
|
|
531
471
|
this._normalizeCache = dictionary(null);
|
|
532
472
|
this._resolveCache = dictionary(null);
|
|
@@ -554,18 +494,6 @@ class Registry {
|
|
|
554
494
|
@type InheritingDict
|
|
555
495
|
*/
|
|
556
496
|
|
|
557
|
-
/**
|
|
558
|
-
@private
|
|
559
|
-
@property _typeInjections
|
|
560
|
-
@type InheritingDict
|
|
561
|
-
*/
|
|
562
|
-
|
|
563
|
-
/**
|
|
564
|
-
@private
|
|
565
|
-
@property _injections
|
|
566
|
-
@type InheritingDict
|
|
567
|
-
*/
|
|
568
|
-
|
|
569
497
|
/**
|
|
570
498
|
@private
|
|
571
499
|
@property _normalizeCache
|
|
@@ -864,93 +792,27 @@ class Registry {
|
|
|
864
792
|
return undefined;
|
|
865
793
|
}
|
|
866
794
|
/**
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
all objects of one type to be injected with a reference to another
|
|
870
|
-
object.
|
|
871
|
-
For example, provided each object of type `controller` needed a `router`.
|
|
872
|
-
one would do the following:
|
|
873
|
-
```javascript
|
|
874
|
-
let registry = new Registry();
|
|
875
|
-
let container = registry.container();
|
|
876
|
-
registry.register('router:main', Router);
|
|
877
|
-
registry.register('controller:user', UserController);
|
|
878
|
-
registry.register('controller:post', PostController);
|
|
879
|
-
registry.typeInjection('controller', 'router', 'router:main');
|
|
880
|
-
let user = container.lookup('controller:user');
|
|
881
|
-
let post = container.lookup('controller:post');
|
|
882
|
-
user.router instanceof Router; //=> true
|
|
883
|
-
post.router instanceof Router; //=> true
|
|
884
|
-
// both controllers share the same router
|
|
885
|
-
user.router === post.router; //=> true
|
|
886
|
-
```
|
|
887
|
-
@private
|
|
888
|
-
@method typeInjection
|
|
889
|
-
@param {String} type
|
|
890
|
-
@param {String} property
|
|
891
|
-
@param {String} fullName
|
|
892
|
-
*/
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
typeInjection(type, property, fullName) {
|
|
896
|
-
assert('fullName must be a proper full name', this.isValidFullName(fullName));
|
|
897
|
-
let fullNameType = fullName.split(':')[0];
|
|
898
|
-
assert(`Cannot inject a '${fullName}' on other ${type}(s).`, fullNameType !== type);
|
|
899
|
-
let injections = this._typeInjections[type] || (this._typeInjections[type] = []);
|
|
900
|
-
injections.push({
|
|
901
|
-
property,
|
|
902
|
-
specifier: fullName
|
|
903
|
-
});
|
|
904
|
-
}
|
|
905
|
-
/**
|
|
906
|
-
Defines injection rules.
|
|
907
|
-
These rules are used to inject dependencies onto objects when they
|
|
908
|
-
are instantiated.
|
|
909
|
-
Two forms of injections are possible:
|
|
910
|
-
* Injecting one fullName on another fullName
|
|
911
|
-
* Injecting one fullName on a type
|
|
912
|
-
Example:
|
|
913
|
-
```javascript
|
|
914
|
-
let registry = new Registry();
|
|
915
|
-
let container = registry.container();
|
|
916
|
-
registry.register('source:main', Source);
|
|
917
|
-
registry.register('model:user', User);
|
|
918
|
-
registry.register('model:post', Post);
|
|
919
|
-
// injecting one fullName on another fullName
|
|
920
|
-
// eg. each user model gets a post model
|
|
921
|
-
registry.injection('model:user', 'post', 'model:post');
|
|
922
|
-
// injecting one fullName on another type
|
|
923
|
-
registry.injection('model', 'source', 'source:main');
|
|
924
|
-
let user = container.lookup('model:user');
|
|
925
|
-
let post = container.lookup('model:post');
|
|
926
|
-
user.source instanceof Source; //=> true
|
|
927
|
-
post.source instanceof Source; //=> true
|
|
928
|
-
user.post instanceof Post; //=> true
|
|
929
|
-
// and both models share the same source
|
|
930
|
-
user.source === post.source; //=> true
|
|
795
|
+
This is deprecated in favor of explicit injection of dependencies.
|
|
796
|
+
Reference: https://deprecations.emberjs.com/v3.x#toc_implicit-injections
|
|
931
797
|
```
|
|
932
798
|
@private
|
|
933
799
|
@method injection
|
|
934
800
|
@param {String} factoryName
|
|
935
801
|
@param {String} property
|
|
936
802
|
@param {String} injectionName
|
|
803
|
+
@deprecated
|
|
937
804
|
*/
|
|
938
805
|
|
|
939
806
|
|
|
940
|
-
injection(fullName, property
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
let normalizedName = this.normalize(fullName);
|
|
950
|
-
let injections = this._injections[normalizedName] || (this._injections[normalizedName] = []);
|
|
951
|
-
injections.push({
|
|
952
|
-
property,
|
|
953
|
-
specifier: normalizedInjectionName
|
|
807
|
+
injection(fullName, property) {
|
|
808
|
+
deprecate(`As of Ember 4.0.0, owner.inject no longer injects values into resolved instances, and calling the method has been deprecated. Since this method no longer does anything, it is fully safe to remove this injection. As an alternative to this API, you can refactor to explicitly inject \`${property}\` on \`${fullName}\`, or look it up directly using the \`getOwner\` API.`, false, {
|
|
809
|
+
id: 'remove-owner-inject',
|
|
810
|
+
until: '5.0.0',
|
|
811
|
+
url: 'https://deprecations.emberjs.com/v4.x#toc_implicit-injections',
|
|
812
|
+
for: 'ember-source',
|
|
813
|
+
since: {
|
|
814
|
+
enabled: '4.0.0'
|
|
815
|
+
}
|
|
954
816
|
});
|
|
955
817
|
}
|
|
956
818
|
/**
|
|
@@ -990,34 +852,6 @@ class Registry {
|
|
|
990
852
|
return VALID_FULL_NAME_REGEXP.test(fullName);
|
|
991
853
|
}
|
|
992
854
|
|
|
993
|
-
getInjections(fullName) {
|
|
994
|
-
let injections = this._injections[fullName];
|
|
995
|
-
|
|
996
|
-
if (this.fallback !== null) {
|
|
997
|
-
let fallbackInjections = this.fallback.getInjections(fullName);
|
|
998
|
-
|
|
999
|
-
if (fallbackInjections !== undefined) {
|
|
1000
|
-
injections = injections === undefined ? fallbackInjections : injections.concat(fallbackInjections);
|
|
1001
|
-
}
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
|
-
return injections;
|
|
1005
|
-
}
|
|
1006
|
-
|
|
1007
|
-
getTypeInjections(type) {
|
|
1008
|
-
let injections = this._typeInjections[type];
|
|
1009
|
-
|
|
1010
|
-
if (this.fallback !== null) {
|
|
1011
|
-
let fallbackInjections = this.fallback.getTypeInjections(type);
|
|
1012
|
-
|
|
1013
|
-
if (fallbackInjections !== undefined) {
|
|
1014
|
-
injections = injections === undefined ? fallbackInjections : injections.concat(fallbackInjections);
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
1017
|
-
|
|
1018
|
-
return injections;
|
|
1019
|
-
}
|
|
1020
|
-
|
|
1021
855
|
}
|
|
1022
856
|
|
|
1023
857
|
if (DEBUG) {
|
|
@@ -145,18 +145,6 @@ const ENV = {
|
|
|
145
145
|
*/
|
|
146
146
|
_DEBUG_RENDER_TREE: DEBUG,
|
|
147
147
|
|
|
148
|
-
/**
|
|
149
|
-
Whether the app is using jQuery. See RFC #294.
|
|
150
|
-
This is not intended to be set directly, as the implementation may change in
|
|
151
|
-
the future. Use `@ember/optional-features` instead.
|
|
152
|
-
@property _JQUERY_INTEGRATION
|
|
153
|
-
@for EmberENV
|
|
154
|
-
@type Boolean
|
|
155
|
-
@default true
|
|
156
|
-
@private
|
|
157
|
-
*/
|
|
158
|
-
_JQUERY_INTEGRATION: true,
|
|
159
|
-
|
|
160
148
|
/**
|
|
161
149
|
Whether the app defaults to using async observers.
|
|
162
150
|
This is not intended to be set directly, as the implementation may change in
|
|
@@ -180,21 +168,6 @@ const ENV = {
|
|
|
180
168
|
@private
|
|
181
169
|
*/
|
|
182
170
|
_RERENDER_LOOP_LIMIT: 1000,
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
Allows disabling the implicit this property fallback deprecation. This could be useful
|
|
186
|
-
as a way to control the volume of deprecations that are issued by temporarily disabling
|
|
187
|
-
the implicit this fallback deprecations, which would allow the other deprecations to be more easily
|
|
188
|
-
identified in the console).
|
|
189
|
-
NOTE: The fallback behavior **will be removed** in Ember 4.0.0, disabling **_IS NOT_**
|
|
190
|
-
a viable strategy for handling this deprecation.
|
|
191
|
-
@property _DISABLE_PROPERTY_FALLBACK_DEPRECATION
|
|
192
|
-
@for EmberENV
|
|
193
|
-
@type boolean
|
|
194
|
-
@default false
|
|
195
|
-
@private
|
|
196
|
-
*/
|
|
197
|
-
_DISABLE_PROPERTY_FALLBACK_DEPRECATION: false,
|
|
198
171
|
EMBER_LOAD_HOOKS: {},
|
|
199
172
|
FEATURES: {}
|
|
200
173
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { classify, dasherize } from '@ember/string';
|
|
2
2
|
import { A as emberA, typeOf, Namespace, Object as EmberObject } from '@ember/-internals/runtime';
|
|
3
|
+
import { getOwner } from '@ember/-internals/owner';
|
|
3
4
|
/**
|
|
4
5
|
@module @ember/debug
|
|
5
6
|
*/
|
|
@@ -40,6 +41,12 @@ import { A as emberA, typeOf, Namespace, Object as EmberObject } from '@ember/-i
|
|
|
40
41
|
*/
|
|
41
42
|
|
|
42
43
|
export default EmberObject.extend({
|
|
44
|
+
init() {
|
|
45
|
+
this._super(...arguments);
|
|
46
|
+
|
|
47
|
+
this.resolver = getOwner(this).lookup('resolver-for-debugging:main');
|
|
48
|
+
},
|
|
49
|
+
|
|
43
50
|
/**
|
|
44
51
|
The resolver instance of the application
|
|
45
52
|
being debugged. This property will be injected
|