vike-lite-react 1.0.2 → 1.0.3
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 +4 -3
- package/dist/vite.d.mts +1 -1
- package/dist/vite.mjs +2 -2
- package/package.json +28 -11
package/README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Vike Lite React
|
|
2
|
+
<a href="https://npmjs.com/package/vike-lite-react"><img src="https://img.shields.io/npm/v/vike-lite-react.svg" alt="npm package"></a>
|
|
2
3
|
|
|
3
4
|
The official React integration for `vike-lite`. It provides seamless Server-Side Rendering (SSR), Static Site Generation (SSG), and client hydration out of the box, with a focus on minimalism and performance.
|
|
4
5
|
|
|
@@ -19,7 +20,7 @@ yarn add -D vike-lite-react @vitejs/plugin-react
|
|
|
19
20
|
yarn add react react-dom
|
|
20
21
|
```
|
|
21
22
|
|
|
22
|
-
###
|
|
23
|
+
### 🛠️ Vite Plugin
|
|
23
24
|
|
|
24
25
|
```ts
|
|
25
26
|
// vite.config.ts
|
|
@@ -141,7 +142,7 @@ Why choose `vike-lite`? It's built to be as minimal and fast as possible. Here a
|
|
|
141
142
|
| **Reactivity Architecture** | _Single Source of Truth_ | _Separation of Concerns_ | `vike-lite-react` keeps page data (`pageContext`) and the active UI (`view`: Page/Layout/Head) as two separate `useState` atoms, so a data update doesn't force React to re-resolve which components are mounted, and vice versa.
|
|
142
143
|
| **Accessibility (A11y)** | _Not_ handled by default | _Automatic_ handled | After a client-side navigation, `vike-lite-react` moves the focus to `#root`. This significantly improves UX for keyboard navigation and screen readers.
|
|
143
144
|
| `useData()` **Hook** | `getter` only | `[getter, setter]` | `vike-lite-react` allows you to mutate the route data locally without needing other state managers.
|
|
144
|
-
| URL parsed |
|
|
145
|
+
| URL parsed | [pageContext.urlParsed](https://vike.dev/pageContext#urlParsed) | [useUrl()](#useurl) | A dedicated hook, consistent with `vike-lite-react`
|
|
145
146
|
|
|
146
147
|
---
|
|
147
148
|
|
package/dist/vite.d.mts
CHANGED
package/dist/vite.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import react from "@vitejs/plugin-react";
|
|
2
|
-
//#region src/vite
|
|
2
|
+
//#region src/vite.ts
|
|
3
3
|
function vikeLiteReact({ hydration = true, react: reactOptions } = {}) {
|
|
4
4
|
const virtualConfigId = "virtual:vike-lite/config";
|
|
5
5
|
const virtualClientId = "virtual:vike-lite/client";
|
|
@@ -16,7 +16,7 @@ function vikeLiteReact({ hydration = true, react: reactOptions } = {}) {
|
|
|
16
16
|
if (id === virtualServerId) return resolvedVirtualServerId;
|
|
17
17
|
},
|
|
18
18
|
load(id) {
|
|
19
|
-
if (id === resolvedVirtualConfigId) return `export const hydration=${
|
|
19
|
+
if (id === resolvedVirtualConfigId) return `export const hydration=${hydration};`;
|
|
20
20
|
if (id === resolvedVirtualClientId) return "export const onRenderClient=()=>import(\"vike-lite-react/__internal/client/onRenderClient\");";
|
|
21
21
|
if (id === resolvedVirtualServerId) return `export {onRenderHtml}from'vike-lite-react/__internal/server/onRenderHtml';`;
|
|
22
22
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vike-lite-react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"license": "MIT",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/node-ecosystem/vike-lite.git"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/node-ecosystem/vike-lite#readme",
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/node-ecosystem/vike-lite/issues"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"framework",
|
|
15
|
+
"lite",
|
|
16
|
+
"react",
|
|
17
|
+
"react-ssr",
|
|
18
|
+
"server-side-rendering",
|
|
19
|
+
"ssg",
|
|
20
|
+
"ssr",
|
|
21
|
+
"static-site-generator",
|
|
22
|
+
"vike",
|
|
23
|
+
"vike-lite",
|
|
24
|
+
"vite",
|
|
25
|
+
"vite-plugin",
|
|
26
|
+
"vite-ssr",
|
|
27
|
+
"vitejs",
|
|
28
|
+
"web-framework"
|
|
29
|
+
],
|
|
5
30
|
"type": "module",
|
|
6
31
|
"module": "./dist/index.mjs",
|
|
7
32
|
"types": "./dist/index.d.mts",
|
|
@@ -23,14 +48,6 @@
|
|
|
23
48
|
"import": "./dist/__internal/server/onRenderHtml.mjs"
|
|
24
49
|
}
|
|
25
50
|
},
|
|
26
|
-
"repository": {
|
|
27
|
-
"type": "git",
|
|
28
|
-
"url": "git+https://github.com/node-ecosystem/vike-lite-react.git"
|
|
29
|
-
},
|
|
30
|
-
"homepage": "https://github.com/node-ecosystem/vike-lite-react#readme",
|
|
31
|
-
"bugs": {
|
|
32
|
-
"url": "https://github.com/node-ecosystem/vike-lite-react/issues"
|
|
33
|
-
},
|
|
34
51
|
"files": [
|
|
35
52
|
"dist"
|
|
36
53
|
],
|
|
@@ -45,8 +62,8 @@
|
|
|
45
62
|
"@vitejs/plugin-react": "^6.0.3",
|
|
46
63
|
"react": "^19.2.7",
|
|
47
64
|
"react-dom": "^19.2.7",
|
|
48
|
-
"tsdown": "^0.22.
|
|
49
|
-
"vike-lite": "1.
|
|
65
|
+
"tsdown": "^0.22.8",
|
|
66
|
+
"vike-lite": "1.15.1",
|
|
50
67
|
"vite": "^8.1.4"
|
|
51
68
|
},
|
|
52
69
|
"peerDependencies": {
|