@valbuild/next 0.135.0 → 0.136.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.
- package/CHANGELOG.md +53 -0
- package/dist/declarations/src/rsc/initValRsc.d.ts +52 -6
- package/dist/valbuild-next.cjs.dev.js +1 -1
- package/dist/valbuild-next.cjs.prod.js +1 -1
- package/dist/valbuild-next.esm.js +1 -1
- package/dist/{version-58fd6989.cjs.prod.js → version-52797e16.cjs.prod.js} +1 -1
- package/dist/{version-12fffb44.esm.js → version-b626279e.esm.js} +1 -1
- package/dist/{version-77226c0a.cjs.dev.js → version-f31c6541.cjs.dev.js} +1 -1
- package/package.json +8 -8
- package/rsc/dist/valbuild-next-rsc.cjs.dev.js +374 -254
- package/rsc/dist/valbuild-next-rsc.cjs.prod.js +374 -254
- package/rsc/dist/valbuild-next-rsc.esm.js +375 -255
- package/server/dist/valbuild-next-server.cjs.dev.js +1 -1
- package/server/dist/valbuild-next-server.cjs.prod.js +1 -1
- package/server/dist/valbuild-next-server.esm.js +1 -1
|
@@ -1,121 +1,250 @@
|
|
|
1
1
|
import 'server-only';
|
|
2
2
|
import { i as initValRouteFromVal, g as getJsonEntryStegaRoot, a as isJsonValuesRecordSchema, b as getValRouteUrlFromVal, _ as _typeof } from '../../dist/routeFromVal-544e8318.esm.js';
|
|
3
|
+
import { _ as _defineProperty } from '../../dist/defineProperty-cca5affa.esm.js';
|
|
3
4
|
import { _ as _objectSpread2 } from '../../dist/objectSpread2-60d1bd93.esm.js';
|
|
4
5
|
import { _ as _asyncToGenerator, a as _regenerator } from '../../dist/asyncToGenerator-500f022f.esm.js';
|
|
5
|
-
import { _ as _defineProperty } from '../../dist/defineProperty-cca5affa.esm.js';
|
|
6
6
|
import { SET_RSC, stegaEncode, SET_AUTO_TAG_JSX_ENABLED } from '@valbuild/react/stega';
|
|
7
7
|
import { Internal } from '@valbuild/core';
|
|
8
|
-
import {
|
|
8
|
+
import { cache } from 'react';
|
|
9
|
+
import { VAL_SESSION_COOKIE, memoizePerRequest } from '@valbuild/shared/internal';
|
|
9
10
|
import { createValServer } from '@valbuild/server';
|
|
10
|
-
import { V as VERSION } from '../../dist/version-
|
|
11
|
+
import { V as VERSION } from '../../dist/version-b626279e.esm.js';
|
|
11
12
|
import '../../dist/createForOfIteratorHelper-5758a730.esm.js';
|
|
12
13
|
import '../../dist/unsupportedIterableToArray-5baabfdc.esm.js';
|
|
13
14
|
import '../../dist/slicedToArray-aa291011.esm.js';
|
|
14
15
|
import '@valbuild/shared/client';
|
|
15
16
|
|
|
16
17
|
SET_RSC(true);
|
|
17
|
-
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The `modules` map every `fetchVal` in one render shares.
|
|
21
|
+
*
|
|
22
|
+
* Derived from the route's own response type rather than restated, so it cannot
|
|
23
|
+
* drift from what `/sources/~` actually returns.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The slice of `ValServer` the draft-sources reader uses.
|
|
28
|
+
*
|
|
29
|
+
* Narrower than `ValServer` for the same reason `JsonEntryValServer` below is:
|
|
30
|
+
* it says what the dependency IS, and it lets a test drive the reader with a
|
|
31
|
+
* one-route fake instead of casting a partial object to the whole server type.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/** What the route readers need: the tree, plus the single-entry route. */
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Where the reader gets its per-request memo box.
|
|
38
|
+
*
|
|
39
|
+
* Injected rather than reached for, so that "this reader needs a request to
|
|
40
|
+
* scope its cache to" is part of its contract and a test can supply a scope it
|
|
41
|
+
* controls — in jest, React's non-`react-server` build makes `cache` a
|
|
42
|
+
* pass-through, so the real wiring memoises nothing there.
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* A per-request memo box, from React's request memoisation.
|
|
47
|
+
*
|
|
48
|
+
* `cache()` is what makes this safe: in an RSC render React hands back the SAME
|
|
49
|
+
* object for the length of one request and a fresh one for the next. Outside
|
|
50
|
+
* that — a route handler, a test, the non-`react-server` build of React —
|
|
51
|
+
* `cache` is a pass-through, so every call gets its own object, the memo misses,
|
|
52
|
+
* and the reader does exactly what it did before. Ineffective, never shared.
|
|
53
|
+
* See `memoizePerRequest`. `fetchVal` is an RSC API (`SET_RSC(true)` above, and
|
|
54
|
+
* its own error messages say so), so the effective case is the normal one.
|
|
55
|
+
*
|
|
56
|
+
* Built PER `initValRsc` rather than once for the module, because the box is
|
|
57
|
+
* only as specific as the `cache()` it came from: two Val servers in one
|
|
58
|
+
* process sharing one would answer each other's reads within a request, and
|
|
59
|
+
* they hold different content.
|
|
60
|
+
*/
|
|
61
|
+
function createReactCacheScope() {
|
|
62
|
+
var getBox = cache(function () {
|
|
63
|
+
return {};
|
|
64
|
+
});
|
|
65
|
+
return /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
66
|
+
return _regenerator().w(function (_context) {
|
|
67
|
+
while (1) switch (_context.n) {
|
|
68
|
+
case 0:
|
|
69
|
+
return _context.a(2, getBox());
|
|
70
|
+
}
|
|
71
|
+
}, _callee);
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* ONE read of the whole module tree, for the session in `sessionCookie`.
|
|
77
|
+
*
|
|
78
|
+
* `path` stays `"/"` on purpose, and the measurement is why. `/sources/~`
|
|
79
|
+
* evaluates, previews and validates EVERY module and only THEN filters the
|
|
80
|
+
* response by `req.path` (the two TODOs in `ValServer.ts` say so), so narrowing
|
|
81
|
+
* the path shrinks the answer and changes the work not at all: on a 60-module
|
|
82
|
+
* project, `path: "/"` took 53.6ms and a single-module path 53.5ms. And this is
|
|
83
|
+
* an in-process call rather than a round trip, so the object it builds is never
|
|
84
|
+
* serialised or sent anywhere — the bytes it saves are not bytes anyone pays
|
|
85
|
+
* for. Narrowing would also give each caller a different answer to cache, which
|
|
86
|
+
* is what would cost the saving that IS real (2.7x on the same project).
|
|
87
|
+
*
|
|
88
|
+
* `draftRead.perf.test.ts` prints both numbers; re-run it before believing
|
|
89
|
+
* anything different.
|
|
90
|
+
*
|
|
91
|
+
* Returns `null` when the session is not one the server accepts; the caller
|
|
92
|
+
* then renders published content, which is what it did before.
|
|
93
|
+
*/
|
|
94
|
+
function loadDraftSources(_x, _x2) {
|
|
95
|
+
return _loadDraftSources.apply(this, arguments);
|
|
96
|
+
}
|
|
97
|
+
function _loadDraftSources() {
|
|
98
|
+
_loadDraftSources = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee18(valServerPromise, sessionCookie) {
|
|
99
|
+
var valServer, treeRes;
|
|
100
|
+
return _regenerator().w(function (_context18) {
|
|
101
|
+
while (1) switch (_context18.n) {
|
|
102
|
+
case 0:
|
|
103
|
+
_context18.n = 1;
|
|
104
|
+
return valServerPromise;
|
|
105
|
+
case 1:
|
|
106
|
+
valServer = _context18.v;
|
|
107
|
+
_context18.n = 2;
|
|
108
|
+
return valServer["/sources/~"]["PUT"]({
|
|
109
|
+
path: "/",
|
|
110
|
+
query: {
|
|
111
|
+
validate_sources: true,
|
|
112
|
+
validate_binary_files: false,
|
|
113
|
+
exclude_patches: false,
|
|
114
|
+
// RSC pre-render uses the legacy "server applies patches" path.
|
|
115
|
+
apply_patches: undefined,
|
|
116
|
+
/*
|
|
117
|
+
* The caller's own staged work, and nobody else's.
|
|
118
|
+
*
|
|
119
|
+
* A draft render cannot name its group ids — it has no client
|
|
120
|
+
* state — so it asks for "mine" and the server resolves them from
|
|
121
|
+
* the session. Without this a preview shows base + every pending
|
|
122
|
+
* patch on the branch, so one person's half-finished edit appears
|
|
123
|
+
* in another person's draft.
|
|
124
|
+
*
|
|
125
|
+
* `patch_id` stays `undefined`: naming an explicit list is for a
|
|
126
|
+
* caller that already knows what it wants, and it would override
|
|
127
|
+
* the resolution rather than intersect with it.
|
|
128
|
+
*/
|
|
129
|
+
patch_id: undefined,
|
|
130
|
+
own_patch_groups_only: true
|
|
131
|
+
},
|
|
132
|
+
cookies: _defineProperty({}, VAL_SESSION_COOKIE, sessionCookie)
|
|
133
|
+
});
|
|
134
|
+
case 2:
|
|
135
|
+
treeRes = _context18.v;
|
|
136
|
+
if (!(treeRes.status === 200)) {
|
|
137
|
+
_context18.n = 3;
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
return _context18.a(2, treeRes.json.modules);
|
|
141
|
+
case 3:
|
|
142
|
+
if (!(treeRes.status === 401)) {
|
|
143
|
+
_context18.n = 4;
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
console.warn("Val: authentication error: ", treeRes.json.message);
|
|
147
|
+
return _context18.a(2, null);
|
|
148
|
+
case 4:
|
|
149
|
+
throw Error(JSON.stringify(treeRes.json, null, 2));
|
|
150
|
+
case 5:
|
|
151
|
+
return _context18.a(2);
|
|
152
|
+
}
|
|
153
|
+
}, _callee18);
|
|
154
|
+
}));
|
|
155
|
+
return _loadDraftSources.apply(this, arguments);
|
|
156
|
+
}
|
|
157
|
+
var initFetchValStega = function initFetchValStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies, getDraftSourcesScope) {
|
|
18
158
|
return function (selector) {
|
|
19
159
|
var exec = /*#__PURE__*/function () {
|
|
20
|
-
var
|
|
21
|
-
var enabled, headers, cookies, host, _cookies,
|
|
22
|
-
return _regenerator().w(function (
|
|
23
|
-
while (1) switch (
|
|
160
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
161
|
+
var enabled, headers, cookies, host, _cookies, sessionCookie, modules, _t, _t2, _t3, _t4;
|
|
162
|
+
return _regenerator().w(function (_context2) {
|
|
163
|
+
while (1) switch (_context2.p = _context2.n) {
|
|
24
164
|
case 0:
|
|
25
165
|
enabled = false;
|
|
26
|
-
|
|
27
|
-
|
|
166
|
+
_context2.p = 1;
|
|
167
|
+
_context2.n = 2;
|
|
28
168
|
return isEnabled();
|
|
29
169
|
case 2:
|
|
30
|
-
enabled =
|
|
31
|
-
|
|
170
|
+
enabled = _context2.v;
|
|
171
|
+
_context2.n = 4;
|
|
32
172
|
break;
|
|
33
173
|
case 3:
|
|
34
|
-
|
|
35
|
-
_t =
|
|
174
|
+
_context2.p = 3;
|
|
175
|
+
_t = _context2.v;
|
|
36
176
|
console.error("Val: could not check if Val is enabled! This might be due to an error to check draftMode. fetchVal can only be used server-side. Use useVal on clients.", _t);
|
|
37
177
|
case 4:
|
|
38
178
|
if (!enabled) {
|
|
39
|
-
|
|
179
|
+
_context2.n = 15;
|
|
40
180
|
break;
|
|
41
181
|
}
|
|
42
182
|
SET_AUTO_TAG_JSX_ENABLED(true);
|
|
43
|
-
|
|
44
|
-
|
|
183
|
+
_context2.p = 5;
|
|
184
|
+
_context2.n = 6;
|
|
45
185
|
return getHeaders();
|
|
46
186
|
case 6:
|
|
47
|
-
headers =
|
|
187
|
+
headers = _context2.v;
|
|
48
188
|
if (!(typeof headers.get !== "function")) {
|
|
49
|
-
|
|
189
|
+
_context2.n = 7;
|
|
50
190
|
break;
|
|
51
191
|
}
|
|
52
192
|
throw new Error("Invalid headers");
|
|
53
193
|
case 7:
|
|
54
|
-
|
|
194
|
+
_context2.n = 9;
|
|
55
195
|
break;
|
|
56
196
|
case 8:
|
|
57
|
-
|
|
58
|
-
_t2 =
|
|
197
|
+
_context2.p = 8;
|
|
198
|
+
_t2 = _context2.v;
|
|
59
199
|
console.error("Val: could not read headers! fetchVal can only be used server-side. Use useVal on clients.", _t2);
|
|
60
200
|
headers = null;
|
|
61
201
|
case 9:
|
|
62
|
-
|
|
63
|
-
|
|
202
|
+
_context2.p = 9;
|
|
203
|
+
_context2.n = 10;
|
|
64
204
|
return getCookies();
|
|
65
205
|
case 10:
|
|
66
|
-
cookies =
|
|
67
|
-
|
|
206
|
+
cookies = _context2.v;
|
|
207
|
+
_context2.n = 12;
|
|
68
208
|
break;
|
|
69
209
|
case 11:
|
|
70
|
-
|
|
71
|
-
_t3 =
|
|
210
|
+
_context2.p = 11;
|
|
211
|
+
_t3 = _context2.v;
|
|
72
212
|
console.error("Val: could not read cookies! fetchVal can only be used server-side. Use useVal on clients.", _t3);
|
|
73
213
|
cookies = null;
|
|
74
214
|
case 12:
|
|
75
215
|
host = headers && getHost(headers);
|
|
76
216
|
if (!(host && cookies)) {
|
|
77
|
-
|
|
217
|
+
_context2.n = 15;
|
|
78
218
|
break;
|
|
79
219
|
}
|
|
80
|
-
|
|
81
|
-
|
|
220
|
+
sessionCookie = (_cookies = cookies) === null || _cookies === void 0 || (_cookies = _cookies.get(VAL_SESSION_COOKIE)) === null || _cookies === void 0 ? void 0 : _cookies.value;
|
|
221
|
+
/*
|
|
222
|
+
* Once per request, however many times the page reads.
|
|
223
|
+
*
|
|
224
|
+
* Every `fetchVal` in one render asks the same question — same query,
|
|
225
|
+
* same session — so the second and third answer were identical and
|
|
226
|
+
* cost the same as the first. `fetchValRouteUrl` made that worse by
|
|
227
|
+
* calling `fetchVal` again on top of the caller's own.
|
|
228
|
+
*
|
|
229
|
+
* The key is the session, so a box that somehow outlived its request
|
|
230
|
+
* misses rather than serving another author's draft. See
|
|
231
|
+
* `memoizePerRequest`.
|
|
232
|
+
*/
|
|
233
|
+
_t4 = memoizePerRequest;
|
|
234
|
+
_context2.n = 13;
|
|
235
|
+
return getDraftSourcesScope();
|
|
82
236
|
case 13:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
path: "/",
|
|
87
|
-
query: {
|
|
88
|
-
validate_sources: true,
|
|
89
|
-
validate_binary_files: false,
|
|
90
|
-
exclude_patches: false,
|
|
91
|
-
// RSC pre-render uses the legacy "server applies patches" path.
|
|
92
|
-
apply_patches: undefined,
|
|
93
|
-
/*
|
|
94
|
-
* The caller's own staged work, and nobody else's.
|
|
95
|
-
*
|
|
96
|
-
* A draft render cannot name its group ids — it has no client
|
|
97
|
-
* state — so it asks for "mine" and the server resolves them from
|
|
98
|
-
* the session. Without this a preview shows base + every pending
|
|
99
|
-
* patch on the branch, so one person's half-finished edit appears
|
|
100
|
-
* in another person's draft.
|
|
101
|
-
*
|
|
102
|
-
* `patch_id` stays `undefined`: naming an explicit list is for a
|
|
103
|
-
* caller that already knows what it wants, and it would override
|
|
104
|
-
* the resolution rather than intersect with it.
|
|
105
|
-
*/
|
|
106
|
-
patch_id: undefined,
|
|
107
|
-
own_patch_groups_only: true
|
|
108
|
-
},
|
|
109
|
-
cookies: _defineProperty({}, VAL_SESSION_COOKIE, (_cookies = cookies) === null || _cookies === void 0 || (_cookies = _cookies.get(VAL_SESSION_COOKIE)) === null || _cookies === void 0 ? void 0 : _cookies.value)
|
|
237
|
+
_context2.n = 14;
|
|
238
|
+
return _t4(_context2.v, sessionCookie !== null && sessionCookie !== void 0 ? sessionCookie : "", function () {
|
|
239
|
+
return loadDraftSources(valServerPromise, sessionCookie);
|
|
110
240
|
});
|
|
111
241
|
case 14:
|
|
112
|
-
|
|
113
|
-
if (!
|
|
114
|
-
|
|
242
|
+
modules = _context2.v;
|
|
243
|
+
if (!modules) {
|
|
244
|
+
_context2.n = 15;
|
|
115
245
|
break;
|
|
116
246
|
}
|
|
117
|
-
|
|
118
|
-
return _context.a(2, stegaEncode(selector, {
|
|
247
|
+
return _context2.a(2, stegaEncode(selector, {
|
|
119
248
|
disabled: !enabled,
|
|
120
249
|
getModule: function getModule(path) {
|
|
121
250
|
var module = modules[path];
|
|
@@ -125,24 +254,14 @@ var initFetchValStega = function initFetchValStega(config, valApiEndpoints, valS
|
|
|
125
254
|
}
|
|
126
255
|
}));
|
|
127
256
|
case 15:
|
|
128
|
-
|
|
129
|
-
_context.n = 16;
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
console.warn("Val: authentication error: ", treeRes.json.message);
|
|
133
|
-
_context.n = 17;
|
|
134
|
-
break;
|
|
135
|
-
case 16:
|
|
136
|
-
throw Error(JSON.stringify(treeRes.json, null, 2));
|
|
137
|
-
case 17:
|
|
138
|
-
return _context.a(2, stegaEncode(selector, {
|
|
257
|
+
return _context2.a(2, stegaEncode(selector, {
|
|
139
258
|
disabled: !enabled
|
|
140
259
|
}));
|
|
141
260
|
}
|
|
142
|
-
},
|
|
261
|
+
}, _callee2, null, [[9, 11], [5, 8], [1, 3]]);
|
|
143
262
|
}));
|
|
144
263
|
return function exec() {
|
|
145
|
-
return
|
|
264
|
+
return _ref2.apply(this, arguments);
|
|
146
265
|
};
|
|
147
266
|
}();
|
|
148
267
|
return exec()["catch"](function (err) {
|
|
@@ -192,17 +311,17 @@ function getHost(headers) {
|
|
|
192
311
|
// }
|
|
193
312
|
// }
|
|
194
313
|
|
|
195
|
-
var initFetchValRouteStega = function initFetchValRouteStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies) {
|
|
314
|
+
var initFetchValRouteStega = function initFetchValRouteStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies, getDraftSourcesScope) {
|
|
196
315
|
return /*#__PURE__*/function () {
|
|
197
|
-
var
|
|
198
|
-
var resolvedParams, valModule, path, schema, source, url, enabled, draft, content, fetchVal, val, route,
|
|
199
|
-
return _regenerator().w(function (
|
|
200
|
-
while (1) switch (
|
|
316
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(selector, params) {
|
|
317
|
+
var resolvedParams, valModule, path, schema, source, url, enabled, draft, content, fetchVal, val, route, _t6;
|
|
318
|
+
return _regenerator().w(function (_context3) {
|
|
319
|
+
while (1) switch (_context3.p = _context3.n) {
|
|
201
320
|
case 0:
|
|
202
|
-
|
|
321
|
+
_context3.n = 1;
|
|
203
322
|
return Promise.resolve(params);
|
|
204
323
|
case 1:
|
|
205
|
-
resolvedParams =
|
|
324
|
+
resolvedParams = _context3.v;
|
|
206
325
|
// A view is a pointer: everything below reads a path, a schema and a source
|
|
207
326
|
// off this, and a pointer has none of them. See `resolveViewedModule`.
|
|
208
327
|
valModule = Internal.resolveViewedModule(selector);
|
|
@@ -211,78 +330,78 @@ var initFetchValRouteStega = function initFetchValRouteStega(config, valApiEndpo
|
|
|
211
330
|
// entry's backing `*.val.json`, instead of eagerly resolving the whole
|
|
212
331
|
// record via `fetchVal`.
|
|
213
332
|
if (!isJsonValuesRecordSchema(schema)) {
|
|
214
|
-
|
|
333
|
+
_context3.n = 11;
|
|
215
334
|
break;
|
|
216
335
|
}
|
|
217
336
|
source = valModule && Internal.getSource(valModule);
|
|
218
337
|
url = getValRouteUrlFromVal(resolvedParams, "fetchValRoute", path, schema, source);
|
|
219
338
|
if (url) {
|
|
220
|
-
|
|
339
|
+
_context3.n = 2;
|
|
221
340
|
break;
|
|
222
341
|
}
|
|
223
|
-
return
|
|
342
|
+
return _context3.a(2, null);
|
|
224
343
|
case 2:
|
|
225
344
|
enabled = false;
|
|
226
|
-
|
|
227
|
-
|
|
345
|
+
_context3.p = 3;
|
|
346
|
+
_context3.n = 4;
|
|
228
347
|
return isEnabled();
|
|
229
348
|
case 4:
|
|
230
|
-
enabled =
|
|
231
|
-
|
|
349
|
+
enabled = _context3.v;
|
|
350
|
+
_context3.n = 6;
|
|
232
351
|
break;
|
|
233
352
|
case 5:
|
|
234
|
-
|
|
235
|
-
|
|
353
|
+
_context3.p = 5;
|
|
354
|
+
_context3.v;
|
|
236
355
|
case 6:
|
|
237
356
|
draft = {
|
|
238
357
|
status: "unavailable"
|
|
239
358
|
};
|
|
240
359
|
if (!(enabled && path)) {
|
|
241
|
-
|
|
360
|
+
_context3.n = 8;
|
|
242
361
|
break;
|
|
243
362
|
}
|
|
244
363
|
SET_AUTO_TAG_JSX_ENABLED(true);
|
|
245
|
-
|
|
364
|
+
_context3.n = 7;
|
|
246
365
|
return loadDraftJsonEntry(valServerPromise, getCookies, path, url);
|
|
247
366
|
case 7:
|
|
248
|
-
draft =
|
|
367
|
+
draft = _context3.v;
|
|
249
368
|
case 8:
|
|
250
|
-
|
|
369
|
+
_context3.n = 9;
|
|
251
370
|
return resolveDraftOrCommittedEntry(draft, function () {
|
|
252
371
|
return loadJsonEntryContent(source, url);
|
|
253
372
|
});
|
|
254
373
|
case 9:
|
|
255
|
-
content =
|
|
374
|
+
content = _context3.v;
|
|
256
375
|
if (!(content === undefined)) {
|
|
257
|
-
|
|
376
|
+
_context3.n = 10;
|
|
258
377
|
break;
|
|
259
378
|
}
|
|
260
|
-
return
|
|
379
|
+
return _context3.a(2, null);
|
|
261
380
|
case 10:
|
|
262
|
-
return
|
|
381
|
+
return _context3.a(2, stegaEncode(content, {
|
|
263
382
|
disabled: !enabled,
|
|
264
383
|
root: getJsonEntryStegaRoot(valModule, url)
|
|
265
384
|
}));
|
|
266
385
|
case 11:
|
|
267
|
-
fetchVal = initFetchValStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies);
|
|
268
|
-
|
|
269
|
-
if (!
|
|
270
|
-
|
|
386
|
+
fetchVal = initFetchValStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies, getDraftSourcesScope);
|
|
387
|
+
_t6 = valModule;
|
|
388
|
+
if (!_t6) {
|
|
389
|
+
_context3.n = 13;
|
|
271
390
|
break;
|
|
272
391
|
}
|
|
273
|
-
|
|
392
|
+
_context3.n = 12;
|
|
274
393
|
return fetchVal(valModule);
|
|
275
394
|
case 12:
|
|
276
|
-
|
|
395
|
+
_t6 = _context3.v;
|
|
277
396
|
case 13:
|
|
278
|
-
val =
|
|
397
|
+
val = _t6;
|
|
279
398
|
route = initValRouteFromVal(resolvedParams, "fetchValRoute", path, schema, val);
|
|
280
|
-
return
|
|
399
|
+
return _context3.a(2, route);
|
|
281
400
|
}
|
|
282
|
-
},
|
|
401
|
+
}, _callee3, null, [[3, 5]]);
|
|
283
402
|
}));
|
|
284
|
-
return function (
|
|
285
|
-
return
|
|
403
|
+
return function (_x3, _x4) {
|
|
404
|
+
return _ref3.apply(this, arguments);
|
|
286
405
|
};
|
|
287
406
|
}();
|
|
288
407
|
};
|
|
@@ -292,7 +411,7 @@ var initFetchValRouteStega = function initFetchValRouteStega(config, valApiEndpo
|
|
|
292
411
|
* source markers (one dynamic import). Returns `undefined` when the key is
|
|
293
412
|
* missing or its marker has no runtime thunk (transport marker / draft entry).
|
|
294
413
|
*/
|
|
295
|
-
function loadJsonEntryContent(
|
|
414
|
+
function loadJsonEntryContent(_x5, _x6) {
|
|
296
415
|
return _loadJsonEntryContent.apply(this, arguments);
|
|
297
416
|
}
|
|
298
417
|
/**
|
|
@@ -317,37 +436,37 @@ function loadJsonEntryContent(_x3, _x4) {
|
|
|
317
436
|
* to the whole server type.
|
|
318
437
|
*/
|
|
319
438
|
function _loadJsonEntryContent() {
|
|
320
|
-
_loadJsonEntryContent = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
439
|
+
_loadJsonEntryContent = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee19(source, key) {
|
|
321
440
|
var marker, thunk;
|
|
322
|
-
return _regenerator().w(function (
|
|
323
|
-
while (1) switch (
|
|
441
|
+
return _regenerator().w(function (_context19) {
|
|
442
|
+
while (1) switch (_context19.n) {
|
|
324
443
|
case 0:
|
|
325
444
|
if (!(!source || _typeof(source) !== "object")) {
|
|
326
|
-
|
|
445
|
+
_context19.n = 1;
|
|
327
446
|
break;
|
|
328
447
|
}
|
|
329
|
-
return
|
|
448
|
+
return _context19.a(2, undefined);
|
|
330
449
|
case 1:
|
|
331
450
|
marker = source[key];
|
|
332
451
|
if (Internal.isJson(marker)) {
|
|
333
|
-
|
|
452
|
+
_context19.n = 2;
|
|
334
453
|
break;
|
|
335
454
|
}
|
|
336
|
-
return
|
|
455
|
+
return _context19.a(2, undefined);
|
|
337
456
|
case 2:
|
|
338
457
|
thunk = Internal.getJsonImport(marker);
|
|
339
458
|
if (thunk) {
|
|
340
|
-
|
|
459
|
+
_context19.n = 3;
|
|
341
460
|
break;
|
|
342
461
|
}
|
|
343
|
-
return
|
|
462
|
+
return _context19.a(2, undefined);
|
|
344
463
|
case 3:
|
|
345
|
-
|
|
464
|
+
_context19.n = 4;
|
|
346
465
|
return thunk();
|
|
347
466
|
case 4:
|
|
348
|
-
return
|
|
467
|
+
return _context19.a(2, _context19.v["default"]);
|
|
349
468
|
}
|
|
350
|
-
},
|
|
469
|
+
}, _callee19);
|
|
351
470
|
}));
|
|
352
471
|
return _loadJsonEntryContent.apply(this, arguments);
|
|
353
472
|
}
|
|
@@ -360,33 +479,33 @@ function _loadJsonEntryContent() {
|
|
|
360
479
|
* ask). Returning `undefined` means "render nothing"; both callers turn that into
|
|
361
480
|
* a null/undefined result.
|
|
362
481
|
*/
|
|
363
|
-
function resolveDraftOrCommittedEntry(
|
|
482
|
+
function resolveDraftOrCommittedEntry(_x7, _x8) {
|
|
364
483
|
return _resolveDraftOrCommittedEntry.apply(this, arguments);
|
|
365
484
|
}
|
|
366
485
|
function _resolveDraftOrCommittedEntry() {
|
|
367
|
-
_resolveDraftOrCommittedEntry = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
368
|
-
return _regenerator().w(function (
|
|
369
|
-
while (1) switch (
|
|
486
|
+
_resolveDraftOrCommittedEntry = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee20(draft, loadCommitted) {
|
|
487
|
+
return _regenerator().w(function (_context20) {
|
|
488
|
+
while (1) switch (_context20.n) {
|
|
370
489
|
case 0:
|
|
371
490
|
if (!(draft.status === "content")) {
|
|
372
|
-
|
|
491
|
+
_context20.n = 1;
|
|
373
492
|
break;
|
|
374
493
|
}
|
|
375
|
-
return
|
|
494
|
+
return _context20.a(2, draft.content);
|
|
376
495
|
case 1:
|
|
377
496
|
if (!(draft.status === "absent")) {
|
|
378
|
-
|
|
497
|
+
_context20.n = 2;
|
|
379
498
|
break;
|
|
380
499
|
}
|
|
381
|
-
return
|
|
500
|
+
return _context20.a(2, undefined);
|
|
382
501
|
case 2:
|
|
383
|
-
return
|
|
502
|
+
return _context20.a(2, loadCommitted());
|
|
384
503
|
}
|
|
385
|
-
},
|
|
504
|
+
}, _callee20);
|
|
386
505
|
}));
|
|
387
506
|
return _resolveDraftOrCommittedEntry.apply(this, arguments);
|
|
388
507
|
}
|
|
389
|
-
function loadDraftJsonEntry(
|
|
508
|
+
function loadDraftJsonEntry(_x9, _x0, _x1, _x10) {
|
|
390
509
|
return _loadDraftJsonEntry.apply(this, arguments);
|
|
391
510
|
}
|
|
392
511
|
/**
|
|
@@ -401,31 +520,31 @@ function loadDraftJsonEntry(_x7, _x8, _x9, _x0) {
|
|
|
401
520
|
* the draft read yields nothing.
|
|
402
521
|
*/
|
|
403
522
|
function _loadDraftJsonEntry() {
|
|
404
|
-
_loadDraftJsonEntry = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
523
|
+
_loadDraftJsonEntry = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee21(valServerPromise, getCookies, moduleFilePath, key) {
|
|
405
524
|
var _cookies3;
|
|
406
525
|
var cookies, valServer, res;
|
|
407
|
-
return _regenerator().w(function (
|
|
408
|
-
while (1) switch (
|
|
526
|
+
return _regenerator().w(function (_context21) {
|
|
527
|
+
while (1) switch (_context21.p = _context21.n) {
|
|
409
528
|
case 0:
|
|
410
|
-
|
|
411
|
-
|
|
529
|
+
_context21.p = 0;
|
|
530
|
+
_context21.n = 1;
|
|
412
531
|
return getCookies();
|
|
413
532
|
case 1:
|
|
414
|
-
cookies =
|
|
415
|
-
|
|
533
|
+
cookies = _context21.v;
|
|
534
|
+
_context21.n = 3;
|
|
416
535
|
break;
|
|
417
536
|
case 2:
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
return
|
|
537
|
+
_context21.p = 2;
|
|
538
|
+
_context21.v;
|
|
539
|
+
return _context21.a(2, {
|
|
421
540
|
status: "unavailable"
|
|
422
541
|
});
|
|
423
542
|
case 3:
|
|
424
|
-
|
|
543
|
+
_context21.n = 4;
|
|
425
544
|
return valServerPromise;
|
|
426
545
|
case 4:
|
|
427
|
-
valServer =
|
|
428
|
-
|
|
546
|
+
valServer = _context21.v;
|
|
547
|
+
_context21.n = 5;
|
|
429
548
|
return valServer["/json"]["GET"]({
|
|
430
549
|
query: {
|
|
431
550
|
path: moduleFilePath,
|
|
@@ -448,60 +567,60 @@ function _loadDraftJsonEntry() {
|
|
|
448
567
|
cookies: _defineProperty({}, VAL_SESSION_COOKIE, (_cookies3 = cookies) === null || _cookies3 === void 0 || (_cookies3 = _cookies3.get(VAL_SESSION_COOKIE)) === null || _cookies3 === void 0 ? void 0 : _cookies3.value)
|
|
449
568
|
});
|
|
450
569
|
case 5:
|
|
451
|
-
res =
|
|
570
|
+
res = _context21.v;
|
|
452
571
|
if (!(res.status === 200 && "content" in res.json)) {
|
|
453
|
-
|
|
572
|
+
_context21.n = 6;
|
|
454
573
|
break;
|
|
455
574
|
}
|
|
456
|
-
return
|
|
575
|
+
return _context21.a(2, {
|
|
457
576
|
status: "content",
|
|
458
577
|
content: res.json.content
|
|
459
578
|
});
|
|
460
579
|
case 6:
|
|
461
580
|
if (!(res.status === 401)) {
|
|
462
|
-
|
|
581
|
+
_context21.n = 7;
|
|
463
582
|
break;
|
|
464
583
|
}
|
|
465
584
|
console.warn("Val: authentication error: ", res.json.message);
|
|
466
|
-
return
|
|
585
|
+
return _context21.a(2, {
|
|
467
586
|
status: "unavailable"
|
|
468
587
|
});
|
|
469
588
|
case 7:
|
|
470
589
|
if (!(res.status === 404)) {
|
|
471
|
-
|
|
590
|
+
_context21.n = 8;
|
|
472
591
|
break;
|
|
473
592
|
}
|
|
474
|
-
return
|
|
593
|
+
return _context21.a(2, {
|
|
475
594
|
status: "absent"
|
|
476
595
|
});
|
|
477
596
|
case 8:
|
|
478
597
|
console.error("Val: could not load draft JSON entry: ", "message" in res.json ? res.json.message : "status ".concat(res.status));
|
|
479
|
-
return
|
|
598
|
+
return _context21.a(2, {
|
|
480
599
|
status: "unavailable"
|
|
481
600
|
});
|
|
482
601
|
}
|
|
483
|
-
},
|
|
602
|
+
}, _callee21, null, [[0, 2]]);
|
|
484
603
|
}));
|
|
485
604
|
return _loadDraftJsonEntry.apply(this, arguments);
|
|
486
605
|
}
|
|
487
606
|
var initFetchValKeyStega = function initFetchValKeyStega(valServerPromise, isEnabled, getCookies) {
|
|
488
607
|
return /*#__PURE__*/function () {
|
|
489
|
-
var
|
|
608
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(selector, key) {
|
|
490
609
|
var enabled, valModule, source, moduleFilePath, draft, content;
|
|
491
|
-
return _regenerator().w(function (
|
|
492
|
-
while (1) switch (
|
|
610
|
+
return _regenerator().w(function (_context4) {
|
|
611
|
+
while (1) switch (_context4.p = _context4.n) {
|
|
493
612
|
case 0:
|
|
494
613
|
enabled = false;
|
|
495
|
-
|
|
496
|
-
|
|
614
|
+
_context4.p = 1;
|
|
615
|
+
_context4.n = 2;
|
|
497
616
|
return isEnabled();
|
|
498
617
|
case 2:
|
|
499
|
-
enabled =
|
|
500
|
-
|
|
618
|
+
enabled = _context4.v;
|
|
619
|
+
_context4.n = 4;
|
|
501
620
|
break;
|
|
502
621
|
case 3:
|
|
503
|
-
|
|
504
|
-
|
|
622
|
+
_context4.p = 3;
|
|
623
|
+
_context4.v;
|
|
505
624
|
case 4:
|
|
506
625
|
// A view is a pointer: everything below reads a path and a source off this,
|
|
507
626
|
// and a pointer has neither. See `resolveViewedModule`.
|
|
@@ -512,84 +631,84 @@ var initFetchValKeyStega = function initFetchValKeyStega(valServerPromise, isEna
|
|
|
512
631
|
status: "unavailable"
|
|
513
632
|
};
|
|
514
633
|
if (!(enabled && moduleFilePath)) {
|
|
515
|
-
|
|
634
|
+
_context4.n = 6;
|
|
516
635
|
break;
|
|
517
636
|
}
|
|
518
637
|
SET_AUTO_TAG_JSX_ENABLED(true);
|
|
519
|
-
|
|
638
|
+
_context4.n = 5;
|
|
520
639
|
return loadDraftJsonEntry(valServerPromise, getCookies, moduleFilePath, key);
|
|
521
640
|
case 5:
|
|
522
|
-
draft =
|
|
641
|
+
draft = _context4.v;
|
|
523
642
|
case 6:
|
|
524
|
-
|
|
643
|
+
_context4.n = 7;
|
|
525
644
|
return resolveDraftOrCommittedEntry(draft, function () {
|
|
526
645
|
return loadJsonEntryContent(source, key);
|
|
527
646
|
});
|
|
528
647
|
case 7:
|
|
529
|
-
content =
|
|
648
|
+
content = _context4.v;
|
|
530
649
|
if (!(content === undefined)) {
|
|
531
|
-
|
|
650
|
+
_context4.n = 8;
|
|
532
651
|
break;
|
|
533
652
|
}
|
|
534
|
-
return
|
|
653
|
+
return _context4.a(2, undefined);
|
|
535
654
|
case 8:
|
|
536
|
-
return
|
|
655
|
+
return _context4.a(2, stegaEncode(content, {
|
|
537
656
|
disabled: !enabled,
|
|
538
657
|
root: getJsonEntryStegaRoot(valModule, key)
|
|
539
658
|
}));
|
|
540
659
|
}
|
|
541
|
-
},
|
|
660
|
+
}, _callee4, null, [[1, 3]]);
|
|
542
661
|
}));
|
|
543
|
-
return function (
|
|
544
|
-
return
|
|
662
|
+
return function (_x11, _x12) {
|
|
663
|
+
return _ref4.apply(this, arguments);
|
|
545
664
|
};
|
|
546
665
|
}();
|
|
547
666
|
};
|
|
548
|
-
var initFetchValRouteUrl = function initFetchValRouteUrl(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies) {
|
|
667
|
+
var initFetchValRouteUrl = function initFetchValRouteUrl(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies, getDraftSourcesScope) {
|
|
549
668
|
return /*#__PURE__*/function () {
|
|
550
|
-
var
|
|
551
|
-
var fetchVal, resolvedParams, valModule, path, schema, val, route,
|
|
552
|
-
return _regenerator().w(function (
|
|
553
|
-
while (1) switch (
|
|
669
|
+
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(selector, params) {
|
|
670
|
+
var fetchVal, resolvedParams, valModule, path, schema, val, route, _t8, _t9;
|
|
671
|
+
return _regenerator().w(function (_context5) {
|
|
672
|
+
while (1) switch (_context5.n) {
|
|
554
673
|
case 0:
|
|
555
|
-
fetchVal = initFetchValStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies);
|
|
674
|
+
fetchVal = initFetchValStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies, getDraftSourcesScope);
|
|
556
675
|
if (!(params === undefined)) {
|
|
557
|
-
|
|
676
|
+
_context5.n = 1;
|
|
558
677
|
break;
|
|
559
678
|
}
|
|
560
|
-
|
|
561
|
-
|
|
679
|
+
_t8 = undefined;
|
|
680
|
+
_context5.n = 3;
|
|
562
681
|
break;
|
|
563
682
|
case 1:
|
|
564
|
-
|
|
683
|
+
_context5.n = 2;
|
|
565
684
|
return Promise.resolve(params);
|
|
566
685
|
case 2:
|
|
567
|
-
|
|
686
|
+
_t8 = _context5.v;
|
|
568
687
|
case 3:
|
|
569
|
-
resolvedParams =
|
|
688
|
+
resolvedParams = _t8;
|
|
570
689
|
// A view is a pointer: everything below reads a path, a schema and a source
|
|
571
690
|
// off this, and a pointer has none of them. See `resolveViewedModule`.
|
|
572
691
|
valModule = Internal.resolveViewedModule(selector);
|
|
573
692
|
path = valModule && Internal.getValPath(valModule);
|
|
574
693
|
schema = valModule && Internal.getSchema(valModule);
|
|
575
|
-
|
|
576
|
-
if (!
|
|
577
|
-
|
|
694
|
+
_t9 = valModule;
|
|
695
|
+
if (!_t9) {
|
|
696
|
+
_context5.n = 5;
|
|
578
697
|
break;
|
|
579
698
|
}
|
|
580
|
-
|
|
699
|
+
_context5.n = 4;
|
|
581
700
|
return fetchVal(valModule);
|
|
582
701
|
case 4:
|
|
583
|
-
|
|
702
|
+
_t9 = _context5.v;
|
|
584
703
|
case 5:
|
|
585
|
-
val =
|
|
704
|
+
val = _t9;
|
|
586
705
|
route = getValRouteUrlFromVal(resolvedParams, "fetchValRouteUrl", path, schema, val);
|
|
587
|
-
return
|
|
706
|
+
return _context5.a(2, route);
|
|
588
707
|
}
|
|
589
|
-
},
|
|
708
|
+
}, _callee5);
|
|
590
709
|
}));
|
|
591
|
-
return function (
|
|
592
|
-
return
|
|
710
|
+
return function (_x13, _x14) {
|
|
711
|
+
return _ref5.apply(this, arguments);
|
|
593
712
|
};
|
|
594
713
|
}();
|
|
595
714
|
};
|
|
@@ -603,6 +722,7 @@ function initValRsc(config, valModules, rscNextConfig) {
|
|
|
603
722
|
if (!nextVersion) {
|
|
604
723
|
throw new Error("Could not get @valbuild/next package version");
|
|
605
724
|
}
|
|
725
|
+
var draftSourcesScope = createReactCacheScope();
|
|
606
726
|
var valServerPromise = createValServer(valModules, "/api/val", _objectSpread2({
|
|
607
727
|
versions: {
|
|
608
728
|
next: nextVersion,
|
|
@@ -610,19 +730,6 @@ function initValRsc(config, valModules, rscNextConfig) {
|
|
|
610
730
|
}
|
|
611
731
|
}, config), config, {
|
|
612
732
|
isEnabled: function isEnabled() {
|
|
613
|
-
return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {
|
|
614
|
-
return _regenerator().w(function (_context5) {
|
|
615
|
-
while (1) switch (_context5.n) {
|
|
616
|
-
case 0:
|
|
617
|
-
_context5.n = 1;
|
|
618
|
-
return rscNextConfig.draftMode();
|
|
619
|
-
case 1:
|
|
620
|
-
return _context5.a(2, _context5.v.isEnabled);
|
|
621
|
-
}
|
|
622
|
-
}, _callee5);
|
|
623
|
-
}))();
|
|
624
|
-
},
|
|
625
|
-
onEnable: function onEnable() {
|
|
626
733
|
return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
|
|
627
734
|
return _regenerator().w(function (_context6) {
|
|
628
735
|
while (1) switch (_context6.n) {
|
|
@@ -630,14 +737,12 @@ function initValRsc(config, valModules, rscNextConfig) {
|
|
|
630
737
|
_context6.n = 1;
|
|
631
738
|
return rscNextConfig.draftMode();
|
|
632
739
|
case 1:
|
|
633
|
-
_context6.v.
|
|
634
|
-
case 2:
|
|
635
|
-
return _context6.a(2);
|
|
740
|
+
return _context6.a(2, _context6.v.isEnabled);
|
|
636
741
|
}
|
|
637
742
|
}, _callee6);
|
|
638
743
|
}))();
|
|
639
744
|
},
|
|
640
|
-
|
|
745
|
+
onEnable: function onEnable() {
|
|
641
746
|
return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7() {
|
|
642
747
|
return _regenerator().w(function (_context7) {
|
|
643
748
|
while (1) switch (_context7.n) {
|
|
@@ -645,35 +750,40 @@ function initValRsc(config, valModules, rscNextConfig) {
|
|
|
645
750
|
_context7.n = 1;
|
|
646
751
|
return rscNextConfig.draftMode();
|
|
647
752
|
case 1:
|
|
648
|
-
_context7.v.
|
|
753
|
+
_context7.v.enable();
|
|
649
754
|
case 2:
|
|
650
755
|
return _context7.a(2);
|
|
651
756
|
}
|
|
652
757
|
}, _callee7);
|
|
653
758
|
}))();
|
|
759
|
+
},
|
|
760
|
+
onDisable: function onDisable() {
|
|
761
|
+
return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {
|
|
762
|
+
return _regenerator().w(function (_context8) {
|
|
763
|
+
while (1) switch (_context8.n) {
|
|
764
|
+
case 0:
|
|
765
|
+
_context8.n = 1;
|
|
766
|
+
return rscNextConfig.draftMode();
|
|
767
|
+
case 1:
|
|
768
|
+
_context8.v.disable();
|
|
769
|
+
case 2:
|
|
770
|
+
return _context8.a(2);
|
|
771
|
+
}
|
|
772
|
+
}, _callee8);
|
|
773
|
+
}))();
|
|
654
774
|
}
|
|
655
775
|
});
|
|
656
776
|
return {
|
|
657
777
|
fetchValStega: initFetchValStega(config, valApiEndpoints,
|
|
658
778
|
// TODO: get from config
|
|
659
|
-
valServerPromise, /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
660
|
-
return _regenerator().w(function (_context8) {
|
|
661
|
-
while (1) switch (_context8.n) {
|
|
662
|
-
case 0:
|
|
663
|
-
_context8.n = 1;
|
|
664
|
-
return rscNextConfig.draftMode();
|
|
665
|
-
case 1:
|
|
666
|
-
return _context8.a(2, _context8.v.isEnabled);
|
|
667
|
-
}
|
|
668
|
-
}, _callee8);
|
|
669
|
-
})), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9() {
|
|
779
|
+
valServerPromise, /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9() {
|
|
670
780
|
return _regenerator().w(function (_context9) {
|
|
671
781
|
while (1) switch (_context9.n) {
|
|
672
782
|
case 0:
|
|
673
783
|
_context9.n = 1;
|
|
674
|
-
return rscNextConfig.
|
|
784
|
+
return rscNextConfig.draftMode();
|
|
675
785
|
case 1:
|
|
676
|
-
return _context9.a(2, _context9.v);
|
|
786
|
+
return _context9.a(2, _context9.v.isEnabled);
|
|
677
787
|
}
|
|
678
788
|
}, _callee9);
|
|
679
789
|
})), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0() {
|
|
@@ -681,51 +791,51 @@ function initValRsc(config, valModules, rscNextConfig) {
|
|
|
681
791
|
while (1) switch (_context0.n) {
|
|
682
792
|
case 0:
|
|
683
793
|
_context0.n = 1;
|
|
684
|
-
return rscNextConfig.
|
|
794
|
+
return rscNextConfig.headers();
|
|
685
795
|
case 1:
|
|
686
796
|
return _context0.a(2, _context0.v);
|
|
687
797
|
}
|
|
688
798
|
}, _callee0);
|
|
689
|
-
})))
|
|
690
|
-
fetchValKeyStega: initFetchValKeyStega(valServerPromise, /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1() {
|
|
799
|
+
})), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1() {
|
|
691
800
|
return _regenerator().w(function (_context1) {
|
|
692
801
|
while (1) switch (_context1.n) {
|
|
693
802
|
case 0:
|
|
694
803
|
_context1.n = 1;
|
|
695
|
-
return rscNextConfig.
|
|
804
|
+
return rscNextConfig.cookies();
|
|
696
805
|
case 1:
|
|
697
|
-
return _context1.a(2, _context1.v
|
|
806
|
+
return _context1.a(2, _context1.v);
|
|
698
807
|
}
|
|
699
808
|
}, _callee1);
|
|
700
|
-
})),
|
|
809
|
+
})), draftSourcesScope),
|
|
810
|
+
fetchValKeyStega: initFetchValKeyStega(valServerPromise, /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10() {
|
|
701
811
|
return _regenerator().w(function (_context10) {
|
|
702
812
|
while (1) switch (_context10.n) {
|
|
703
813
|
case 0:
|
|
704
814
|
_context10.n = 1;
|
|
705
|
-
return rscNextConfig.
|
|
815
|
+
return rscNextConfig.draftMode();
|
|
706
816
|
case 1:
|
|
707
|
-
return _context10.a(2, _context10.v);
|
|
817
|
+
return _context10.a(2, _context10.v.isEnabled);
|
|
708
818
|
}
|
|
709
819
|
}, _callee10);
|
|
710
|
-
})))
|
|
711
|
-
fetchValRouteStega: initFetchValRouteStega(config, valApiEndpoints, valServerPromise, /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11() {
|
|
820
|
+
})), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11() {
|
|
712
821
|
return _regenerator().w(function (_context11) {
|
|
713
822
|
while (1) switch (_context11.n) {
|
|
714
823
|
case 0:
|
|
715
824
|
_context11.n = 1;
|
|
716
|
-
return rscNextConfig.
|
|
825
|
+
return rscNextConfig.cookies();
|
|
717
826
|
case 1:
|
|
718
|
-
return _context11.a(2, _context11.v
|
|
827
|
+
return _context11.a(2, _context11.v);
|
|
719
828
|
}
|
|
720
829
|
}, _callee11);
|
|
721
|
-
})),
|
|
830
|
+
}))),
|
|
831
|
+
fetchValRouteStega: initFetchValRouteStega(config, valApiEndpoints, valServerPromise, /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee12() {
|
|
722
832
|
return _regenerator().w(function (_context12) {
|
|
723
833
|
while (1) switch (_context12.n) {
|
|
724
834
|
case 0:
|
|
725
835
|
_context12.n = 1;
|
|
726
|
-
return rscNextConfig.
|
|
836
|
+
return rscNextConfig.draftMode();
|
|
727
837
|
case 1:
|
|
728
|
-
return _context12.a(2, _context12.v);
|
|
838
|
+
return _context12.a(2, _context12.v.isEnabled);
|
|
729
839
|
}
|
|
730
840
|
}, _callee12);
|
|
731
841
|
})), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee13() {
|
|
@@ -733,30 +843,30 @@ function initValRsc(config, valModules, rscNextConfig) {
|
|
|
733
843
|
while (1) switch (_context13.n) {
|
|
734
844
|
case 0:
|
|
735
845
|
_context13.n = 1;
|
|
736
|
-
return rscNextConfig.
|
|
846
|
+
return rscNextConfig.headers();
|
|
737
847
|
case 1:
|
|
738
848
|
return _context13.a(2, _context13.v);
|
|
739
849
|
}
|
|
740
850
|
}, _callee13);
|
|
741
|
-
})))
|
|
742
|
-
fetchValRouteUrl: initFetchValRouteUrl(config, valApiEndpoints, valServerPromise, /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14() {
|
|
851
|
+
})), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14() {
|
|
743
852
|
return _regenerator().w(function (_context14) {
|
|
744
853
|
while (1) switch (_context14.n) {
|
|
745
854
|
case 0:
|
|
746
855
|
_context14.n = 1;
|
|
747
|
-
return rscNextConfig.
|
|
856
|
+
return rscNextConfig.cookies();
|
|
748
857
|
case 1:
|
|
749
|
-
return _context14.a(2, _context14.v
|
|
858
|
+
return _context14.a(2, _context14.v);
|
|
750
859
|
}
|
|
751
860
|
}, _callee14);
|
|
752
|
-
})),
|
|
861
|
+
})), draftSourcesScope),
|
|
862
|
+
fetchValRouteUrl: initFetchValRouteUrl(config, valApiEndpoints, valServerPromise, /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee15() {
|
|
753
863
|
return _regenerator().w(function (_context15) {
|
|
754
864
|
while (1) switch (_context15.n) {
|
|
755
865
|
case 0:
|
|
756
866
|
_context15.n = 1;
|
|
757
|
-
return rscNextConfig.
|
|
867
|
+
return rscNextConfig.draftMode();
|
|
758
868
|
case 1:
|
|
759
|
-
return _context15.a(2, _context15.v);
|
|
869
|
+
return _context15.a(2, _context15.v.isEnabled);
|
|
760
870
|
}
|
|
761
871
|
}, _callee15);
|
|
762
872
|
})), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee16() {
|
|
@@ -764,12 +874,22 @@ function initValRsc(config, valModules, rscNextConfig) {
|
|
|
764
874
|
while (1) switch (_context16.n) {
|
|
765
875
|
case 0:
|
|
766
876
|
_context16.n = 1;
|
|
767
|
-
return rscNextConfig.
|
|
877
|
+
return rscNextConfig.headers();
|
|
768
878
|
case 1:
|
|
769
879
|
return _context16.a(2, _context16.v);
|
|
770
880
|
}
|
|
771
881
|
}, _callee16);
|
|
772
|
-
})))
|
|
882
|
+
})), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee17() {
|
|
883
|
+
return _regenerator().w(function (_context17) {
|
|
884
|
+
while (1) switch (_context17.n) {
|
|
885
|
+
case 0:
|
|
886
|
+
_context17.n = 1;
|
|
887
|
+
return rscNextConfig.cookies();
|
|
888
|
+
case 1:
|
|
889
|
+
return _context17.a(2, _context17.v);
|
|
890
|
+
}
|
|
891
|
+
}, _callee17);
|
|
892
|
+
})), draftSourcesScope)
|
|
773
893
|
};
|
|
774
894
|
}
|
|
775
895
|
|