@uniformdev/next-app-router 20.81.1-alpha.4.sha-de16ebeee7 → 20.81.1

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.
@@ -0,0 +1,18 @@
1
+ import { RouteGetResponseEdgehancedComposition } from '@uniformdev/canvas';
2
+ import { PageState } from '@uniformdev/next-app-router-shared';
3
+ import { D as DataClient } from './client-BElN_CWD.js';
4
+
5
+ type ResolvedRouteResult = {
6
+ pageState: PageState;
7
+ route: RouteGetResponseEdgehancedComposition | undefined;
8
+ code: string;
9
+ };
10
+
11
+ type ResolveRouteFunction = (options: ResolveRouteFromCodeOptions) => Promise<ResolvedRouteResult>;
12
+ type ResolveRouteFromCodeOptions = {
13
+ code: string;
14
+ dataClient?: DataClient;
15
+ };
16
+ declare const resolveRouteFromCode: ResolveRouteFunction;
17
+
18
+ export { type ResolveRouteFunction as R, type ResolvedRouteResult as a, resolveRouteFromCode as r };
@@ -0,0 +1,18 @@
1
+ import { RouteGetResponseEdgehancedComposition } from '@uniformdev/canvas';
2
+ import { PageState } from '@uniformdev/next-app-router-shared';
3
+ import { D as DataClient } from './client-BElN_CWD.mjs';
4
+
5
+ type ResolvedRouteResult = {
6
+ pageState: PageState;
7
+ route: RouteGetResponseEdgehancedComposition | undefined;
8
+ code: string;
9
+ };
10
+
11
+ type ResolveRouteFunction = (options: ResolveRouteFromCodeOptions) => Promise<ResolvedRouteResult>;
12
+ type ResolveRouteFromCodeOptions = {
13
+ code: string;
14
+ dataClient?: DataClient;
15
+ };
16
+ declare const resolveRouteFromCode: ResolveRouteFunction;
17
+
18
+ export { type ResolveRouteFunction as R, type ResolvedRouteResult as a, resolveRouteFromCode as r };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/next-app-router",
3
- "version": "20.81.1-alpha.4.sha-de16ebeee7",
3
+ "version": "20.81.1",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "scripts": {
6
6
  "build": "tsup",
@@ -33,11 +33,6 @@
33
33
  "require": "./dist/middleware.js",
34
34
  "import": "./dist/middleware.mjs"
35
35
  },
36
- "./edge": {
37
- "types": "./dist/edge.d.ts",
38
- "require": "./dist/edge.js",
39
- "import": "./dist/edge.mjs"
40
- },
41
36
  "./component": {
42
37
  "types": "./dist/component.d.ts",
43
38
  "require": "./dist/component.js",
@@ -73,9 +68,6 @@
73
68
  "middleware": [
74
69
  "./dist/middleware.d.ts"
75
70
  ],
76
- "edge": [
77
- "./dist/edge.d.ts"
78
- ],
79
71
  "component": [
80
72
  "./dist/component.d.ts"
81
73
  ],
@@ -100,7 +92,6 @@
100
92
  "@types/node": "26.0.0",
101
93
  "@types/react": "19.2.17",
102
94
  "@types/react-dom": "19.2.3",
103
- "@uniformdev/context-edge": "20.81.1-alpha.4.sha-de16ebeee7",
104
95
  "next": "16.3.1",
105
96
  "react": "19.2.1",
106
97
  "react-dom": "19.2.1",
@@ -109,13 +100,13 @@
109
100
  "vitest": "4.1.11"
110
101
  },
111
102
  "dependencies": {
112
- "@uniformdev/canvas-react": "20.81.1-alpha.4.sha-de16ebeee7",
113
- "@uniformdev/context": "20.81.1-alpha.4.sha-de16ebeee7",
114
- "@uniformdev/next-app-router-client": "20.81.1-alpha.4.sha-de16ebeee7",
115
- "@uniformdev/next-app-router-shared": "20.81.1-alpha.4.sha-de16ebeee7",
116
- "@uniformdev/redirect": "20.81.1-alpha.4.sha-de16ebeee7",
117
- "@uniformdev/richtext": "20.81.1-alpha.4.sha-de16ebeee7",
118
- "@uniformdev/webhooks": "20.81.1-alpha.4.sha-de16ebeee7",
103
+ "@uniformdev/canvas-react": "20.81.1",
104
+ "@uniformdev/next-app-router-client": "20.81.1",
105
+ "@uniformdev/next-app-router-shared": "20.81.1",
106
+ "@uniformdev/redirect": "20.81.1",
107
+ "@uniformdev/richtext": "20.81.1",
108
+ "@uniformdev/webhooks": "20.81.1",
109
+ "@vercel/functions": "^3.7.2",
119
110
  "encoding": "^0.1.13",
120
111
  "server-only": "^0.0.1",
121
112
  "svix": "^1.96.0"
@@ -124,18 +115,12 @@
124
115
  "node": ">=20.9.0"
125
116
  },
126
117
  "peerDependencies": {
127
- "@uniformdev/context-edge": "workspace:^",
128
118
  "next": ">=16.0.7",
129
119
  "react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0",
130
120
  "react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0"
131
121
  },
132
- "peerDependenciesMeta": {
133
- "@uniformdev/context-edge": {
134
- "optional": true
135
- }
136
- },
137
122
  "publishConfig": {
138
123
  "access": "public"
139
124
  },
