ssr-plugin-react 7.0.5 → 7.0.7
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 +317 -432
- package/README.md +105 -105
- package/cjs/entry/context.d.ts +1 -1
- package/cjs/entry/context.d.ts.map +1 -1
- package/cjs/entry/context.js +5 -5
- package/cjs/entry/context.js.map +1 -1
- package/cjs/entry/create.d.ts +2 -3
- package/cjs/entry/create.d.ts.map +1 -1
- package/cjs/entry/create.js +10 -5
- package/cjs/entry/create.js.map +1 -1
- package/cjs/entry/react17-client-entry.d.ts.map +1 -1
- package/cjs/entry/react17-client-entry.js +7 -8
- package/cjs/entry/react17-client-entry.js.map +1 -1
- package/cjs/entry/react18-client-entry.d.ts.map +1 -1
- package/cjs/entry/react18-client-entry.js +6 -8
- package/cjs/entry/react18-client-entry.js.map +1 -1
- package/cjs/entry/server-entry.d.ts +2 -2
- package/cjs/entry/server-entry.d.ts.map +1 -1
- package/cjs/entry/server-entry.js +42 -28
- package/cjs/entry/server-entry.js.map +1 -1
- package/cjs/index.js +9 -9
- package/cjs/index.js.map +1 -1
- package/esm/entry/context.d.ts +1 -1
- package/esm/entry/context.d.ts.map +1 -1
- package/esm/entry/context.js +7 -7
- package/esm/entry/context.js.map +1 -1
- package/esm/entry/create.d.ts +2 -3
- package/esm/entry/create.d.ts.map +1 -1
- package/esm/entry/create.js +16 -11
- package/esm/entry/create.js.map +1 -1
- package/esm/entry/react17-client-entry.d.ts.map +1 -1
- package/esm/entry/react17-client-entry.js +14 -15
- package/esm/entry/react17-client-entry.js.map +1 -1
- package/esm/entry/react18-client-entry.d.ts.map +1 -1
- package/esm/entry/react18-client-entry.js +13 -15
- package/esm/entry/react18-client-entry.js.map +1 -1
- package/esm/entry/server-entry.d.ts +2 -2
- package/esm/entry/server-entry.d.ts.map +1 -1
- package/esm/entry/server-entry.js +51 -37
- package/esm/entry/server-entry.js.map +1 -1
- package/esm/index.js +11 -11
- package/esm/index.js.map +1 -1
- package/package.json +31 -32
- package/src/entry/context.tsx +33 -29
- package/src/entry/create.ts +27 -24
- package/src/entry/react17-client-entry.tsx +66 -66
- package/src/entry/react18-client-entry.tsx +72 -72
- package/src/entry/server-entry.tsx +192 -141
- package/src/index.ts +38 -38
- package/tsconfig.cjs.json +2 -4
- package/tsconfig.esm.json +2 -4
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div>
|
|
2
|
-
|
|
2
|
+
<a href="./README_Zh.md">简体中文</a> | English
|
|
3
3
|
</div>
|
|
4
4
|
|
|
5
5
|
<h1 align="center"> SSR </h1>
|
|
@@ -20,55 +20,55 @@
|
|
|
20
20
|
</div>
|
|
21
21
|
<br />
|
|
22
22
|
|
|
23
|
+
|
|
24
|
+
## Version 7.x
|
|
23
25
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
`ssr` 框架 `7.x` 版本已发布,阅读[文档](http://doc.ssr-fc.com/docs/features$v7)获取更详细的介绍和升级指南。v7版本带来以下新的features
|
|
26
|
+
The `ssr` framework version `7.x` has been released. Read the [documentation](http://doc.ssr-fc.com/docs/features$v7) for more detailed introduction and upgrade guide. Version 7 brings the following new features:
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
- Supports [Rspack](https://rspack.rs), [Rolldown-Vite](https://vite.dev/guide/rolldown), and `Webpack` build tools to greatly improve build performance.
|
|
29
|
+
- Supports any frontend framework combined with any build tool
|
|
30
|
+
- Brand new dependency design, streamlined dependencies required for initialization
|
|
31
|
+
- Progressive upgrade with almost no breaking changes, v6 projects can smoothly transition to v7
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
Version 7 has been tested to improve build speed by 5-10 times. Dependency size reduced by 2/3 (when using Rspack|Rolldown-Vite scenarios).
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
Use the latest `create-ssr-app` to initialize v7 (recommended) or v6 project templates according to prompts.
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
38
|
$ npm init ssr-app@latest my-ssr-project
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
##
|
|
41
|
+
## Introduction
|
|
42
42
|
|
|
43
|
-
`ssr`
|
|
43
|
+
The `ssr` framework is an out-of-the-box server-side rendering framework built for frontend frameworks in server-side rendering scenarios. To understand what server-side rendering is, please check the [documentation](http://doc.ssr-fc.com/docs/features$ssr).
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
This framework evolved from the [egg-react-ssr](https://github.com/zhangyuang/egg-react-ssr) project and `ssr` v4 version `(midway-faas + react ssr)`. Based on previous foundations, it has made many improvements through plugin-based code organization, supporting the combination of any server-side framework with any frontend framework. Developers can choose to deploy via `Serverless` or deploy as traditional `Node.js` applications. We focus on improving the development experience of server-side rendering applications in `Serverless` scenarios, creating one-stop development and application deployment services. This maximizes developer experience while minimizing application development and deployment costs.
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
In the latest version, it supports `React17/18/19` and `Vue2/Vue3` as frontend frameworks for server-side rendering. For development tools, we support both `Vite|Webpack|Rspack` to improve application startup speed, build speed, and HMR speed.
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
In the `Node.js` framework, the official default `example` provides integration examples based on `Nest.js` and `Midway.js`, two popular `Node.js` frameworks with the `ssr` framework. Of course, the `ssr` framework is designed not to be coupled with any `Node.js` framework, and developers can freely choose to use any `Node.js` framework.
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
If you choose `Midway.js` as your `Node.js` framework, you can directly use the built-in `ssr deploy` command to deploy applications to `Alibaba Cloud` or `Tencent Cloud` platforms with one click.
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
Read our [official documentation](http://doc.ssr-fc.com/) for more detailed understanding. In fact, the documentation itself is developed using the `ssr` framework and deployed to Alibaba Cloud `Serverless` service.
|
|
54
54
|
|
|
55
55
|

|
|
56
56
|
|
|
57
|
-
##
|
|
57
|
+
## When Should You Choose the SSR Framework
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
59
|
+
- Need to use in scenarios combining `Node.js` with frontend frameworks. Unlike other pure frontend frameworks, the `ssr` framework is specifically built for server-side rendering scenarios or scenarios combining `Node.js` with frontend.
|
|
60
|
+
- Need an out-of-the-box server-side rendering capability without manually combining different frontend frameworks with server-side frameworks.
|
|
61
|
+
- Need framework-level rendering degradation capability that automatically degrades to client-side rendering when server-side rendering fails.
|
|
62
|
+
- Need a framework with simple configuration and clear logic. The `ssr` framework has the clearest rendering logic and application build logic among similar frameworks.
|
|
63
|
+
- May change technology stacks, such as upgrading from `Vue2` to `Vue3`, downgrading from `Vue3` to `Vue2`, or switching between `React/Vue`.
|
|
64
|
+
- Need out-of-the-box support for popular UI libraries like `antd` and `vant` in server-side rendering scenarios.
|
|
65
|
+
- Need to support both `Webpack` and `Vite` development tools to get fast startup speed, HMR speed, and stable production code.
|
|
66
|
+
- Need to use [pinia](https://pinia.vuejs.org/) as data management solution in `Vue3 SSR`.
|
|
67
|
+
- Simply need a faster and better `cra` or `vue-cli`. The `ssr` framework also provides excellent support in pure `csr` scenarios.
|
|
68
68
|
|
|
69
|
-
##
|
|
69
|
+
## Who's Using
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
Companies (applications) currently using this project. If you are using it but not listed, please raise an [issue](https://github.com/zhangyuang/ssr/issues). We welcome promotion and sharing, and will provide technical support at any time.
|
|
72
72
|
|
|
73
73
|
<table>
|
|
74
74
|
<tr>
|
|
@@ -167,101 +167,101 @@ $ npm init ssr-app@latest my-ssr-project
|
|
|
167
167
|
|
|
168
168
|
## Features
|
|
169
169
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
170
|
+
- 🌱 Extremely customizable: Frontend supports modern Web frameworks like React17/React18/Vue2/Vue3;
|
|
171
|
+
- 🚀 Ready to use: Built-in 10+ scaffold extensions like [Pinia](https://pinia.vuejs.org/introduction.html#basic-example), [antd](https://ant.design/components/overview-cn/), [vant](https://github.com/youzan/vant), TypeScript, Hooks, etc.;
|
|
172
|
+
- 🧲 Plugin-driven: Based on plugin architecture, users focus more on business logic;
|
|
173
|
+
- 💯 Serverless-first: One-click deployment to various Serverless platforms, also supports traditional Web Servers like Egg, Midway, Nest, etc.
|
|
174
|
+
- 🛡 High availability scenarios, seamless degradation from SSR to CSR, best disaster recovery solution.
|
|
175
|
+
- 😄 Feature-rich, build tools support both Webpack/Vite, supports four rendering modes `SSR|CSR|SSG|Html`
|
|
176
|
+
- ✨ Supports [bun](https://bun.sh/) as js runtime
|
|
177
177
|
|
|
178
|
-
##
|
|
178
|
+
## Implemented Features
|
|
179
179
|
|
|
180
|
-
🚀
|
|
180
|
+
🚀 indicates implemented features
|
|
181
181
|
|
|
182
|
-
|
|
|
183
|
-
|
|
|
184
|
-
|
|
|
185
|
-
|
|
|
186
|
-
|
|
|
187
|
-
|
|
|
188
|
-
|
|
|
189
|
-
|
|
|
190
|
-
|
|
|
191
|
-
|
|
|
192
|
-
|
|
|
193
|
-
|
|
|
194
|
-
|
|
|
195
|
-
|
|
|
196
|
-
|
|
|
197
|
-
|
|
|
198
|
-
| Vue3
|
|
199
|
-
|
|
|
200
|
-
| ssr deploy
|
|
201
|
-
| ssr deploy --tencent
|
|
182
|
+
| Milestone | Status |
|
|
183
|
+
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ |
|
|
184
|
+
| Support combination of any server-side framework with any frontend framework. (Serverless/Midway/NestJS) + (React17/React18/Vue2/Vue3) | 🚀 |
|
|
185
|
+
| Smoothest [vite](https://vite-design.surge.sh/) [support](http://doc.ssr-fc.com/docs/features$vite) | 🚀 |
|
|
186
|
+
| Minimal and elegant server-side rendering implementation | 🚀 |
|
|
187
|
+
| Support [pre-rendering](http://doc.ssr-fc.com/docs/features$ssg) capability | 🚀 |
|
|
188
|
+
| Optimized production code bundle size for Serverless scenarios with strict code package size limitations | 🚀 |
|
|
189
|
+
| Support both conventional frontend routing and declarative frontend routing | 🚀 |
|
|
190
|
+
| Abandon traditional template engines, all page elements unified using frontend components as DSL | 🚀 |
|
|
191
|
+
| Support four rendering modes simultaneously, providing one-click degradation from server-side rendering to client-side rendering | 🚀 |
|
|
192
|
+
| Unify data fetching methods for different frameworks on server and client sides, achieving high reusability | 🚀 |
|
|
193
|
+
| Type-friendly, fully embrace TypeScript | 🚀 |
|
|
194
|
+
| Support seamless integration with [antd](https://github.com/ant-design/ant-design) [vant](https://vant-contrib.gitee.io/vant/#/) without modifying any configuration | 🚀 |
|
|
195
|
+
| Support using less as CSS preprocessor | 🚀 |
|
|
196
|
+
| Seamless [usage](http://doc.ssr-fc.com/docs/features$faq#%E4%B8%8E%20micro-app%20%E7%BB%93%E5%90%88%E4%BD%BF%E7%94%A8) in micro-frontend scenarios | 🚀 |
|
|
197
|
+
| Support using context or [valtio](https://github.com/pmndrs/valtio) for minimalist [data management](http://doc.ssr-fc.com/docs/features$communication#React%20%E5%9C%BA%E6%99%AF) solutions, abandoning traditional redux/dva data management solutions | 🚀 |
|
|
198
|
+
| Vue3 scenarios provide [Pinia](https://pinia.vuejs.org/introduction.html#basic-example) and [Provide/Inject](http://doc.ssr-fc.com/docs/features$communication#Vue%20%E5%9C%BA%E6%99%AF%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88) to replace `Vuex` for cross-component communication | 🚀 |
|
|
199
|
+
| Support creation and usage on Alibaba Cloud [platform](https://zhuanlan.zhihu.com/p/139210473) | 🚀 |
|
|
200
|
+
| ssr deploy one-click deployment to [Alibaba Cloud](https://www.aliyun.com/) platform | 🚀 |
|
|
201
|
+
| ssr deploy --tencent one-click deployment to [Tencent Cloud](https://cloud.tencent.com/) platform without modifying any configuration | 🚀 |
|
|
202
202
|
|
|
203
|
-
##
|
|
203
|
+
## Solution Comparison
|
|
204
204
|
|
|
205
|
-
|
|
205
|
+
Why choose the `ssr` framework and comparison with similar frameworks, please check the [documentation](http://doc.ssr-fc.com/docs/why)
|
|
206
206
|
|
|
207
|
-
##
|
|
207
|
+
## Quick Start
|
|
208
208
|
|
|
209
|
-
|
|
209
|
+
We provide the [create-ssr-app](https://github.com/zhangyuang/create-ssr-app) scaffold to let users quickly create different types of applications.
|
|
210
210
|
|
|
211
|
-
|
|
211
|
+
Currently, the official provides the following types of templates for developers to use directly. Users can choose different templates for development based on their actual technology stack.
|
|
212
212
|
|
|
213
|
-
|
|
213
|
+
Although the technology stacks are different, the development philosophy is consistent. In any technology stack combination, our development commands, build commands, and rendering principles are completely consistent.
|
|
214
214
|
|
|
215
|
-
|
|
215
|
+
Note: In `Midway.js` and `Nest.js` scenarios, we have implemented one-click deployment to `Serverless` platforms. However, the underlying implementations differ slightly. For more detailed introduction, please read the [Serverless](http://doc.ssr-fc.com/docs/features$serverless) chapter. If you need to extensively use capabilities provided by `Serverless` platforms, we recommend creating `Midway.js` type applications. We strongly recommend reading our [official documentation](http://doc.ssr-fc.com/) for more detailed understanding.
|
|
216
216
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
217
|
+
- [nestjs-react-ssr](https://github.com/zhangyuang/ssr/tree/dev/example/nestjs-react-ssr)
|
|
218
|
+
- [nestjs-react18-ssr](https://github.com/zhangyuang/ssr/tree/dev/example/nestjs-react18-ssr)
|
|
219
|
+
- [nestjs-vue-ssr](https://github.com/zhangyuang/ssr/tree/dev/example/nestjs-vue-ssr)
|
|
220
|
+
- [nestjs-vue3-ssr](https://github.com/zhangyuang/ssr/tree/dev/example/nestjs-vue3-ssr)
|
|
221
|
+
- [nestjs-vue3-ssr-pinia](https://github.com/zhangyuang/nestjs-vue3-ssr-pinia)
|
|
222
|
+
- [midway-react-ssr](https://github.com/zhangyuang/ssr/tree/dev/example/midway-react-ssr)
|
|
223
|
+
- [midway-react18-ssr](https://github.com/zhangyuang/ssr/tree/dev/example/midway-react18-ssr)
|
|
224
|
+
- [midway-vue-ssr](https://github.com/zhangyuang/ssr/tree/dev/example/midway-vue-ssr)
|
|
225
|
+
- [midway-vue3-ssr](https://github.com/zhangyuang/ssr/tree/dev/example/midway-vue3-ssr)
|
|
226
226
|
|
|
227
|
-
|
|
227
|
+
Developers can create different types of applications according to their actual technology stack needs to get started quickly.
|
|
228
228
|
|
|
229
|
-
###
|
|
229
|
+
### Create Project
|
|
230
230
|
|
|
231
|
-
|
|
231
|
+
Through the `npm init` command, we can create any of the above templates:
|
|
232
232
|
|
|
233
233
|
```bash
|
|
234
234
|
$ npm init ssr-app my-ssr-project
|
|
235
235
|
$ cd my-ssr-project
|
|
236
|
-
$ yarn #
|
|
236
|
+
$ yarn # recommend using yarn, can also use npm install
|
|
237
237
|
$ yarn start
|
|
238
|
-
$ open http://localhost:3000 #
|
|
239
|
-
$ yarn build #
|
|
240
|
-
$ yarn start:vite #
|
|
238
|
+
$ open http://localhost:3000 # access the application
|
|
239
|
+
$ yarn build # resource build, equivalent to npx ssr build
|
|
240
|
+
$ yarn start:vite # start in vite mode, equivalent to npx ssr start --tools vite
|
|
241
241
|
```
|
|
242
242
|
|
|
243
243
|

|
|
244
244
|
|
|
245
|
-
##
|
|
245
|
+
## Live Examples
|
|
246
246
|
|
|
247
|
-
|
|
248
|
-
|
|
247
|
+
Preview application details deployed to Alibaba Cloud/Tencent Cloud services through Serverless one-click deployment by visiting the following links.
|
|
248
|
+
Use queryParams `csr=true` to degrade SSR server-side rendering mode to CSR client-side rendering mode with one click, or configure through `config.js`.
|
|
249
249
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
250
|
+
- http://ssr-fc.com/ React SSR application deployed to Alibaba Cloud
|
|
251
|
+
- http://ssr-fc.com?csr=true React SSR application deployed to Alibaba Cloud, accessed in CSR mode
|
|
252
|
+
- http://tx.ssr-fc.com React SSR application deployed to Tencent Cloud
|
|
253
|
+
- http://tx.ssr-fc.com?csr=true React SSR application deployed to Tencent Cloud, accessed in CSR mode
|
|
254
|
+
- http://vue.ssr-fc.com Vue SSR application deployed to Alibaba Cloud
|
|
255
|
+
- http://vue3.ssr-fc.com Vue3 SSR application deployed to Alibaba Cloud
|
|
256
|
+
- http://vue.ssr-fc.com?csr=true Vue SSR application deployed to Alibaba Cloud, accessed in CSR mode
|
|
257
|
+
- http://vue3.ssr-fc.com?csr=true Vue3 SSR application deployed to Alibaba Cloud, accessed in CSR mode
|
|
258
258
|
|
|
259
|
-
##
|
|
259
|
+
## Ecosystem
|
|
260
260
|
|
|
261
261
|
| Project | Status | Description |
|
|
262
262
|
| ------------------- | ------------------------------------------------ | ----------------------------------------------------------------------- |
|
|
263
263
|
| [ssr] | [![ssr-status]][ssr] | cli for ssr framework |
|
|
264
|
-
| [ssr-core]
|
|
264
|
+
| [ssr-core] | [![ssr-core-status]][ssr-core] | core render for all framwork |
|
|
265
265
|
| [ssr-plugin-midway] | [![ssr-plugin-midway-status]][ssr-plugin-midway] | provide start and build fetature by [midway@2.0](https://midwayjs.org/) |
|
|
266
266
|
| [ssr-plugin-nestjs] | [![ssr-plugin-nestjs-status]][ssr-plugin-nestjs] | provide start and build feature by [NestJS](https://docs.nestjs.com/) |
|
|
267
267
|
| [ssr-plugin-react] | [![ssr-plugin-react-status]][ssr-plugin-react] | develop react application only be used in development |
|
|
@@ -285,7 +285,6 @@ $ yarn start:vite # 以 vite 模式启动,等价于 npx ssr start --tools vite
|
|
|
285
285
|
[ssr-plugin-vue3-status]: https://img.shields.io/npm/v/ssr-plugin-vue3.svg
|
|
286
286
|
[ssr-webpack-status]: https://img.shields.io/npm/v/ssr-webpack.svg
|
|
287
287
|
[ssr-types-status]: https://img.shields.io/npm/v/ssr-types.svg
|
|
288
|
-
|
|
289
288
|
[ssr]: https://github.com/zhangyuang/ssr/tree/dev/packages/cli
|
|
290
289
|
[ssr-core]: https://github.com/zhangyuang/ssr/tree/dev/packages/core
|
|
291
290
|
[ssr-hoc-react]: https://github.com/zhangyuang/ssr/tree/dev/packages/hoc-react
|
|
@@ -301,32 +300,33 @@ $ yarn start:vite # 以 vite 模式启动,等价于 npx ssr start --tools vite
|
|
|
301
300
|
|
|
302
301
|
## CONTRIBUTING
|
|
303
302
|
|
|
304
|
-
|
|
303
|
+
If you want to contribute code to this application, please read the [contributing documentation](./CONTRIBUTING.md). We have prepared rich scripts for bootstrapping.
|
|
305
304
|
|
|
306
305
|
## License
|
|
307
306
|
|
|
308
307
|
[MIT](LICENSE)
|
|
309
308
|
|
|
310
|
-
##
|
|
309
|
+
## Q&A Group
|
|
311
310
|
|
|
312
|
-
|
|
311
|
+
Although we have tried our best to check the application, there may still be omissions. If you find any problems or suggestions during use, welcome to raise [issues](https://github.com/zhangyuang/ssr/issues) or [PRs](https://github.com/zhangyuang/ssr/pulls).
|
|
313
312
|
|
|
314
|
-
|
|
313
|
+
`Note: Due to WeChat group size limitations, to join the group please add the personal QR code and note "join ssr communication group". Since it's a personal WeChat, friends will be deleted after being added to the group, please understand. We encourage communication through issues and discussions more.`
|
|
315
314
|
|
|
316
315
|
<div style="display:flex">
|
|
317
316
|
<!-- <img src="https://res.wx.qq.com/op_res/7F1t4Z8yCHWilehbcFGjAj0yVn0URMiWBGVJa-TVu_eqw5IwUXA2kPYBnfX6YRHy0FVBB-yC6l0IEL02QTJkLg" width="300"> -->
|
|
318
317
|
<img src="https://res.wx.qq.com/op_res/Nv12X2und927FEOvJ5iflzX-WBW07GSC22kumTCiShZnudKpG0jMuRs70ecHQb3Hy1QjjaASNzyOuMgHr43Wpw" width="300">
|
|
319
318
|
</div>
|
|
320
319
|
|
|
321
|
-
##
|
|
320
|
+
## Project Donation
|
|
321
|
+
|
|
322
|
+
If this project can help you, we hope to receive your donation ☕️ to contribute to the open source community.
|
|
322
323
|
|
|
323
|
-
如果本项目能够对你有所帮助,希望得到来自于你的捐赠 ☕️ 为开源社区做一份贡献
|
|
324
324
|
<div style="display:flex">
|
|
325
325
|
<img src="https://doc.ssr-fc.com/images/wepay.jpg" width="150">
|
|
326
326
|
<img src="https://doc.ssr-fc.com/images/alipay.jpg" width="150">
|
|
327
327
|
</div>
|
|
328
328
|
|
|
329
|
-
##
|
|
329
|
+
## Lines of Code
|
|
330
330
|
|
|
331
331
|
```bash
|
|
332
332
|
$ cloc packages --include-ext=ts
|
|
@@ -344,10 +344,10 @@ SUM: 164 471 195 4927
|
|
|
344
344
|
-------------------------------------------------------------------------------
|
|
345
345
|
```
|
|
346
346
|
|
|
347
|
-
##
|
|
347
|
+
## Frontend Development Manual
|
|
348
348
|
|
|
349
|
-
[
|
|
349
|
+
[How to Build a Comfortable and Efficient Frontend Development Environment](http://fe.ssr-fc.com/)
|
|
350
350
|
|
|
351
|
-
##
|
|
351
|
+
## Project Star Growth Trend
|
|
352
352
|
|
|
353
353
|
[](https://starchart.cc/zhangyuang/ssr)
|
package/cjs/entry/context.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IProps } from
|
|
1
|
+
import { IProps } from "ssr-types";
|
|
2
2
|
export declare function AppContext(props: IProps): import("react").FunctionComponentElement<import("react").ProviderProps<import("ssr-types").IContext<any>>>;
|
|
3
3
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/entry/context.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAoC,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/entry/context.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAoC,MAAM,WAAW,CAAC;AA2BrE,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,8GAiBvC"}
|
package/cjs/entry/context.js
CHANGED
|
@@ -6,12 +6,12 @@ const create_1 = require("./create");
|
|
|
6
6
|
const { reducer, state } = create_1.Routes;
|
|
7
7
|
const userState = state !== null && state !== void 0 ? state : {};
|
|
8
8
|
const userReducer = reducer !== null && reducer !== void 0 ? reducer : function () { };
|
|
9
|
-
const isDev = process.env.NODE_ENV !==
|
|
9
|
+
const isDev = process.env.NODE_ENV !== "production";
|
|
10
10
|
function defaultReducer(state, action) {
|
|
11
11
|
switch (action.type) {
|
|
12
|
-
case
|
|
12
|
+
case "updateContext":
|
|
13
13
|
if (isDev) {
|
|
14
|
-
console.log(
|
|
14
|
+
console.log("[SSR:updateContext]: dispatch updateContext with action");
|
|
15
15
|
console.log(action);
|
|
16
16
|
}
|
|
17
17
|
return { ...state, ...action.payload };
|
|
@@ -26,8 +26,8 @@ function AppContext(props) {
|
|
|
26
26
|
return (0, react_1.createElement)(props.context.Provider, {
|
|
27
27
|
value: {
|
|
28
28
|
state,
|
|
29
|
-
dispatch
|
|
30
|
-
}
|
|
29
|
+
dispatch,
|
|
30
|
+
},
|
|
31
31
|
}, props.children);
|
|
32
32
|
}
|
|
33
33
|
//# sourceMappingURL=context.js.map
|
package/cjs/entry/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/entry/context.tsx"],"names":[],"mappings":";;AA4BA,
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/entry/context.tsx"],"names":[],"mappings":";;AA4BA,gCAiBC;AA7CD,iCAAkD;AAElD,qCAAkC;AAElC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,eAAyB,CAAC;AAErD,MAAM,SAAS,GAAG,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC;AAC9B,MAAM,WAAW,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,cAAa,CAAC,CAAC;AAE9C,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,CAAC;AAIpD,SAAS,cAAc,CAAC,KAAU,EAAE,MAAc;IAChD,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,eAAe;YAClB,IAAI,KAAK,EAAE,CAAC;gBACV,OAAO,CAAC,GAAG,CAAC,yDAAyD,CAAC,CAAC;gBACvE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACtB,CAAC;YACD,OAAO,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;IAC3C,CAAC;AACH,CAAC;AAED,SAAS,cAAc,CAAC,KAAU,EAAE,MAAW;IAC7C,OAAO,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACrE,CAAC;AAED,SAAgB,UAAU,CAAC,KAAa;IACtC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAChC,EAAE,EACF,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE,EACf,aAAa,CAAC,CAAC,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,gBAAgB,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAC9D,CAAC;IACF,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,kBAAU,EAAC,cAAc,EAAE,YAAY,CAAC,CAAC;IACnE,OAAO,IAAA,qBAAa,EAClB,KAAK,CAAC,OAAO,CAAC,QAAQ,EACtB;QACE,KAAK,EAAE;YACL,KAAK;YACL,QAAQ;SACT;KACF,EACD,KAAK,CAAC,QAAe,CACtB,CAAC;AACJ,CAAC"}
|
package/cjs/entry/create.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { IContext } from
|
|
2
|
-
import { ReactRoutesType } from 'ssr-types';
|
|
1
|
+
import type { IContext, ReactRoutesType } from "ssr-types";
|
|
3
2
|
export declare const Routes: ReactRoutesType;
|
|
4
3
|
export declare const ssrCreateContext: () => import("react").Context<IContext<any>>;
|
|
5
|
-
export declare function createStore(
|
|
4
|
+
export declare function createStore(): any;
|
|
6
5
|
//# sourceMappingURL=create.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/entry/create.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/entry/create.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE3D,eAAO,MAAM,MAAM,EAAiD,eAAe,CAAC;AACpF,eAAO,MAAM,gBAAgB,8CAQ5B,CAAC;AAEF,wBAAgB,WAAW,QAW1B"}
|
package/cjs/entry/create.js
CHANGED
|
@@ -11,7 +11,7 @@ const valtio_1 = require("valtio");
|
|
|
11
11
|
exports.Routes = (0, ssr_common_utils_1.combineRoutes)(declareRoutes, ManualRoutes);
|
|
12
12
|
const ssrCreateContext = () => {
|
|
13
13
|
const STORE_CONTEXT = (0, react_1.createContext)({
|
|
14
|
-
state: {}
|
|
14
|
+
state: {},
|
|
15
15
|
});
|
|
16
16
|
if (__isBrowser__) {
|
|
17
17
|
window.STORE_CONTEXT = STORE_CONTEXT;
|
|
@@ -19,11 +19,16 @@ const ssrCreateContext = () => {
|
|
|
19
19
|
return STORE_CONTEXT;
|
|
20
20
|
};
|
|
21
21
|
exports.ssrCreateContext = ssrCreateContext;
|
|
22
|
-
function createStore(
|
|
22
|
+
function createStore() {
|
|
23
|
+
var _a;
|
|
23
24
|
const { store } = exports.Routes;
|
|
24
|
-
const storeInstance =
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
const storeInstance = __isBrowser__ ? store : (0, valtio_1.proxy)((0, ssr_deepclone_1.deepClone)(store));
|
|
26
|
+
if (__isBrowser__) {
|
|
27
|
+
for (const key in storeInstance) {
|
|
28
|
+
if (__isBrowser__ && ((_a = window.__VALTIO_DATA__) === null || _a === void 0 ? void 0 : _a[key])) {
|
|
29
|
+
Object.assign(storeInstance[key], window.__VALTIO_DATA__[key]);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
27
32
|
}
|
|
28
33
|
return storeInstance;
|
|
29
34
|
}
|
package/cjs/entry/create.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/entry/create.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/entry/create.ts"],"names":[],"mappings":";;;AAmBA,kCAWC;AA9BD,2DAA2D;AAC3D,yDAAyD;AACzD,iCAAsC;AACtC,uDAAiD;AACjD,iDAA0C;AAC1C,mCAA+B;AAGlB,QAAA,MAAM,GAAG,IAAA,gCAAa,EAAC,aAAa,EAAE,YAAY,CAAoB,CAAC;AAC7E,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,MAAM,aAAa,GAAG,IAAA,qBAAa,EAAW;QAC5C,KAAK,EAAE,EAAE;KACV,CAAC,CAAC;IACH,IAAI,aAAa,EAAE,CAAC;QAClB,MAAM,CAAC,aAAa,GAAG,aAAa,CAAC;IACvC,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC;AARW,QAAA,gBAAgB,oBAQ3B;AAEF,SAAgB,WAAW;;IACzB,MAAM,EAAE,KAAK,EAAE,GAAG,cAAM,CAAC;IACzB,MAAM,aAAa,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAA,cAAK,EAAC,IAAA,yBAAS,EAAC,KAAK,CAAC,CAAC,CAAC;IACtE,IAAI,aAAa,EAAE,CAAC;QAClB,KAAK,MAAM,GAAG,IAAI,aAAa,EAAE,CAAC;YAChC,IAAI,aAAa,KAAI,MAAA,MAAM,CAAC,eAAe,0CAAG,GAAG,CAAC,CAAA,EAAE,CAAC;gBACnD,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC;YACjE,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react17-client-entry.d.ts","sourceRoot":"","sources":["../../src/entry/react17-client-entry.tsx"],"names":[],"mappings":"AAWA,QAAA,MAAM,YAAY,QAAa,OAAO,CAAC,IAAI,CAyD1C,
|
|
1
|
+
{"version":3,"file":"react17-client-entry.d.ts","sourceRoot":"","sources":["../../src/entry/react17-client-entry.tsx"],"names":[],"mappings":"AAWA,QAAA,MAAM,YAAY,QAAa,OAAO,CAAC,IAAI,CAyD1C,CAAC;AAIF,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -16,15 +16,15 @@ const clientRender = async () => {
|
|
|
16
16
|
};
|
|
17
17
|
const context = (0, create_1.ssrCreateContext)();
|
|
18
18
|
(0, ssr_common_utils_1.setStoreContext)(context);
|
|
19
|
-
const store = (0, create_1.createStore)(
|
|
19
|
+
const store = (0, create_1.createStore)();
|
|
20
20
|
(0, ssr_common_utils_1.setStore)(store !== null && store !== void 0 ? store : {});
|
|
21
21
|
const baseName = (0, ssr_common_utils_1.isMicro)() ? window.clientPrefix : window.prefix;
|
|
22
22
|
const routes = await (0, ssr_common_utils_1.preloadComponent)(FeRoutes, baseName);
|
|
23
|
-
const container = document.querySelector((_a = window.ssrDevInfo.rootId) !== null && _a !== void 0 ? _a :
|
|
23
|
+
const container = document.querySelector((_a = window.ssrDevInfo.rootId) !== null && _a !== void 0 ? _a : "#app");
|
|
24
24
|
const ele = (0, react_1.createElement)(
|
|
25
25
|
//@ts-ignore
|
|
26
26
|
react_router_dom_1.BrowserRouter, {
|
|
27
|
-
basename: baseName
|
|
27
|
+
basename: baseName,
|
|
28
28
|
}, (0, react_1.createElement)(context_1.AppContext, {
|
|
29
29
|
context,
|
|
30
30
|
children: (0, react_1.createElement)(react_router_dom_1.Switch, null, (0, react_1.createElement)(IApp, null, (0, react_1.createElement)(react_router_dom_1.Switch, null, routes.map((item) => {
|
|
@@ -38,14 +38,13 @@ const clientRender = async () => {
|
|
|
38
38
|
path: path,
|
|
39
39
|
render: (props) => (0, react_1.createElement)(WrappedComponent, {
|
|
40
40
|
...props,
|
|
41
|
-
key: props.history.location.key
|
|
42
|
-
})
|
|
41
|
+
key: props.history.location.key,
|
|
42
|
+
}),
|
|
43
43
|
});
|
|
44
|
-
}))))
|
|
44
|
+
})))),
|
|
45
45
|
}));
|
|
46
|
-
react_dom_1.default[window.__USE_SSR__ ?
|
|
46
|
+
react_dom_1.default[window.__USE_SSR__ ? "hydrate" : "render"](ele, container);
|
|
47
47
|
if (!window.__USE_VITE__) {
|
|
48
|
-
;
|
|
49
48
|
(_c = (_b = module === null || module === void 0 ? void 0 : module.hot) === null || _b === void 0 ? void 0 : _b.accept) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
50
49
|
}
|
|
51
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react17-client-entry.js","sourceRoot":"","sources":["../../src/entry/react17-client-entry.tsx"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"react17-client-entry.js","sourceRoot":"","sources":["../../src/entry/react17-client-entry.tsx"],"names":[],"mappings":";;;AACA,yCAAiC;AACjC,iCAAsC;AACtC,uDAAgE;AAChE,uDAAwF;AACxF,iDAA8C;AAC9C,qCAAiE;AACjE,uCAAuC;AAEvC,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,EAAE,GAAG,eAAM,CAAC;AAE9C,MAAM,YAAY,GAAG,KAAK,IAAmB,EAAE;;IAC7C,MAAM,IAAI,GACR,GAAG,aAAH,GAAG,cAAH,GAAG,GACH,UAAU,KAAkB;QAC1B,OAAO,KAAK,CAAC,QAAS,CAAC;IACzB,CAAC,CAAC;IACJ,MAAM,OAAO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KAAK,EAAE,EAAE,CAChB,IAAA,qBAAa,EAAC,gBAAgB,EAAE;oBAC9B,GAAG,KAAK;oBACR,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG;iBAChC,CAAC;aACL,CAAC,CAAC;QACL,CAAC,CAAC,CACH,CACF,CACF;KACF,CAAC,CACH,CAAC;IAEF,mBAAQ,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IAEpE,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;QACzB,MAAA,MAAC,MAAc,aAAd,MAAM,uBAAN,MAAM,CAAU,GAAG,0CAAE,MAAM,kDAAI,CAAC;IACnC,CAAC;AACH,CAAC,CAAC;AAIO,oCAAY;AAFrB,YAAY,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react18-client-entry.d.ts","sourceRoot":"","sources":["../../src/entry/react18-client-entry.tsx"],"names":[],"mappings":"AAYA,QAAA,MAAM,YAAY,QAAa,OAAO,CAAC,IAAI,CA6D1C,
|
|
1
|
+
{"version":3,"file":"react18-client-entry.d.ts","sourceRoot":"","sources":["../../src/entry/react18-client-entry.tsx"],"names":[],"mappings":"AAYA,QAAA,MAAM,YAAY,QAAa,OAAO,CAAC,IAAI,CA6D1C,CAAC;AAIF,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -17,15 +17,15 @@ const clientRender = async () => {
|
|
|
17
17
|
};
|
|
18
18
|
const context = (0, create_1.ssrCreateContext)();
|
|
19
19
|
(0, ssr_common_utils_1.setStoreContext)(context);
|
|
20
|
-
const store = (0, create_1.createStore)(
|
|
20
|
+
const store = (0, create_1.createStore)();
|
|
21
21
|
(0, ssr_common_utils_1.setStore)(store !== null && store !== void 0 ? store : {});
|
|
22
22
|
const baseName = (0, ssr_common_utils_1.isMicro)() ? window.clientPrefix : window.prefix;
|
|
23
23
|
const routes = await (0, ssr_common_utils_1.preloadComponent)(FeRoutes, baseName);
|
|
24
|
-
const container = document.querySelector((_a = window.ssrDevInfo.rootId) !== null && _a !== void 0 ? _a :
|
|
24
|
+
const container = document.querySelector((_a = window.ssrDevInfo.rootId) !== null && _a !== void 0 ? _a : "#app");
|
|
25
25
|
const ele = (0, react_1.createElement)(
|
|
26
26
|
//@ts-ignore
|
|
27
27
|
react_router_dom_1.BrowserRouter, {
|
|
28
|
-
basename: baseName
|
|
28
|
+
basename: baseName,
|
|
29
29
|
}, (0, react_1.createElement)(context_1.AppContext, {
|
|
30
30
|
context,
|
|
31
31
|
children: (0, react_1.createElement)(react_router_dom_1.Switch, null, (0, react_1.createElement)(IApp, null, (0, react_1.createElement)(react_router_dom_1.Switch, null, routes.map((item) => {
|
|
@@ -39,13 +39,12 @@ const clientRender = async () => {
|
|
|
39
39
|
path: path,
|
|
40
40
|
render: (props) => (0, react_1.createElement)(WrappedComponent, {
|
|
41
41
|
...props,
|
|
42
|
-
key: props.history.location.key
|
|
43
|
-
})
|
|
42
|
+
key: props.history.location.key,
|
|
43
|
+
}),
|
|
44
44
|
});
|
|
45
|
-
}))))
|
|
45
|
+
})))),
|
|
46
46
|
}));
|
|
47
47
|
if (window.__USE_SSR__) {
|
|
48
|
-
;
|
|
49
48
|
client_1.hydrateRoot(container, ele);
|
|
50
49
|
}
|
|
51
50
|
else {
|
|
@@ -53,7 +52,6 @@ const clientRender = async () => {
|
|
|
53
52
|
root.render(ele);
|
|
54
53
|
}
|
|
55
54
|
if (!window.__USE_VITE__) {
|
|
56
|
-
;
|
|
57
55
|
(_c = (_b = module === null || module === void 0 ? void 0 : module.hot) === null || _b === void 0 ? void 0 : _b.accept) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
58
56
|
}
|
|
59
57
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react18-client-entry.js","sourceRoot":"","sources":["../../src/entry/react18-client-entry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|
2
|
-
import { Routes } from
|
|
1
|
+
import { ISSRContext, IConfig } from "ssr-types";
|
|
2
|
+
import { Routes } from "./create";
|
|
3
3
|
declare const serverRender: (ctx: ISSRContext, config: IConfig) => Promise<string | import("stream").Readable | NodeJS.ReadableStream | import("ssr-types").PipeableStream | {
|
|
4
4
|
html: string;
|
|
5
5
|
teleportsContext: any;
|