@kaokei/use-vue-service 1.0.17 → 1.1.1

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 (39) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/README.md +7 -65
  3. package/dist/index.cjs.js +46 -564
  4. package/dist/index.cjs.js.map +1 -1
  5. package/dist/index.cjs.min.js +2 -2
  6. package/dist/index.cjs.min.js.map +1 -1
  7. package/dist/index.cjs.runtime.js +46 -564
  8. package/dist/index.cjs.runtime.js.map +1 -1
  9. package/dist/index.cjs.runtime.min.js +2 -2
  10. package/dist/index.cjs.runtime.min.js.map +1 -1
  11. package/dist/index.esm.js +38 -541
  12. package/dist/index.esm.js.map +1 -1
  13. package/dist/index.esm.min.js +3 -3
  14. package/dist/index.esm.min.js.map +1 -1
  15. package/dist/index.esm.runtime.js +38 -541
  16. package/dist/index.esm.runtime.js.map +1 -1
  17. package/dist/index.esm.runtime.min.js +3 -3
  18. package/dist/index.esm.runtime.min.js.map +1 -1
  19. package/dist/index.iife.js +47 -566
  20. package/dist/index.iife.js.map +1 -1
  21. package/dist/index.iife.min.js +3 -3
  22. package/dist/index.iife.min.js.map +1 -1
  23. package/dist/src/constants.d.ts +0 -1
  24. package/dist/src/constants.d.ts.map +1 -1
  25. package/dist/src/declareProviders.d.ts +1 -0
  26. package/dist/src/declareProviders.d.ts.map +1 -1
  27. package/dist/src/defaultInjector.d.ts +2 -0
  28. package/dist/src/defaultInjector.d.ts.map +1 -0
  29. package/dist/src/fakeInject.d.ts +1 -15
  30. package/dist/src/fakeInject.d.ts.map +1 -1
  31. package/dist/src/index.d.ts +6 -5
  32. package/dist/src/index.d.ts.map +1 -1
  33. package/dist/src/useService.d.ts +4 -2
  34. package/dist/src/useService.d.ts.map +1 -1
  35. package/dist/src/utils.d.ts +1 -0
  36. package/dist/src/utils.d.ts.map +1 -1
  37. package/package.json +12 -12
  38. package/dist/src/createVuePlugin.d.ts +0 -4
  39. package/dist/src/createVuePlugin.d.ts.map +0 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,79 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
