vike-react 0.6.18 → 0.6.20

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.
@@ -1,13 +1,14 @@
1
- // TODO/soon: add deprecation warning in favor of <ClientOnly>
2
1
  // TO-DO/breaking-change: remove it
3
2
  export { clientOnly };
4
3
  import React, { Suspense, forwardRef, lazy, useEffect, useState, } from 'react';
4
+ import { assertWarning } from '../utils/assert.js';
5
5
  /**
6
6
  * Load and render a component only on the client-side.
7
7
  *
8
8
  * https://vike.dev/clientOnly
9
9
  */
10
10
  function clientOnly(load) {
11
+ assertWarning(false, 'clientOnly() is deprecated — use <ClientOnly> https://vike.dev/ClientOnly');
11
12
  if (!globalThis.__VIKE__IS_CLIENT) {
12
13
  return (props) => React.createElement(React.Fragment, null, props.fallback);
13
14
  }
@@ -1 +1,4 @@
1
- export declare function assert(condition: unknown): asserts condition;
1
+ export { assert };
2
+ export { assertWarning };
3
+ declare function assert(condition: unknown): asserts condition;
4
+ declare function assertWarning(condition: unknown, message: string): void;
@@ -1,5 +1,12 @@
1
- export function assert(condition) {
1
+ export { assert };
2
+ export { assertWarning };
3
+ function assert(condition) {
2
4
  if (condition)
3
5
  return;
4
6
  throw new Error('You stumbled upon a vike-react bug, reach out on GitHub.');
5
7
  }
8
+ function assertWarning(condition, message) {
9
+ if (condition)
10
+ return;
11
+ console.warn(new Error(message));
12
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike-react",
3
- "version": "0.6.18",
3
+ "version": "0.6.20",
4
4
  "repository": "https://github.com/vikejs/vike-react",
5
5
  "type": "module",
6
6
  "exports": {
@@ -8,14 +8,17 @@
8
8
  "./useData": "./dist/hooks/useData.js",
9
9
  "./useHydrated": "./dist/hooks/useHydrated.js",
10
10
  "./useConfig": {
11
+ "worker": "./dist/hooks/useConfig/useConfig-server.js",
11
12
  "browser": "./dist/hooks/useConfig/useConfig-client.js",
12
13
  "default": "./dist/hooks/useConfig/useConfig-server.js"
13
14
  },
14
15
  "./Config": {
16
+ "worker": "./dist/components/Config/Config-server.js",
15
17
  "browser": "./dist/components/Config/Config-client.js",
16
18
  "default": "./dist/components/Config/Config-server.js"
17
19
  },
18
20
  "./Head": {
21
+ "worker": "./dist/components/Head/Head-server.js",
19
22
  "browser": "./dist/components/Head/Head-client.js",
20
23
  "default": "./dist/components/Head/Head-server.js"
21
24
  },
@@ -45,7 +48,7 @@
45
48
  "react-dom": "^19.2.1",
46
49
  "rimraf": "^5.0.5",
47
50
  "typescript": "^5.9.2",
48
- "vike": "^0.4.250",
51
+ "vike": "^0.4.252",
49
52
  "vite": "^7.3.0"
50
53
  },
51
54
  "typesVersions": {