@holo-js/adapter-next 0.3.12 → 0.3.14
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/dist/{chunk-VBBQ4VXY.mjs → chunk-PLFHK46L.mjs} +1 -1
- package/dist/client.mjs +1 -1
- package/dist/config.mjs +7 -4
- package/dist/realtime-definition-loader.mjs +1 -1
- package/dist/realtime.mjs +1 -1
- package/dist/validation-loader.d.ts +6 -0
- package/dist/validation-loader.mjs +9 -0
- package/package.json +7 -7
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
normalizeHoloHttpError,
|
|
4
4
|
renderClientHttpErrorPage
|
|
5
|
-
} from "@holo-js/adapter-shared";
|
|
5
|
+
} from "@holo-js/adapter-shared/client";
|
|
6
6
|
var nextHttpAccessFallbackStatuses = /* @__PURE__ */ new Set([401, 403, 404]);
|
|
7
7
|
function normalizeNextClientHttpError(error) {
|
|
8
8
|
return normalizeHoloHttpError(error);
|
package/dist/client.mjs
CHANGED
package/dist/config.mjs
CHANGED
|
@@ -151,11 +151,16 @@ function withHolo(nextConfig = {}) {
|
|
|
151
151
|
const existingTurbopack = nextConfig.turbopack ?? {};
|
|
152
152
|
const existingIgnoreIssue = existingTurbopack.ignoreIssue ?? [];
|
|
153
153
|
const hasRealtime = isOptionalServerExternalPackageInstalled("@holo-js/realtime", packageManifest);
|
|
154
|
+
const validationLoader = fileURLToPath(new URL("./validation-loader.mjs", import.meta.url));
|
|
154
155
|
const realtimeDefinitionLoader = fileURLToPath(new URL("./realtime-definition-loader.mjs", import.meta.url));
|
|
155
156
|
const mergedTurbopack = {
|
|
156
157
|
...existingTurbopack,
|
|
157
158
|
rules: {
|
|
158
159
|
...existingTurbopack.rules ?? {},
|
|
160
|
+
"*": [
|
|
161
|
+
...existingTurbopack.rules?.["*"] ? [existingTurbopack.rules["*"]].flat() : [],
|
|
162
|
+
{ condition: { all: ["browser", { not: "foreign" }, { path: /\.[cm]?[jt]sx?$/ }] }, loaders: [validationLoader] }
|
|
163
|
+
],
|
|
159
164
|
...hasRealtime ? {
|
|
160
165
|
"*.{ts,tsx,js,jsx,mts,mjs,cts,cjs}": [
|
|
161
166
|
createRealtimeDefinitionTurbopackRule(realtimeDefinitionLoader, "browser"),
|
|
@@ -189,13 +194,11 @@ function withHolo(nextConfig = {}) {
|
|
|
189
194
|
turbopack: mergedTurbopack,
|
|
190
195
|
webpack(config, context) {
|
|
191
196
|
const nextWebpackConfig = userWebpack?.(config, context) ?? config;
|
|
192
|
-
if (!hasRealtime) {
|
|
193
|
-
return nextWebpackConfig;
|
|
194
|
-
}
|
|
195
197
|
nextWebpackConfig.module = nextWebpackConfig.module ?? {};
|
|
196
198
|
nextWebpackConfig.module.rules = [
|
|
197
199
|
...nextWebpackConfig.module.rules ?? [],
|
|
198
|
-
createRealtimeDefinitionWebpackRule(realtimeDefinitionLoader, context.isServer)
|
|
200
|
+
...hasRealtime ? [createRealtimeDefinitionWebpackRule(realtimeDefinitionLoader, context.isServer)] : [],
|
|
201
|
+
...!context.isServer ? [{ test: /\.[cm]?[jt]sx?$/, exclude: /node_modules/, use: [{ loader: validationLoader }] }] : []
|
|
199
202
|
];
|
|
200
203
|
return nextWebpackConfig;
|
|
201
204
|
},
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
createRealtimeClientDefinitionModule as createSharedRealtimeClientDefinitionModule,
|
|
4
4
|
createRealtimeClientDefinitionTransform as createSharedRealtimeClientDefinitionTransform,
|
|
5
5
|
stripRealtimeServerHandlers
|
|
6
|
-
} from "@holo-js/adapter-shared";
|
|
6
|
+
} from "@holo-js/adapter-shared/build";
|
|
7
7
|
function createRealtimeClientDefinitionTransform(source, options = {}) {
|
|
8
8
|
return createSharedRealtimeClientDefinitionTransform(source, "@holo-js/adapter-next/realtime", options);
|
|
9
9
|
}
|
package/dist/realtime.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
createNextRenderableError,
|
|
4
4
|
normalizeNextClientHttpError,
|
|
5
5
|
renderNextClientHttpErrorPage
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PLFHK46L.mjs";
|
|
7
7
|
|
|
8
8
|
// src/realtime.ts
|
|
9
9
|
import { cache, createElement, use, useEffect, useMemo, useSyncExternalStore } from "react";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// src/validation-loader.ts
|
|
2
|
+
import { compileBrowserValidation } from "@holo-js/adapter-shared/build";
|
|
3
|
+
function validationLoader(source) {
|
|
4
|
+
this.cacheable?.();
|
|
5
|
+
return compileBrowserValidation(source, this.resourcePath) ?? source;
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
validationLoader as default
|
|
9
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holo-js/adapter-next",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.14",
|
|
4
4
|
"description": "Holo-JS Framework - Next.js adapter",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
"test": "vitest --run"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@holo-js/adapter-shared": "^0.3.
|
|
47
|
-
"@holo-js/config": "^0.3.
|
|
48
|
-
"@holo-js/core": "^0.3.
|
|
46
|
+
"@holo-js/adapter-shared": "^0.3.14",
|
|
47
|
+
"@holo-js/config": "^0.3.14",
|
|
48
|
+
"@holo-js/core": "^0.3.14"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@holo-js/forms": "^0.3.
|
|
52
|
-
"@holo-js/realtime": "^0.3.
|
|
51
|
+
"@holo-js/forms": "^0.3.14",
|
|
52
|
+
"@holo-js/realtime": "^0.3.14",
|
|
53
53
|
"next": "^16.2.4",
|
|
54
54
|
"react": "^19.2.6"
|
|
55
55
|
},
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@holo-js/realtime": "^0.3.
|
|
65
|
+
"@holo-js/realtime": "^0.3.14",
|
|
66
66
|
"@types/node": "^22.10.2",
|
|
67
67
|
"next": "^16.2.4",
|
|
68
68
|
"tsup": "^8.3.5",
|