@zstackui/qiankun 2.6.3-beta-5
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/LICENSE +21 -0
- package/README.md +116 -0
- package/dist/index.umd.js +8681 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/index.umd.min.js +4 -0
- package/dist/index.umd.min.js.map +1 -0
- package/dist/src/__tests__/globalState.test.d.ts +5 -0
- package/dist/src/__tests__/utils.test.d.ts +1 -0
- package/dist/src/addons/engineFlag.d.ts +6 -0
- package/dist/src/addons/index.d.ts +6 -0
- package/dist/src/addons/runtimePublicPath.d.ts +6 -0
- package/dist/src/apis.d.ts +7 -0
- package/dist/src/effects.d.ts +3 -0
- package/dist/src/error.d.ts +3 -0
- package/dist/src/errorHandler.d.ts +7 -0
- package/dist/src/globalState.d.ts +7 -0
- package/dist/src/index.d.ts +11 -0
- package/dist/src/interfaces.d.ts +107 -0
- package/dist/src/loader.d.ts +8 -0
- package/dist/src/prefetch.d.ts +14 -0
- package/dist/src/sandbox/__tests__/common.test.d.ts +5 -0
- package/dist/src/sandbox/__tests__/proxySandbox.test.d.ts +10 -0
- package/dist/src/sandbox/common.d.ts +21 -0
- package/dist/src/sandbox/index.d.ts +40 -0
- package/dist/src/sandbox/legacy/__tests__/sandbox.test.d.ts +5 -0
- package/dist/src/sandbox/legacy/sandbox.d.ts +28 -0
- package/dist/src/sandbox/patchers/__tests__/css.test.d.ts +5 -0
- package/dist/src/sandbox/patchers/__tests__/interval.test.d.ts +5 -0
- package/dist/src/sandbox/patchers/css.d.ts +17 -0
- package/dist/src/sandbox/patchers/dynamicAppend/__tests__/common.test.d.ts +1 -0
- package/dist/src/sandbox/patchers/dynamicAppend/common.d.ts +22 -0
- package/dist/src/sandbox/patchers/dynamicAppend/forLooseSandbox.d.ts +17 -0
- package/dist/src/sandbox/patchers/dynamicAppend/forStrictSandbox.d.ts +12 -0
- package/dist/src/sandbox/patchers/dynamicAppend/index.d.ts +6 -0
- package/dist/src/sandbox/patchers/historyListener.d.ts +5 -0
- package/dist/src/sandbox/patchers/index.d.ts +9 -0
- package/dist/src/sandbox/patchers/interval.d.ts +5 -0
- package/dist/src/sandbox/patchers/windowListener.d.ts +5 -0
- package/dist/src/sandbox/proxySandbox.d.ts +23 -0
- package/dist/src/sandbox/snapshotSandbox.d.ts +20 -0
- package/dist/src/utils.d.ts +44 -0
- package/dist/src/version.d.ts +1 -0
- package/es/addons/engineFlag.d.ts +6 -0
- package/es/addons/engineFlag.js +50 -0
- package/es/addons/index.d.ts +6 -0
- package/es/addons/index.js +13 -0
- package/es/addons/runtimePublicPath.d.ts +6 -0
- package/es/addons/runtimePublicPath.js +57 -0
- package/es/apis.d.ts +7 -0
- package/es/apis.js +278 -0
- package/es/effects.d.ts +3 -0
- package/es/effects.js +33 -0
- package/es/error.d.ts +3 -0
- package/es/error.js +16 -0
- package/es/errorHandler.d.ts +7 -0
- package/es/errorHandler.js +13 -0
- package/es/globalState.d.ts +7 -0
- package/es/globalState.js +101 -0
- package/es/index.d.ts +11 -0
- package/es/index.js +11 -0
- package/es/interfaces.d.ts +107 -0
- package/es/interfaces.js +8 -0
- package/es/loader.d.ts +8 -0
- package/es/loader.js +600 -0
- package/es/prefetch.d.ts +14 -0
- package/es/prefetch.js +125 -0
- package/es/sandbox/common.d.ts +21 -0
- package/es/sandbox/common.js +157 -0
- package/es/sandbox/index.d.ts +40 -0
- package/es/sandbox/index.js +105 -0
- package/es/sandbox/legacy/sandbox.d.ts +28 -0
- package/es/sandbox/legacy/sandbox.js +142 -0
- package/es/sandbox/patchers/css.d.ts +17 -0
- package/es/sandbox/patchers/css.js +186 -0
- package/es/sandbox/patchers/dynamicAppend/common.d.ts +22 -0
- package/es/sandbox/patchers/dynamicAppend/common.js +306 -0
- package/es/sandbox/patchers/dynamicAppend/forLooseSandbox.d.ts +17 -0
- package/es/sandbox/patchers/dynamicAppend/forLooseSandbox.js +77 -0
- package/es/sandbox/patchers/dynamicAppend/forStrictSandbox.d.ts +12 -0
- package/es/sandbox/patchers/dynamicAppend/forStrictSandbox.js +103 -0
- package/es/sandbox/patchers/dynamicAppend/index.d.ts +6 -0
- package/es/sandbox/patchers/dynamicAppend/index.js +6 -0
- package/es/sandbox/patchers/historyListener.d.ts +5 -0
- package/es/sandbox/patchers/historyListener.js +54 -0
- package/es/sandbox/patchers/index.d.ts +9 -0
- package/es/sandbox/patchers/index.js +45 -0
- package/es/sandbox/patchers/interval.d.ts +5 -0
- package/es/sandbox/patchers/interval.js +34 -0
- package/es/sandbox/patchers/windowListener.d.ts +5 -0
- package/es/sandbox/patchers/windowListener.js +34 -0
- package/es/sandbox/proxySandbox.d.ts +23 -0
- package/es/sandbox/proxySandbox.js +315 -0
- package/es/sandbox/snapshotSandbox.d.ts +20 -0
- package/es/sandbox/snapshotSandbox.js +59 -0
- package/es/utils.d.ts +44 -0
- package/es/utils.js +215 -0
- package/es/version.d.ts +1 -0
- package/es/version.js +1 -0
- package/lib/addons/engineFlag.d.ts +6 -0
- package/lib/addons/engineFlag.js +55 -0
- package/lib/addons/index.d.ts +6 -0
- package/lib/addons/index.js +21 -0
- package/lib/addons/runtimePublicPath.d.ts +6 -0
- package/lib/addons/runtimePublicPath.js +63 -0
- package/lib/apis.d.ts +7 -0
- package/lib/apis.js +288 -0
- package/lib/effects.d.ts +3 -0
- package/lib/effects.js +42 -0
- package/lib/error.d.ts +3 -0
- package/lib/error.js +23 -0
- package/lib/errorHandler.d.ts +7 -0
- package/lib/errorHandler.js +33 -0
- package/lib/globalState.d.ts +7 -0
- package/lib/globalState.js +110 -0
- package/lib/index.d.ts +11 -0
- package/lib/index.js +89 -0
- package/lib/interfaces.d.ts +107 -0
- package/lib/interfaces.js +14 -0
- package/lib/loader.d.ts +8 -0
- package/lib/loader.js +606 -0
- package/lib/prefetch.d.ts +14 -0
- package/lib/prefetch.js +132 -0
- package/lib/sandbox/common.d.ts +21 -0
- package/lib/sandbox/common.js +169 -0
- package/lib/sandbox/index.d.ts +40 -0
- package/lib/sandbox/index.js +123 -0
- package/lib/sandbox/legacy/sandbox.d.ts +28 -0
- package/lib/sandbox/legacy/sandbox.js +148 -0
- package/lib/sandbox/patchers/css.d.ts +17 -0
- package/lib/sandbox/patchers/css.js +193 -0
- package/lib/sandbox/patchers/dynamicAppend/common.d.ts +22 -0
- package/lib/sandbox/patchers/dynamicAppend/common.js +322 -0
- package/lib/sandbox/patchers/dynamicAppend/forLooseSandbox.d.ts +17 -0
- package/lib/sandbox/patchers/dynamicAppend/forLooseSandbox.js +84 -0
- package/lib/sandbox/patchers/dynamicAppend/forStrictSandbox.d.ts +12 -0
- package/lib/sandbox/patchers/dynamicAppend/forStrictSandbox.js +110 -0
- package/lib/sandbox/patchers/dynamicAppend/index.d.ts +6 -0
- package/lib/sandbox/patchers/dynamicAppend/index.js +19 -0
- package/lib/sandbox/patchers/historyListener.d.ts +5 -0
- package/lib/sandbox/patchers/historyListener.js +62 -0
- package/lib/sandbox/patchers/index.d.ts +9 -0
- package/lib/sandbox/patchers/index.js +57 -0
- package/lib/sandbox/patchers/interval.d.ts +5 -0
- package/lib/sandbox/patchers/interval.js +42 -0
- package/lib/sandbox/patchers/windowListener.d.ts +5 -0
- package/lib/sandbox/patchers/windowListener.js +42 -0
- package/lib/sandbox/proxySandbox.d.ts +23 -0
- package/lib/sandbox/proxySandbox.js +321 -0
- package/lib/sandbox/snapshotSandbox.d.ts +20 -0
- package/lib/sandbox/snapshotSandbox.js +65 -0
- package/lib/utils.d.ts +44 -0
- package/lib/utils.js +240 -0
- package/lib/version.d.ts +1 -0
- package/lib/version.js +7 -0
- package/package.json +137 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 Kuitos
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://qiankun.umijs.org">
|
|
3
|
+
<img src="https://gw.alipayobjects.com/zos/bmw-prod/8a74c1d3-16f3-4719-be63-15e467a68a24/km0cv8vn_w500_h500.png" alt="qiankun" width="180" />
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://www.npmjs.com/package/qiankun"><img src="https://img.shields.io/npm/v/qiankun.svg?style=flat-square" alt="npm version" /></a>
|
|
9
|
+
<a href="https://codecov.io/gh/umijs/qiankun"><img src="https://img.shields.io/codecov/c/github/umijs/qiankun.svg?style=flat-square" alt="coverage" /></a>
|
|
10
|
+
<a href="https://www.npmjs.com/package/qiankun"><img src="https://img.shields.io/npm/dt/qiankun.svg?style=flat-square" alt="npm downloads" /></a>
|
|
11
|
+
<a href="https://travis-ci.com/umijs/qiankun"><img src="https://img.shields.io/github/workflow/status/umijs/qiankun/CI.svg?style=flat-square" alt="build status" /></a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
# qiankun(乾坤)
|
|
15
|
+
|
|
16
|
+
> In Chinese, `qian(乾)` means heaven and `kun(坤)` earth. `qiankun` is the universe.
|
|
17
|
+
|
|
18
|
+
Qiankun enables you and your teams to build next-generation and enterprise-ready web applications leveraging [Micro Frontends](https://micro-frontends.org/). It is inspired by and based on [single-spa](https://github.com/CanopyTax/single-spa).
|
|
19
|
+
|
|
20
|
+
## 🤔 Motivation
|
|
21
|
+
|
|
22
|
+
A quick recap about the concept of `Micro Frontends`:
|
|
23
|
+
|
|
24
|
+
> Techniques, strategies and recipes for building a **modern web app** with **multiple teams** using **different JavaScript frameworks**. — [Micro Frontends](https://micro-frontends.org/)
|
|
25
|
+
|
|
26
|
+
Qiankun was birthed internally in our group during the time web app development by distributed teams had turned to complete chaos. We faced every problem micro frontend was conceived to solve, so naturally, it became part of our solution.
|
|
27
|
+
|
|
28
|
+
The path was never easy, we stepped on every challenge there could possibly be. Just to name a few:
|
|
29
|
+
|
|
30
|
+
- In what form do micro-apps publish static resources?
|
|
31
|
+
- How does the framework integrate individual micro-apps?
|
|
32
|
+
- How to ensure that sub-applications are isolated from one another (development independence and deployment independence) and runtime sandboxed?
|
|
33
|
+
- Performance issues? What about public dependencies?
|
|
34
|
+
- The list goes on long ...
|
|
35
|
+
|
|
36
|
+
After solving these common problems of micro frontends and lots of polishing and testing, we extracted the minimal viable framework of our solution, and named it `qiankun`, as it can contain and serve anything. Not long after, it became the cornerstone of hundreds of our web applications in production, and we decided to open-source it to save you the suffering.
|
|
37
|
+
|
|
38
|
+
**TLDR: Qiankun is probably the most complete micro-frontend solution you ever met🧐.**
|
|
39
|
+
|
|
40
|
+
## :sparkles: Features
|
|
41
|
+
|
|
42
|
+
Qiankun inherits many benefits from [single-spa](https://github.com/CanopyTax/single-spa):
|
|
43
|
+
|
|
44
|
+
- 📦 **Micro-apps Independent Deployment**
|
|
45
|
+
- 🛴 **Lazy Load**
|
|
46
|
+
- 📱 **Technology Agnostic**
|
|
47
|
+
|
|
48
|
+
And on top of these, it offers:
|
|
49
|
+
|
|
50
|
+
- 💃 **Elegant API**
|
|
51
|
+
- 💪 **HTML Entry Access Mode**
|
|
52
|
+
- 🛡 **Style Isolation**
|
|
53
|
+
- 🧳 **JS Sandbox**
|
|
54
|
+
- ⚡ **Prefetch Assets**
|
|
55
|
+
- 🔌 **[Umi Plugin](https://github.com/umijs/plugins/tree/master/packages/plugin-qiankun) Integration**
|
|
56
|
+
|
|
57
|
+
## 📦 Installation
|
|
58
|
+
|
|
59
|
+
```shell
|
|
60
|
+
$ yarn add qiankun # or npm i qiankun -S
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## 📖 Documentation
|
|
64
|
+
|
|
65
|
+
You can find the Qiankun documentation [on the website](https://qiankun.umijs.org/)
|
|
66
|
+
|
|
67
|
+
Check out the [Getting Started](https://qiankun.umijs.org/guide/getting-started) page for a quick overview.
|
|
68
|
+
|
|
69
|
+
The documentation is divided into several sections:
|
|
70
|
+
|
|
71
|
+
- [Tutorial](https://qiankun.umijs.org/cookbook)
|
|
72
|
+
- [API Reference](https://qiankun.umijs.org/api)
|
|
73
|
+
- [FAQ](https://qiankun.umijs.org/faq)
|
|
74
|
+
- [Community](https://qiankun.umijs.org/#-community)
|
|
75
|
+
|
|
76
|
+
## 💿 Examples
|
|
77
|
+
|
|
78
|
+
Inside the `examples` folder, there is a sample Shell app and multiple mounted Micro FE apps. To get it running, first clone `qiankun`:
|
|
79
|
+
|
|
80
|
+
```shell
|
|
81
|
+
$ git clone https://github.com/umijs/qiankun.git
|
|
82
|
+
$ cd qiankun
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Now install and run the example:
|
|
86
|
+
|
|
87
|
+
```shell
|
|
88
|
+
$ yarn install
|
|
89
|
+
$ yarn examples:install
|
|
90
|
+
$ yarn examples:start
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Visit `http://localhost:7099`.
|
|
94
|
+
|
|
95
|
+

|
|
96
|
+
|
|
97
|
+
## 🎯 Roadmap
|
|
98
|
+
|
|
99
|
+
See [Qiankun 3.0 Roadmap](https://github.com/umijs/qiankun/discussions/1378)
|
|
100
|
+
|
|
101
|
+
## 👥 Contributors
|
|
102
|
+
|
|
103
|
+
Thanks to all the contributors!
|
|
104
|
+
|
|
105
|
+
<a href="https://github.com/umijs/qiankun/graphs/contributors">
|
|
106
|
+
<img src="https://opencollective.com/qiankun/contributors.svg?width=960&button=false" alt="contributors" />
|
|
107
|
+
</a>
|
|
108
|
+
|
|
109
|
+
## 🎁 Acknowledgements
|
|
110
|
+
|
|
111
|
+
- [single-spa](https://github.com/CanopyTax/single-spa) What an awesome meta-framework for micro-frontends!
|
|
112
|
+
- [import-html-entry](https://github.com/kuitos/import-html-entry/) An assets loader that supports html entry.
|
|
113
|
+
|
|
114
|
+
## 📄 License
|
|
115
|
+
|
|
116
|
+
Qiankun is [MIT licensed](./LICENSE).
|