static-injector 1.0.6 → 1.0.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/import/commonjs/index.js +1295 -0
- package/import/{decorator → es2015/decorator}/injectable.js +1 -4
- package/import/{di → es2015/decorator}/interface/provider.js +1 -2
- package/import/{di → es2015/di}/forward_ref.js +8 -14
- package/import/{di → es2015/di}/inject_switch.js +8 -12
- package/import/{di → es2015/di}/injection_token.js +3 -9
- package/import/es2015/di/injector.js +63 -0
- package/import/{di → es2015/di}/injector_compatibility.js +31 -42
- package/import/{di → es2015/di}/injector_marker.js +1 -2
- package/import/{di → es2015/di}/injector_token.js +2 -5
- package/import/{di → es2015/di}/interface/defs.js +7 -42
- package/import/{di → es2015/di}/interface/injector.js +2 -5
- package/import/{decorator → es2015/di}/interface/provider.js +1 -2
- package/import/{di → es2015/di}/metadata.js +10 -13
- package/import/es2015/di/null_injector.js +19 -0
- package/import/{di → es2015/di}/provider_token.js +1 -2
- package/import/{di → es2015/di}/r3_injector.js +53 -153
- package/import/{di → es2015/di}/scope.js +2 -5
- package/import/es2015/index.js +12 -0
- package/import/{interface → es2015/interface}/lifecycle_hooks.js +1 -2
- package/import/es2015/interface/type.js +8 -0
- package/import/es2015/render3/definition_factory.js +15 -0
- package/import/es2015/render3/di.js +49 -0
- package/import/{render3 → es2015/render3}/error_code.js +2 -7
- package/import/es2015/render3/errors_di.js +14 -0
- package/import/es2015/render3/fields.js +11 -0
- package/import/{render3 → es2015/render3}/instructions/di.js +1 -5
- package/import/{render3 → es2015/render3}/util/stringify_utils.js +2 -7
- package/import/{util → es2015/util}/array_utils.js +2 -7
- package/import/{util → es2015/util}/closure.js +1 -5
- package/import/es2015/util/decorators.js +30 -0
- package/import/{util → es2015/util}/empty.js +1 -4
- package/import/{util → es2015/util}/property.js +1 -5
- package/import/{util → es2015/util}/stringify.js +1 -5
- package/import/fesm2015/index.js +1257 -0
- package/import/{decorator → typings/decorator}/injectable.d.ts +0 -0
- package/import/{decorator → typings/decorator}/interface/provider.d.ts +0 -0
- package/import/{di → typings/di}/forward_ref.d.ts +0 -0
- package/import/{di → typings/di}/inject_switch.d.ts +0 -0
- package/import/{di → typings/di}/injection_token.d.ts +0 -2
- package/import/{di → typings/di}/injector.d.ts +0 -10
- package/import/{di → typings/di}/injector_compatibility.d.ts +0 -0
- package/import/{di → typings/di}/injector_marker.d.ts +0 -0
- package/import/{di → typings/di}/injector_token.d.ts +0 -0
- package/import/{di → typings/di}/interface/defs.d.ts +4 -20
- package/import/{di → typings/di}/interface/injector.d.ts +0 -0
- package/import/{di → typings/di}/interface/provider.d.ts +0 -0
- package/import/{di → typings/di}/metadata.d.ts +0 -0
- package/import/{di → typings/di}/null_injector.d.ts +0 -0
- package/import/{di → typings/di}/provider_token.d.ts +0 -0
- package/import/{di → typings/di}/r3_injector.d.ts +0 -2
- package/import/{di → typings/di}/scope.d.ts +0 -0
- package/import/{index.d.ts → typings/index.d.ts} +1 -0
- package/import/{interface → typings/interface}/lifecycle_hooks.d.ts +0 -0
- package/import/{interface → typings/interface}/type.d.ts +0 -11
- package/import/{render3 → typings/render3}/definition_factory.d.ts +0 -0
- package/import/typings/render3/di.d.ts +12 -0
- package/import/{render3 → typings/render3}/error_code.d.ts +0 -0
- package/import/{render3 → typings/render3}/errors_di.d.ts +0 -0
- package/import/{render3 → typings/render3}/fields.d.ts +0 -0
- package/import/{render3 → typings/render3}/instructions/di.d.ts +0 -0
- package/import/{render3 → typings/render3}/util/stringify_utils.d.ts +0 -0
- package/import/{util → typings/util}/array_utils.d.ts +0 -0
- package/import/{util → typings/util}/closure.d.ts +0 -0
- package/import/{util → typings/util}/decorators.d.ts +1 -3
- package/import/{util → typings/util}/empty.d.ts +0 -0
- package/import/{util → typings/util}/property.d.ts +0 -0
- package/import/{util → typings/util}/stringify.d.ts +0 -0
- package/package.json +8 -4
- package/readme.md +6 -0
- package/transform/compiler/index.js +15 -6
- package/transform/compiler/src/injectable_compiler_2.js +20 -2
- package/transform/compiler/src/render3/partial/util.js +20 -2
- package/transform/compiler/src/render3/r3_factory.js +20 -2
- package/transform/compiler/src/render3/util.js +20 -2
- package/transform/compiler/src/render3/view/util.js +20 -2
- package/transform/compiler-cli/src/ngtsc/annotations/src/injectable.js +20 -2
- package/transform/compiler-cli/src/ngtsc/annotations/src/util.js +20 -2
- package/transform/compiler-cli/src/ngtsc/diagnostics/error.js +20 -2
- package/transform/compiler-cli/src/ngtsc/diagnostics/index.js +12 -3
- package/transform/compiler-cli/src/ngtsc/imports/index.js +11 -2
- package/transform/compiler-cli/src/ngtsc/reflection/index.js +13 -4
- package/transform/compiler-cli/src/ngtsc/reflection/src/host.js +20 -2
- package/transform/compiler-cli/src/ngtsc/reflection/src/type_to_value.js +20 -2
- package/transform/compiler-cli/src/ngtsc/reflection/src/typescript.js +20 -2
- package/transform/compiler-cli/src/ngtsc/reflection/src/util.js +20 -2
- package/transform/compiler-cli/src/ngtsc/transform/index.js +12 -3
- package/transform/compiler-cli/src/ngtsc/transform/src/utils.js +20 -2
- package/transform/compiler-cli/src/ngtsc/translator/index.js +15 -6
- package/transform/compiler-cli/src/ngtsc/translator/src/import_manager.js +20 -2
- package/transform/compiler-cli/src/ngtsc/translator/src/translator.js +20 -2
- package/transform/compiler-cli/src/ngtsc/translator/src/typescript_ast_factory.js +20 -2
- package/transform/compiler-cli/src/ngtsc/util/src/typescript.js +20 -2
- package/transform/index.js +11 -2
- package/transform/injectable-transform.js +23 -2
- package/transform/node-Iteration.js +4 -2
- package/import/di/injector.js +0 -350
- package/import/di/null_injector.js +0 -23
- package/import/index.js +0 -14
- package/import/interface/type.js +0 -21
- package/import/render3/definition_factory.js +0 -19
- package/import/render3/errors_di.js +0 -18
- package/import/render3/fields.js +0 -14
- package/import/util/decorators.js +0 -58
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* @license
|
|
4
3
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -6,15 +5,13 @@
|
|
|
6
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
6
|
* found in the LICENSE file at https://angular.io/license
|
|
8
7
|
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.stringifyForError = exports.renderStringify = void 0;
|
|
11
8
|
/**
|
|
12
9
|
* Used for stringify render output in Ivy.
|
|
13
10
|
* Important! This function is very performance-sensitive and we should
|
|
14
11
|
* be extra careful not to introduce megamorphic reads in it.
|
|
15
12
|
* Check `core/test/render3/perf/render_stringify` for benchmarks and alternate implementations.
|
|
16
13
|
*/
|
|
17
|
-
function renderStringify(value) {
|
|
14
|
+
export function renderStringify(value) {
|
|
18
15
|
if (typeof value === "string")
|
|
19
16
|
return value;
|
|
20
17
|
if (value == null)
|
|
@@ -23,13 +20,12 @@ function renderStringify(value) {
|
|
|
23
20
|
// appears to be faster than calling `value.toString` (see `render_stringify` benchmark).
|
|
24
21
|
return String(value);
|
|
25
22
|
}
|
|
26
|
-
exports.renderStringify = renderStringify;
|
|
27
23
|
/**
|
|
28
24
|
* Used to stringify a value so that it can be displayed in an error message.
|
|
29
25
|
* Important! This function contains a megamorphic read and should only be
|
|
30
26
|
* used for error messages.
|
|
31
27
|
*/
|
|
32
|
-
function stringifyForError(value) {
|
|
28
|
+
export function stringifyForError(value) {
|
|
33
29
|
if (typeof value === "function")
|
|
34
30
|
return value.name || value.toString();
|
|
35
31
|
if (typeof value === "object" &&
|
|
@@ -39,4 +35,3 @@ function stringifyForError(value) {
|
|
|
39
35
|
}
|
|
40
36
|
return renderStringify(value);
|
|
41
37
|
}
|
|
42
|
-
exports.stringifyForError = stringifyForError;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* @license
|
|
4
3
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -6,17 +5,13 @@
|
|
|
6
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
6
|
* found in the LICENSE file at https://angular.io/license
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
|
-
exports.newArray = exports.deepForEach = void 0;
|
|
11
|
-
function deepForEach(input, fn) {
|
|
8
|
+
export function deepForEach(input, fn) {
|
|
12
9
|
input.forEach((value) => Array.isArray(value) ? deepForEach(value, fn) : fn(value));
|
|
13
10
|
}
|
|
14
|
-
|
|
15
|
-
function newArray(size, value) {
|
|
11
|
+
export function newArray(size, value) {
|
|
16
12
|
const list = [];
|
|
17
13
|
for (let i = 0; i < size; i++) {
|
|
18
14
|
list.push(value);
|
|
19
15
|
}
|
|
20
16
|
return list;
|
|
21
17
|
}
|
|
22
|
-
exports.newArray = newArray;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* @license
|
|
4
3
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -6,8 +5,6 @@
|
|
|
6
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
6
|
* found in the LICENSE file at https://angular.io/license
|
|
8
7
|
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.noSideEffects = void 0;
|
|
11
8
|
/**
|
|
12
9
|
* Convince closure compiler that the wrapped function has no side-effects.
|
|
13
10
|
*
|
|
@@ -17,7 +14,6 @@ exports.noSideEffects = void 0;
|
|
|
17
14
|
* to something which is retained otherwise the call to `noSideEffects` will be removed by closure
|
|
18
15
|
* compiler.
|
|
19
16
|
*/
|
|
20
|
-
function noSideEffects(fn) {
|
|
17
|
+
export function noSideEffects(fn) {
|
|
21
18
|
return { toString: fn }.toString();
|
|
22
19
|
}
|
|
23
|
-
exports.noSideEffects = noSideEffects;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
8
|
+
import { noSideEffects } from './closure';
|
|
9
|
+
function makeMetadataCtor(props) {
|
|
10
|
+
return function ctor(...args) {
|
|
11
|
+
if (props) {
|
|
12
|
+
const values = props(...args);
|
|
13
|
+
for (const propName in values) {
|
|
14
|
+
this[propName] = values[propName];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export function makeParamDecorator(name, props) {
|
|
20
|
+
return noSideEffects(() => {
|
|
21
|
+
const metaCtor = makeMetadataCtor(props);
|
|
22
|
+
function ParamDecoratorFactory(...args) {
|
|
23
|
+
if (this instanceof ParamDecoratorFactory) {
|
|
24
|
+
metaCtor.apply(this, args);
|
|
25
|
+
return this;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return ParamDecoratorFactory;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* @license
|
|
4
3
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -6,12 +5,10 @@
|
|
|
6
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
6
|
* found in the LICENSE file at https://angular.io/license
|
|
8
7
|
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.EMPTY_ARRAY = void 0;
|
|
11
8
|
/**
|
|
12
9
|
* This file contains reuseable "empty" symbols that can be used as default return values
|
|
13
10
|
* in different parts of the rendering code. Because the same symbols are returned, this
|
|
14
11
|
* allows for identity checks against these values to be consistently used by the framework
|
|
15
12
|
* code.
|
|
16
13
|
*/
|
|
17
|
-
|
|
14
|
+
export const EMPTY_ARRAY = [];
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* @license
|
|
4
3
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -6,9 +5,7 @@
|
|
|
6
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
6
|
* found in the LICENSE file at https://angular.io/license
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
|
-
exports.getClosureSafeProperty = void 0;
|
|
11
|
-
function getClosureSafeProperty(objWithPropertyToExtract) {
|
|
8
|
+
export function getClosureSafeProperty(objWithPropertyToExtract) {
|
|
12
9
|
for (let key in objWithPropertyToExtract) {
|
|
13
10
|
if (objWithPropertyToExtract[key] === getClosureSafeProperty) {
|
|
14
11
|
return key;
|
|
@@ -16,4 +13,3 @@ function getClosureSafeProperty(objWithPropertyToExtract) {
|
|
|
16
13
|
}
|
|
17
14
|
throw Error('Could not find renamed property on target object.');
|
|
18
15
|
}
|
|
19
|
-
exports.getClosureSafeProperty = getClosureSafeProperty;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* @license
|
|
4
3
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -6,9 +5,7 @@
|
|
|
6
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
6
|
* found in the LICENSE file at https://angular.io/license
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
|
-
exports.stringify = void 0;
|
|
11
|
-
function stringify(token) {
|
|
8
|
+
export function stringify(token) {
|
|
12
9
|
if (typeof token === "string") {
|
|
13
10
|
return token;
|
|
14
11
|
}
|
|
@@ -31,4 +28,3 @@ function stringify(token) {
|
|
|
31
28
|
const newLineIndex = res.indexOf("\n");
|
|
32
29
|
return newLineIndex === -1 ? res : res.substring(0, newLineIndex);
|
|
33
30
|
}
|
|
34
|
-
exports.stringify = stringify;
|