vike-react 0.5.8 → 0.5.10

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.md ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023-present Romuald Brillout
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -5,7 +5,7 @@ declare const config: {
5
5
  require: {
6
6
  vike: string;
7
7
  };
8
- Loading: "import:vike-react/__internal/components/Loading:default";
8
+ Loading: "import:vike-react/__internal/integration/Loading:default";
9
9
  onRenderHtml: "import:vike-react/__internal/integration/onRenderHtml:onRenderHtml";
10
10
  onRenderClient: "import:vike-react/__internal/integration/onRenderClient:onRenderClient";
11
11
  passToClient: string[];
@@ -2,15 +2,17 @@ export { config as default };
2
2
  import { ssrEffect } from './integration/ssrEffect.js';
3
3
  import { isNotFalse } from './utils/isNotFalse.js';
4
4
  const config = {
5
+ // @eject-remove start
5
6
  name: 'vike-react',
6
7
  require: {
7
8
  vike: '>=0.4.182',
8
9
  },
9
- Loading: 'import:vike-react/__internal/components/Loading:default',
10
+ Loading: 'import:vike-react/__internal/integration/Loading:default',
10
11
  // https://vike.dev/onRenderHtml
11
12
  onRenderHtml: 'import:vike-react/__internal/integration/onRenderHtml:onRenderHtml',
12
13
  // https://vike.dev/onRenderClient
13
14
  onRenderClient: 'import:vike-react/__internal/integration/onRenderClient:onRenderClient',
15
+ // @eject-remove end
14
16
  passToClient: [
15
17
  '_configFromHook',
16
18
  // https://github.com/vikejs/vike-react/issues/25
@@ -106,6 +108,8 @@ const config = {
106
108
  },
107
109
  },
108
110
  };
111
+ // @eject-remove start
109
112
  // This is required to make TypeScript load the global interfaces Vike.Config and Vike.PageContext so that they're always loaded: we can assume that the user always imports this file over `import vikeReact from 'vike-react/config'`
110
113
  import './types/Config.js';
111
114
  import './types/PageContext.js';
115
+ // @eject-remove end
package/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export { default } from './+config.js';
1
+ export { default } from './config.js';
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  // TODO/next-major-release: remove this file/export
2
2
  console.warn("[vike-react][warning][deprecation] Replace `import vikeReact from 'vike-react'` with `import vikeReact from 'vike-react/config'` (typically in your /pages/+config.js)");
3
- export { default } from './+config.js';
3
+ export { default } from './config.js';
@@ -1,4 +1,4 @@
1
- /* For components/Loading.tsx */
1
+ /* For integration/Loading.tsx */
2
2
  @keyframes vike-react-shine {
3
3
  to {
4
4
  background-position-x: -200%;
@@ -137,15 +137,7 @@ declare global {
137
137
  */
138
138
  ssr?: boolean;
139
139
  /**
140
- * Whether to stream the page's HTML.
141
- *
142
- * Requires Server-Side Rendering (`ssr: true`).
143
- *
144
- * A Node.js Stream is used whenever possible, falling back to a Web Stream otherwise.
145
- *
146
- * By setting the value to `web` or `node`, you force the usage of a Web Stream or Node.js Stream.
147
- *
148
- * @default false
140
+ * Enable or disable HTML Streaming.
149
141
  *
150
142
  * https://vike.dev/stream
151
143
  */
@@ -169,13 +161,13 @@ declare global {
169
161
  *
170
162
  * https://vike.dev/onBeforeRenderHtml
171
163
  */
172
- onBeforeRenderHtml?: (pageContext: PageContextServer) => void;
164
+ onBeforeRenderHtml?: ((pageContext: PageContextServer) => void) | ImportString;
173
165
  /**
174
166
  * Hook called right after rendering the page's root React component to HTML.
175
167
  *
176
168
  * https://vike.dev/onAfterRenderHtml
177
169
  */
178
- onAfterRenderHtml?: (pageContext: PageContextServer) => void;
170
+ onAfterRenderHtml?: ((pageContext: PageContextServer) => void) | ImportString;
179
171
  /**
180
172
  * Client-side hook called before the page is rendered.
181
173
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike-react",
3
- "version": "0.5.8",
3
+ "version": "0.5.10",
4
4
  "repository": "https://github.com/vikejs/vike-react",
5
5
  "type": "module",
6
6
  "exports": {
@@ -21,10 +21,10 @@
21
21
  "./clientOnly": "./dist/helpers/clientOnly.js",
22
22
  "./ClientOnly": "./dist/components/ClientOnly.js",
23
23
  ".": "./dist/index.js",
24
- "./config": "./dist/+config.js",
24
+ "./config": "./dist/config.js",
25
25
  "./__internal/integration/onRenderHtml": "./dist/integration/onRenderHtml.js",
26
26
  "./__internal/integration/onRenderClient": "./dist/integration/onRenderClient.js",
27
- "./__internal/components/Loading": "./dist/components/Loading.js"
27
+ "./__internal/integration/Loading": "./dist/integration/Loading.js"
28
28
  },
29
29
  "dependencies": {
30
30
  "react-streaming": "^0.3.42"
@@ -34,14 +34,6 @@
34
34
  "react-dom": ">=18.0.0",
35
35
  "vike": ">=0.4.182"
36
36
  },
37
- "scripts": {
38
- "dev": "tsc --watch",
39
- "build": "rimraf dist/ && tsc && pnpm run build:css",
40
- "build:css": "cp src/integration/styles.css dist/integration/styles.css",
41
- "release": "release-me patch",
42
- "release:minor": "release-me minor",
43
- "release:commit": "release-me commit"
44
- },
45
37
  "devDependencies": {
46
38
  "@biomejs/biome": "^1.6.4",
47
39
  "@brillout/release-me": "^0.4.2",
@@ -83,7 +75,7 @@
83
75
  "./dist/index.d.ts"
84
76
  ],
85
77
  "config": [
86
- "./dist/+config.d.ts"
78
+ "./dist/config.d.ts"
87
79
  ],
88
80
  "__/internal/integration/onRenderHtml": [
89
81
  "./dist/integration/onRenderHtml.d.ts"
@@ -101,5 +93,13 @@
101
93
  "license": "MIT",
102
94
  "keywords": [
103
95
  "react"
104
- ]
105
- }
96
+ ],
97
+ "scripts": {
98
+ "dev": "tsc --watch",
99
+ "build": "rimraf dist/ && tsc && pnpm run build:css",
100
+ "build:css": "cp src/integration/styles.css dist/integration/styles.css",
101
+ "release": "release-me patch",
102
+ "release:minor": "release-me minor",
103
+ "release:commit": "release-me commit"
104
+ }
105
+ }
File without changes
File without changes