@nestjs-ssr/react 0.2.2 → 0.2.4
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/README.md +35 -32
- package/package.json +16 -16
package/README.md
CHANGED
|
@@ -1,33 +1,16 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @nestjs-ssr/react
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@nestjs-ssr/react)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
> This package is currently in active development. The API may change between minor versions. Production use is not recommended yet.
|
|
6
|
+
React as a view layer for NestJS. Controllers return data. Components render it. One app.
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Clean Architecture: layers separated, dependencies inward, business logic framework-agnostic.
|
|
12
|
-
|
|
13
|
-
## When To Use
|
|
14
|
-
|
|
15
|
-
**Use this when:**
|
|
16
|
-
|
|
17
|
-
- You have NestJS and want React instead of Handlebars/EJS
|
|
18
|
-
- Testable layers matter more than file-based routing
|
|
19
|
-
- You want feature modules (controller + service + view together)
|
|
20
|
-
|
|
21
|
-
**Use Next.js when:**
|
|
22
|
-
|
|
23
|
-
- You're starting fresh without NestJS
|
|
24
|
-
- You want the React ecosystem's defaults
|
|
25
|
-
- File-based routing fits your mental model
|
|
8
|
+
**[Documentation](https://georgialexandrov.github.io/nest-ssr/)** | **[Getting Started](https://georgialexandrov.github.io/nest-ssr/guide/installation)**
|
|
26
9
|
|
|
27
10
|
## Quick Start
|
|
28
11
|
|
|
29
12
|
```bash
|
|
30
|
-
npx @nestjs-ssr/react
|
|
13
|
+
npx @nestjs-ssr/react init
|
|
31
14
|
```
|
|
32
15
|
|
|
33
16
|
```typescript
|
|
@@ -58,32 +41,52 @@ expect(await controller.getProduct('123')).toEqual({ product: { id: '123' } });
|
|
|
58
41
|
render(<ProductDetail data={{ product: mockProduct }} />);
|
|
59
42
|
```
|
|
60
43
|
|
|
61
|
-
##
|
|
44
|
+
## What You Get
|
|
62
45
|
|
|
63
46
|
**Rendering:**
|
|
64
47
|
|
|
65
48
|
- Type-safe data flow from controller to component
|
|
66
|
-
- Hierarchical layouts (
|
|
67
|
-
- Head tags
|
|
49
|
+
- Hierarchical layouts (root → controller → method)
|
|
50
|
+
- Head tags (title, meta, OG, JSON-LD)
|
|
51
|
+
- Stream or string mode
|
|
68
52
|
|
|
69
53
|
**Request Context:**
|
|
70
54
|
|
|
71
|
-
- Hooks:
|
|
55
|
+
- Hooks: `useParams()`, `useQuery()`, `useHeader()`, `useCookie()`
|
|
72
56
|
- Whitelist what reaches the client
|
|
73
57
|
|
|
74
58
|
**Development:**
|
|
75
59
|
|
|
76
|
-
- Integrated mode:
|
|
77
|
-
-
|
|
60
|
+
- Integrated mode: Vite inside NestJS, one process
|
|
61
|
+
- Separate mode: standalone Vite server, true HMR
|
|
78
62
|
|
|
79
|
-
##
|
|
63
|
+
## Requirements
|
|
80
64
|
|
|
81
|
-
|
|
65
|
+
- Node.js 20+
|
|
66
|
+
- NestJS 11+
|
|
67
|
+
- React 19+
|
|
68
|
+
- Vite 6+
|
|
69
|
+
- TypeScript 5+
|
|
82
70
|
|
|
83
|
-
##
|
|
71
|
+
## Documentation
|
|
84
72
|
|
|
85
|
-
**[
|
|
86
|
-
|
|
73
|
+
**[georgialexandrov.github.io/nest-ssr](https://georgialexandrov.github.io/nest-ssr/)**
|
|
74
|
+
|
|
75
|
+
- [Installation](https://georgialexandrov.github.io/nest-ssr/guide/installation)
|
|
76
|
+
- [Rendering](https://georgialexandrov.github.io/nest-ssr/guide/rendering)
|
|
77
|
+
- [Request Context](https://georgialexandrov.github.io/nest-ssr/guide/request-context)
|
|
78
|
+
- [Configuration](https://georgialexandrov.github.io/nest-ssr/guide/configuration)
|
|
79
|
+
- [API Reference](https://georgialexandrov.github.io/nest-ssr/guide/api)
|
|
80
|
+
|
|
81
|
+
## Contributing
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
git clone https://github.com/georgialexandrov/nestjs-ssr.git
|
|
85
|
+
cd nestjs-ssr
|
|
86
|
+
pnpm install
|
|
87
|
+
pnpm build:package
|
|
88
|
+
pnpm test
|
|
89
|
+
```
|
|
87
90
|
|
|
88
91
|
## License
|
|
89
92
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs-ssr/react",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "React SSR for NestJS that respects Clean Architecture. Proper DI, SOLID principles, clear separation of concerns.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nestjs",
|
|
@@ -126,35 +126,35 @@
|
|
|
126
126
|
"dependencies": {
|
|
127
127
|
"citty": "^0.1.6",
|
|
128
128
|
"consola": "^3.4.2",
|
|
129
|
-
"devalue": "^5.
|
|
129
|
+
"devalue": "^5.6.1",
|
|
130
130
|
"escape-html": "^1.0.3"
|
|
131
131
|
},
|
|
132
132
|
"devDependencies": {
|
|
133
133
|
"@microsoft/api-extractor": "^7.55.2",
|
|
134
|
-
"@
|
|
135
|
-
"@nestjs/
|
|
136
|
-
"@nestjs/
|
|
137
|
-
"@nestjs/platform-express": "^11.0.0",
|
|
134
|
+
"@nestjs/common": "^11.1.9",
|
|
135
|
+
"@nestjs/core": "^11.1.9",
|
|
136
|
+
"@nestjs/platform-express": "^11.1.9",
|
|
138
137
|
"@nestjs/testing": "^11.1.9",
|
|
138
|
+
"@playwright/test": "^1.57.0",
|
|
139
139
|
"@testing-library/jest-dom": "^6.9.1",
|
|
140
140
|
"@testing-library/react": "^16.3.0",
|
|
141
141
|
"@types/escape-html": "^1.0.4",
|
|
142
|
-
"@types/express": "^5.0.
|
|
143
|
-
"@types/node": "^
|
|
144
|
-
"@types/react": "^19.
|
|
145
|
-
"@types/react-dom": "^19.
|
|
142
|
+
"@types/express": "^5.0.6",
|
|
143
|
+
"@types/node": "^25.0.1",
|
|
144
|
+
"@types/react": "^19.2.7",
|
|
145
|
+
"@types/react-dom": "^19.2.3",
|
|
146
146
|
"@types/supertest": "^6.0.3",
|
|
147
|
-
"@vitejs/plugin-react": "^
|
|
147
|
+
"@vitejs/plugin-react": "^5.1.2",
|
|
148
148
|
"@vitest/coverage-v8": "^4.0.15",
|
|
149
149
|
"@vitest/ui": "^4.0.15",
|
|
150
150
|
"happy-dom": "^20.0.11",
|
|
151
|
-
"react": "^19.
|
|
152
|
-
"react-dom": "^19.
|
|
151
|
+
"react": "^19.2.3",
|
|
152
|
+
"react-dom": "^19.2.3",
|
|
153
153
|
"rxjs": "^7.8.2",
|
|
154
154
|
"supertest": "^7.1.4",
|
|
155
|
-
"tsup": "^8.
|
|
156
|
-
"typescript": "^5.
|
|
157
|
-
"vite": "^7.
|
|
155
|
+
"tsup": "^8.5.1",
|
|
156
|
+
"typescript": "^5.9.3",
|
|
157
|
+
"vite": "^7.2.7",
|
|
158
158
|
"vitest": "^4.0.15"
|
|
159
159
|
},
|
|
160
160
|
"publishConfig": {
|