static-injector 4.0.0 → 4.0.2
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/package.json +3 -2
- package/readme.md +33 -23
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "static-injector",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"description": "Angular 依赖注入独立版本;Angular dependency injection standalone version",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"typescript 5.4.2",
|
|
11
11
|
"injectable",
|
|
12
12
|
"static-inject",
|
|
13
|
-
"dependency injection"
|
|
13
|
+
"dependency injection",
|
|
14
|
+
"injection-js"
|
|
14
15
|
],
|
|
15
16
|
"repository": {
|
|
16
17
|
"type": "git",
|
package/readme.md
CHANGED
|
@@ -1,31 +1,41 @@
|
|
|
1
|
-
|
|
1
|
+
| [中文](https://github.com/wszgrcy/static-injector/blob/main/readme.zh-Hans.md) | [English](./readme.md) |
|
|
2
|
+
|-|-|
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
- 使用方法与 Angular 的依赖注入完全一致
|
|
5
|
-
# 来源
|
|
6
|
-
- Angular 17.0.4
|
|
7
|
-
# 兼容
|
|
8
|
-
- ts 5.2.2
|
|
9
|
-
# 使用方法
|
|
4
|
+
# Introduction
|
|
10
5
|
|
|
11
|
-
-
|
|
12
|
-
-
|
|
6
|
+
- Angular dependency injection standalone version
|
|
7
|
+
- The usage method is completely consistent with Angular's dependency injection
|
|
13
8
|
|
|
14
|
-
#
|
|
9
|
+
# Source
|
|
10
|
+
- Angular 17.3.1
|
|
15
11
|
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
- 需要会使用`typescript`调用转换器进行转换,或者使用 webpack 的 ts-loader 传入转换器,或者其他转换工具支持 typescript 并且支持 typescript 的自定义转换器
|
|
19
|
-
> 未来会提供各个打包工具的使用方法
|
|
20
|
-
- 两者基本上可以互换(细节部分需要调整)
|
|
12
|
+
# dependency
|
|
13
|
+
- ts 5.4.2
|
|
21
14
|
|
|
22
|
-
#
|
|
15
|
+
# Usage
|
|
23
16
|
|
|
24
|
-
-
|
|
25
|
-
-
|
|
17
|
+
- Create a first level dependency injector with `Injector.create`
|
|
18
|
+
- Declare as a dependency injection class using the `@Injectable` decorator
|
|
26
19
|
|
|
27
|
-
#
|
|
20
|
+
# Different from `injection-js`
|
|
28
21
|
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
22
|
+
- `injection-js` belongs to dynamic dependency injection and is a version used before Angular5. After Angular5, it has been converted to static dependency injection
|
|
23
|
+
- In theory, it would be faster than `injection-js` (otherwise Angular wouldn't do the replacement...), but there was no benchmark done
|
|
24
|
+
- Need to use `typescript` to call the transformer for conversion/use webpack's ts loader to pass in the converter/roll up/ts node/other conversion tools support typescript and custom converters that support typescript
|
|
25
|
+
- The two are basically interchangeable (the details need to be adjusted)
|
|
26
|
+
|
|
27
|
+
- Support the use of `inject` during construction
|
|
28
|
+
|
|
29
|
+
# Test
|
|
30
|
+
|
|
31
|
+
- Partially conducted unit testing to ensure that most functions are functioning properly
|
|
32
|
+
- Because most of the code itself is extracted from Angular, stability is definitely guaranteed
|
|
33
|
+
|
|
34
|
+
# Sync
|
|
35
|
+
- Currently, the synchronization logic has been refactored and modified using `@code recycle/cli` to ensure consistency with the official version of `angular`
|
|
36
|
+
|
|
37
|
+
# Template
|
|
38
|
+
|
|
39
|
+
- [Used under typescript (using Typescript Compiler API)](https://github.com/wszgrcy/static-injector-typescript-template)
|
|
40
|
+
- [Used under webpack](https://github.com/wszgrcy/static-injector-webpack-template)
|
|
41
|
+
- [Using Rollup](https://github.com/wszgrcy/static-injector-rollup-template)
|