+
5
+ ### [1.1.1](https://github.com/kaokei/use-vue-service/compare/v1.1.0...v1.1.1) (2022-03-30)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **useservice:** 支持InjectionKey ([17313cd](https://github.com/kaokei/use-vue-service/commit/17313cd116176b8e4a45aaf05e4901514c3125b8))
11
+
12
+ ## [1.1.0](https://github.com/kaokei/use-vue-service/compare/v1.0.18...v1.1.0) (2022-02-16)
13
+
14
+
15
+ ### Features
16
+
17
+ * **bootstrap:** 删除bootstrap功能 ([de43690](https://github.com/kaokei/use-vue-service/commit/de43690c532209859b94f53652e248a455a56eb1))
18
+ * **di:** 基于新版di重新重构了一般,并完善了单元测试用例 ([845c8f9](https://github.com/kaokei/use-vue-service/commit/845c8f9e2df5de19f7cef2b7035770a8070870be))
19
+
20
+ ### [1.0.18](https://github.com/kaokei/use-vue-service/compare/v1.0.17...v1.0.18) (2021-11-24)
21
+
22
+
23
+ ### Features
24
+
25
+ * **bootstrap:** 增加bootstrap启动vue应用的入口 ([d7f1fca](https://github.com/kaokei/use-vue-service/commit/d7f1fca7711a7c22e599bdf68278cdc8a66fdad5))
26
+ * **bootstrap:** 重构了bootstrap逻辑 ([9cb1cae](https://github.com/kaokei/use-vue-service/commit/9cb1cae170352ddb26e2451e0b97a2a2015c1b4b))
27
+
28
+ ### [1.0.17](https://github.com/kaokei/use-vue-service/compare/v1.0.16...v1.0.17) (2021-10-12)
29
+
30
+
31
+ ### Features
32
+
33
+ * **useservice:** 直接获取根injector中的服务 ([92f1d0d](https://github.com/kaokei/use-vue-service/commit/92f1d0d77661c582ed89cecc55bede01252330d0))
34
+
35
+ ### [1.0.16](https://github.com/kaokei/use-vue-service/compare/v1.0.15...v1.0.16) (2021-10-07)
36
+
37
+ ### [1.0.15](https://github.com/kaokei/use-vue-service/compare/v1.0.14...v1.0.15) (2021-08-22)
38
+
39
+
40
+ ### Features
41
+
42
+ * **update:** 升级@kaokei/di ([6064c4e](https://github.com/kaokei/use-vue-service/commit/6064c4e1b7fcd102f287bea03a1984c1621d2884))
43
+
44
+ ### [1.0.14](https://github.com/kaokei/use-vue-service/compare/v1.0.13...v1.0.14) (2021-08-06)
45
+
46
+
47
+ ### Features
48
+
49
+ * **dispose:** 删除了vue-class-component,并支持了服务的dispose功能 ([cad0454](https://github.com/kaokei/use-vue-service/commit/cad045461b6fd617a85456cc98a45ecf42406341))
50
+ * **example:** 增加__DEV__ ([757b7ef](https://github.com/kaokei/use-vue-service/commit/757b7ef6866ad16d3a77b2d3ec4e0648bcba7369))
51
+ * **plugin:** 支持vue plugin ([a4cee12](https://github.com/kaokei/use-vue-service/commit/a4cee12f1607dbee81dae5f0cf55efdbcae29be1))
52
+
53
+ ### [1.0.13](https://github.com/kaokei/use-vue-service/compare/v1.0.12...v1.0.13) (2021-06-30)
54
+
55
+
56
+ ### Bug Fixes
57
+
58
+ * **ci:** add globals ([49b3d34](https://github.com/kaokei/use-vue-service/commit/49b3d3408d2caeaa767195551e7c152cd97cbff6))
59
+
60
+ ### [1.0.12](https://github.com/kaokei/use-vue-service/compare/v1.0.11...v1.0.12) (2021-06-30)
61
+
62
+
63
+ ### Bug Fixes
64
+
65
+ * **ci:** inline @kaokei/di ([7ced072](https://github.com/kaokei/use-vue-service/commit/7ced07291f45cd380f26da96a650a8581c9e6c8e))
66
+
67
+ ### 1.0.11 (2021-06-30)
68
+
69
+
70
+ ### Features
71
+
72
+ * **di:** use @kaokei/di to support di ([e937cba](https://github.com/kaokei/use-vue-service/commit/e937cba4379ec87a3b139a6132509b5216409c09))
73
+
74
+ ### 1.0.3 (2021-06-30)
75
+
76
+
77
+ ### Features
78
+
79
+ * **di:** use @kaokei/di to support di ([e937cba](https://github.com/kaokei/use-vue-service/commit/e937cba4379ec87a3b139a6132509b5216409c09))
package/README.md CHANGED
@@ -5,53 +5,13 @@
5
5
 
6
6
  </div>
7
7
 
8
- ## 待修改的 5 个名字
8
+ - [documentation](https://kaokei.com/project/use-vue-service/)
9
+ - [online playground](https://kaokei.com/project/use-vue-service/)
10
+ - [online demo](https://use-vue-service.vercel.app/)
9
11
 
10
- - 项目名,也就是项目文件夹的名称,这个在我们创建项目时就已经指定了。
11
- - package.json 中的 name,这个大多数时可能就是和项目名一致了,但是如果是带有 scope 的,或者驼峰的,都需要自己修改。
12
- - package.json 中的 browserVariableName,这个大多数情况下不关心也不会有问题,但是如果我们想要编译的代码想要在浏览器中直接使用,最好是指定一个全局变量。
13
- - package.json 中的 homepage,bugs-url,repository-url 这些外部链接。
14
- - README.md 中的 github 地址。
15
-
16
- ## github 地址
17
-
18
- - [github](https://github.com/kaokei/use-vue-service)
19
-
20
- ## 解决了什么问题?
21
-
22
- ## 整体方案以及使用方式
23
-
24
- ## 特性
25
-
26
- 使用 typescript,并且类型定义统一在 types 文件夹中,建议使用 module 来管理类型,而不是 script 来创建全局的类型。
27
- `tsconfig.json`作为编辑器的默认配置文件,方便编辑器识别。实际构建时使用`tsconfig.app.json`文件
28
-
29
- 使用 esm 模块化规范
30
-
31
- 使用 npm 作为包管理
32
-
33
- 使用 git 作为代码版本工具。
34
-
35
- 编码规范使用 eslint+prettier+editorconfig
36
-
37
- git commit message 采用 angular 规范,以及使用 commitlint 校验
38
-
39
- 使用 yorkie 自动化校验并格式化代码,自动化校验 commit message
40
-
41
- 使用 jest 作为单元测试,统一放在`tests`文件夹中。
42
-
43
- 可以在 playground 中进行代码实验,使用 vscode 配置.vscode/launch.json 可以调试 nodejs
44
-
45
- 使用 rollup 作为打包工具,同时打包出多个版本的 bundle。支持压缩/未压缩、使用 runtime/不使用 runtime、commonjs/esm、浏览器版本总共 10 个版本。
46
-
47
- npm run release:first 第一次发布,会自动创建 CHANGELOG.md 文件
48
- npm run release patch 发布新版本
49
-
50
- 使用 MIT 作为开源协议
51
-
52
- # 官网
53
-
54
- - [documentation](https://use-vue-service-demo.vercel.app/)
12
+ ```bash
13
+ npm install @kaokei/use-vue-service @kaokei/di reflect-metadata
14
+ ```
55
15
 
56
16
  ## 简介
57
17
 
@@ -79,22 +39,4 @@ npm run release patch 发布新版本
79
39
  - 使用 eslint 配合 husky 以及 lint-stage 自动格式化提交的代码,保证 git 仓库代码的规范性
80
40
  - 使用 rollup 打包源码
81
41
 
82
- ## bug 记录
83
-
84
- 1. 本来是想实现@Skip 可以指定跳过的次数,后来废弃了这个特性,只是实现了@Skip。
85
-
86
- 理由是不建议通过@Skip 来实现复杂命名空间的作用,我们可以利用 useClass 指向同一个 Service,但是提供不同的 provide 来实现多个服务。
87
-
88
- 2. 服务可能是有状态的
89
-
90
- 如果服务的状态可以直接设置初始值,那么是比较方便的。
91
-
92
- 如果服务的状态需要从服务器端获取,那么就会存在异步的问题,比如父子组件共享一个服务,在服务的状态还没有初始化完毕时,子组件就已经触发了某个动作去修改服务的状态,显然就会导致状态错乱。解决方案有两种。
93
- 第一种:使用 rxjs 的 observable 把状态变成流,不确定是否和 reactive 有冲突
94
- 第二种:就在在父组件中判断服务的状态是否已经 ready,如果 ready 了才显示子组件,否则展示 loading
95
-
96
- 3. injectFromSelf 实际上并不是和它的名字一样
97
-
98
- 因为 vue3 自带的 inject 依赖了原型链,并且子组件的 provides 属性默认就是父组件的 provides,从而导致虽然是从当前组件的 provides 开始寻找的服务。但是实际上这个服务有可能是从父组件的 Injector 中获取的。
99
-
100
- 关于这一点并不打算修复,主要是因为@Self 并不是特别常用的一个方法,如果我们使用@Self,那么我们应该自己明确调用了 declareProviders。另一个原因就是为了解决这个问题会引入不必要的复杂性。比如可以通过对比组件的 uid 和 Injector 的 uid 是否一致来解决问题。
42
+ ## MIT LICENSE