140
- "gitHead": "de16ebeee7fd971c982b73bd7ad39cc6a87abf2f"
125
+ "gitHead": "73cf963a1b767c5372ba815e7f1657df7920ab5f"
141
126
  }
package/dist/edge.d.mts DELETED
@@ -1,44 +0,0 @@
1
- import { ManifestV2 } from '@uniformdev/context';
2
- import { TransformEdgeStreamOptions } from '@uniformdev/context-edge';
3
- import { NextRequest } from 'next/server';
4
- import { HandleOptions } from './middleware.mjs';
5
- import '@uniformdev/next-app-router-shared';
6
-
7
- /**
8
- * Marks the edge middleware's own fetch of the rendered page, so the middleware lets it through
9
- * when the matcher also covers the rewrite destination.
10
- */
11
- declare const UNIFORM_EDGE_ORIGIN_HEADER = "x-uniform-edge-origin";
12
- type UniformEdgeMiddlewareOptions = HandleOptions & {
13
- /**
14
- * The project's Context manifest, which chooses the visitor's variants. Bake it into the build
15
- * (for example with `uniform context manifest download`) so the middleware makes no network
16
- * calls. Variants for signals published after the build are chosen in the browser.
17
- */
18
- manifest: ManifestV2;
19
- /**
20
- * Called when the NESI transform fails. Receives the error and, when available, the decoded
21
- * HTML chunk that triggered it. The response keeps streaming the untransformed HTML.
22
- */
23
- onError?: TransformEdgeStreamOptions['onError'];
24
- };
25
- /**
26
- * Returns middleware that rewrites each request to its Uniform code like `uniformMiddleware`, and
27
- * processes the NESI tags in the page at the edge. HTML document requests fetch the page rendered
28
- * for the route's code and keep only the visitor's variants from the tags it contains, which
29
- * `UniformComposition` renders for published personalizations and tests when `edgeMode` is enabled
30
- * in `uniform.server.config`. Client navigations, prefetches and draft requests are rewritten, and
31
- * their variants are chosen in the browser.
32
- *
33
- * Requires the optional peer dependency `@uniformdev/context-edge`.
34
- */
35
- declare const uniformEdgeMiddleware: (options: UniformEdgeMiddlewareOptions) => (request: NextRequest) => Promise<Response>;
36
- /**
37
- * Handles one request the way {@link uniformEdgeMiddleware} does. The transformed response is
38
- * personalized, so it is marked `private, no-store`.
39
- */
40
- declare const handleUniformEdgeRoute: ({ request, manifest, onError, ...options }: UniformEdgeMiddlewareOptions & {
41
- request: NextRequest;
42
- }) => Promise<Response>;
43
-
44
- export { UNIFORM_EDGE_ORIGIN_HEADER, type UniformEdgeMiddlewareOptions, handleUniformEdgeRoute, uniformEdgeMiddleware };
package/dist/edge.d.ts DELETED
@@ -1,44 +0,0 @@
1
- import { ManifestV2 } from '@uniformdev/context';
2
- import { TransformEdgeStreamOptions } from '@uniformdev/context-edge';
3
- import { NextRequest } from 'next/server';
4
- import { HandleOptions } from './middleware.js';
5
- import '@uniformdev/next-app-router-shared';
6
-
7
- /**
8
- * Marks the edge middleware's own fetch of the rendered page, so the middleware lets it through
9
- * when the matcher also covers the rewrite destination.
10
- */
11
- declare const UNIFORM_EDGE_ORIGIN_HEADER = "x-uniform-edge-origin";
12
- type UniformEdgeMiddlewareOptions = HandleOptions & {
13
- /**
14
- * The project's Context manifest, which chooses the visitor's variants. Bake it into the build
15
- * (for example with `uniform context manifest download`) so the middleware makes no network
16
- * calls. Variants for signals published after the build are chosen in the browser.
17
- */
18
- manifest: ManifestV2;
19
- /**
20
- * Called when the NESI transform fails. Receives the error and, when available, the decoded
21
- * HTML chunk that triggered it. The response keeps streaming the untransformed HTML.
22
- */
23
- onError?: TransformEdgeStreamOptions['onError'];
24
- };
25
- /**
26
- * Returns middleware that rewrites each request to its Uniform code like `uniformMiddleware`, and
27
- * processes the NESI tags in the page at the edge. HTML document requests fetch the page rendered
28
- * for the route's code and keep only the visitor's variants from the tags it contains, which
29
- * `UniformComposition` renders for published personalizations and tests when `edgeMode` is enabled
30
- * in `uniform.server.config`. Client navigations, prefetches and draft requests are rewritten, and
31
- * their variants are chosen in the browser.
32
- *
33
- * Requires the optional peer dependency `@uniformdev/context-edge`.
34
- */
35
- declare const uniformEdgeMiddleware: (options: UniformEdgeMiddlewareOptions) => (request: NextRequest) => Promise<Response>;
36
- /**
37
- * Handles one request the way {@link uniformEdgeMiddleware} does. The transformed response is
38
- * personalized, so it is marked `private, no-store`.
39
- */
40
- declare const handleUniformEdgeRoute: ({ request, manifest, onError, ...options }: UniformEdgeMiddlewareOptions & {
41
- request: NextRequest;
42
- }) => Promise<Response>;
43
-
44
- export { UNIFORM_EDGE_ORIGIN_HEADER, type UniformEdgeMiddlewareOptions, handleUniformEdgeRoute, uniformEdgeMiddleware };