@valbuild/tanstack 0.133.0 → 0.134.0
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 +101 -0
- package/client/dist/valbuild-tanstack-client.cjs.dev.js +23 -14
- package/client/dist/valbuild-tanstack-client.cjs.prod.js +23 -14
- package/client/dist/valbuild-tanstack-client.esm.js +23 -14
- package/dist/declarations/src/client/initValClient.d.ts +8 -9
- package/dist/declarations/src/server/initValContent.d.ts +6 -8
- package/dist/declarations/src/server/initValServer.d.ts +11 -5
- package/dist/valbuild-tanstack.cjs.dev.js +1 -1
- package/dist/valbuild-tanstack.cjs.prod.js +1 -1
- package/dist/valbuild-tanstack.esm.js +1 -1
- package/dist/{version-7d59b1f2.cjs.prod.js → version-a7b44d6c.cjs.prod.js} +1 -1
- package/dist/{version-8deeac5f.cjs.dev.js → version-b9cc48bc.cjs.dev.js} +1 -1
- package/dist/{version-ed8bd465.esm.js → version-f7d654bf.esm.js} +1 -1
- package/package.json +8 -8
- package/server/dist/valbuild-tanstack-server.cjs.dev.js +38 -29
- package/server/dist/valbuild-tanstack-server.cjs.prod.js +38 -29
- package/server/dist/valbuild-tanstack-server.esm.js +38 -29
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,106 @@
|
|
|
1
1
|
# @valbuild/tanstack
|
|
2
2
|
|
|
3
|
+
## 0.134.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#690](https://github.com/valbuild/val/pull/690) [`16c49ea`](https://github.com/valbuild/val/commit/16c49ea6dd97c7a96bbfdf211af9bab5884579e2) Thanks [@freekh](https://github.com/freekh)! - Read a view with `useVal` / `fetchVal`.
|
|
8
|
+
|
|
9
|
+
A `s.view()` field reads as a pointer with no properties on it. It can now be handed to a reader, which resolves it to the module it names:
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
const page = useVal(pageVal);
|
|
13
|
+
const header = useVal(page.header); // the header module's content, typed
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The point is single source of truth rather than a new capability: the page declares which module it shows, and a component follows that declaration instead of importing the target a second time. Change `s.view(headerVal)` to `s.view(navVal)` and the reader follows; an import would have kept reading the header.
|
|
17
|
+
|
|
18
|
+
The readers that take a MODULE rather than a value follow the same rule — `useValKey`, `useValRoute`, `useValRouteUrl` and the `fetchVal*` counterparts, in both the Next and TanStack packages:
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
const page = useVal(pageVal);
|
|
22
|
+
const note = useValRoute(page.notes, params); // the router module the view names
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Works in draft mode, including when the page itself has a pending edit. Two things to know:
|
|
26
|
+
|
|
27
|
+
- **Resolve a handle in the component that read the module containing it.** A handle carries the module it points at, and that cannot survive serialization — so one passed from a server component to a client component as a prop arrives empty. It throws with an explanation rather than handing back the pointer. This is why it throws rather than returning nothing: every one of the route and key readers already uses `null` / `undefined` to mean "no such entry", so a quiet answer would be indistinguishable from a 404.
|
|
28
|
+
- **`ValView<Source>` is now a member of `SelectorSource`**, since a reader accepts one.
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- [#708](https://github.com/valbuild/val/pull/708) [`be78a9b`](https://github.com/valbuild/val/commit/be78a9b51678439f7ecb1c7f3887f9e8e1261a13) Thanks [@freekh](https://github.com/freekh)! - Fix `gitCommit` and `gitBranch` in `val.config.ts` never reaching the server,
|
|
33
|
+
and make them the one way to say it.
|
|
34
|
+
|
|
35
|
+
`val.config.ts` has had `gitCommit` and `gitBranch` for as long as it has had
|
|
36
|
+
anything, and a deployed app that set them resolved to no repository at all.
|
|
37
|
+
Nothing failed and nothing was logged: the commit was simply never sent, and
|
|
38
|
+
every patch the project saved recorded none.
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
// val.config.ts — the normal Vercel shape, and it did nothing
|
|
42
|
+
initVal({
|
|
43
|
+
project: "org/project",
|
|
44
|
+
gitCommit: process.env.VERCEL_GIT_COMMIT_SHA,
|
|
45
|
+
gitBranch: process.env.VERCEL_GIT_COMMIT_REF,
|
|
46
|
+
});
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The two halves never met. The server wanted a nested
|
|
50
|
+
`git: { commit, branch }`, `val.config.ts` offered two flat keys, and nothing
|
|
51
|
+
mapped one onto the other — so the only thing that worked was
|
|
52
|
+
`VAL_GIT_COMMIT` / `VAL_GIT_BRANCH` in the environment.
|
|
53
|
+
|
|
54
|
+
Rather than teach the server to read both, the nested option is gone:
|
|
55
|
+
`ValApiOptions` and TanStack's `ValHttpMode` now take `gitCommit` and
|
|
56
|
+
`gitBranch`, the same two names `ValConfig` uses. There is one name for this
|
|
57
|
+
now, wherever it is set. The framework bindings already hand the server
|
|
58
|
+
`{ versions, ...config }`, so a project's config keys arrive with nothing to
|
|
59
|
+
map, and a host passing them directly is saying the same thing in the same
|
|
60
|
+
words.
|
|
61
|
+
|
|
62
|
+
Flat because of where these values come from. A platform supplies them as
|
|
63
|
+
`process.env.VERCEL_GIT_COMMIT_SHA` and friends, typed `string | undefined`,
|
|
64
|
+
and two optional strings take that as it comes — a nested object makes every
|
|
65
|
+
caller write the ternary that turns two maybe-strings into one maybe-object.
|
|
66
|
+
|
|
67
|
+
**Breaking for a host that passed `git` itself**, which is the nested option on
|
|
68
|
+
`ValApiOptions` and on TanStack's `http` mode. An app that only configures
|
|
69
|
+
`val.config.ts` or the environment is unaffected.
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
// before
|
|
73
|
+
initValServer(valModules, config, {
|
|
74
|
+
http: { apiKey, valSecret, git: { commit, branch } },
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
// after
|
|
78
|
+
initValServer(valModules, config, {
|
|
79
|
+
http: { apiKey, valSecret, gitCommit: commit, gitBranch: branch },
|
|
80
|
+
});
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**What a commit is for**, and why its absence is worth a release rather than a
|
|
84
|
+
shrug: publishing turns pending patches into new `.val.ts` text, and to patch a
|
|
85
|
+
file you must first read it — at a commit. A project with none is a project
|
|
86
|
+
whose publishes read whatever the content service last had, rather than the
|
|
87
|
+
revision the deployed code was built from.
|
|
88
|
+
|
|
89
|
+
**One more behaviour change.** A commit and a branch have always been taken
|
|
90
|
+
together or not at all, and that check now sees config-supplied values too. A
|
|
91
|
+
project that sets exactly one of `gitCommit` and `gitBranch` used to have both
|
|
92
|
+
quietly ignored and will now be refused at startup, naming the missing half.
|
|
93
|
+
That is the configuration that would otherwise fail later, at a publish.
|
|
94
|
+
|
|
95
|
+
- Updated dependencies [[`be78a9b`](https://github.com/valbuild/val/commit/be78a9b51678439f7ecb1c7f3887f9e8e1261a13), [`1c31dcc`](https://github.com/valbuild/val/commit/1c31dcca7f1bb0199350567fd579de29f48bb26d), [`688b9e3`](https://github.com/valbuild/val/commit/688b9e36b821323cda6870cdff03dd36ec3e782f), [`16c49ea`](https://github.com/valbuild/val/commit/16c49ea6dd97c7a96bbfdf211af9bab5884579e2), [`eaa265e`](https://github.com/valbuild/val/commit/eaa265e78d9f6d2a1b685c38901612b8a3704eed)]:
|
|
96
|
+
- @valbuild/server@0.134.0
|
|
97
|
+
- @valbuild/ui@0.134.0
|
|
98
|
+
- @valbuild/core@0.134.0
|
|
99
|
+
- @valbuild/react@0.134.0
|
|
100
|
+
- @valbuild/shared@0.134.0
|
|
101
|
+
- @valbuild/language-server@0.134.0
|
|
102
|
+
- @valbuild/mcp@0.134.0
|
|
103
|
+
|
|
3
104
|
## 0.133.0
|
|
4
105
|
|
|
5
106
|
### Minor Changes
|
|
@@ -16,6 +16,8 @@ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e };
|
|
|
16
16
|
|
|
17
17
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
18
18
|
|
|
19
|
+
/** What `useVal` gives back — see `ResolvedVal` in `@valbuild/react/stega`. */
|
|
20
|
+
|
|
19
21
|
function useValStega(selector) {
|
|
20
22
|
var valOverlayContext = ValOverlayContext.useValOverlayContext();
|
|
21
23
|
var moduleIds = React__default["default"].useMemo(function () {
|
|
@@ -141,8 +143,6 @@ function draftJsonEntry(draftSource, key) {
|
|
|
141
143
|
};
|
|
142
144
|
}
|
|
143
145
|
|
|
144
|
-
// The (loosened) content type a single `.jsonValues()` entry resolves to.
|
|
145
|
-
|
|
146
146
|
// Module-level cache of in-flight/resolved entry loads, so `React.use` gets a
|
|
147
147
|
// stable promise across renders (keyed by module path + entry key).
|
|
148
148
|
var jsonEntryPromiseCache = new Map();
|
|
@@ -159,7 +159,10 @@ var jsonEntryPromiseCache = new Map();
|
|
|
159
159
|
*/
|
|
160
160
|
function useValKeyStega(selector, key) {
|
|
161
161
|
var valOverlayContext = ValOverlayContext.useValOverlayContext();
|
|
162
|
-
|
|
162
|
+
// A view is a pointer: everything below reads a path, a schema and a source
|
|
163
|
+
// off this, and a pointer has none of them. See `resolveViewedModule`.
|
|
164
|
+
var valModule = core.Internal.resolveViewedModule(selector);
|
|
165
|
+
var moduleFilePath = valModule && core.Internal.getValPath(valModule);
|
|
163
166
|
var draftSource = useDraftModuleSource(moduleFilePath || undefined);
|
|
164
167
|
var draft = draftJsonEntry(draftSource, key);
|
|
165
168
|
if (draft.status === "absent") {
|
|
@@ -169,11 +172,11 @@ function useValKeyStega(selector, key) {
|
|
|
169
172
|
}
|
|
170
173
|
var content = draft.status === "content" ? draft.content : undefined;
|
|
171
174
|
if (content === undefined) {
|
|
172
|
-
content = readCommittedJsonEntry(
|
|
175
|
+
content = readCommittedJsonEntry(valModule, key);
|
|
173
176
|
}
|
|
174
177
|
return stega.stegaEncode(content, {
|
|
175
178
|
disabled: !valOverlayContext.draftMode,
|
|
176
|
-
root: routeFromVal.getJsonEntryStegaRoot(
|
|
179
|
+
root: routeFromVal.getJsonEntryStegaRoot(valModule, key)
|
|
177
180
|
});
|
|
178
181
|
}
|
|
179
182
|
|
|
@@ -224,22 +227,25 @@ function resolveParams(params) {
|
|
|
224
227
|
}
|
|
225
228
|
function useValRouteStega(selector, params) {
|
|
226
229
|
var valOverlayContext = ValOverlayContext.useValOverlayContext();
|
|
230
|
+
// A view is a pointer: everything below reads a path, a schema and a source
|
|
231
|
+
// off this, and a pointer has none of them. See `resolveViewedModule`.
|
|
232
|
+
var valModule = core.Internal.resolveViewedModule(selector);
|
|
227
233
|
// Both called unconditionally to keep hook order stable. For a `.jsonValues()`
|
|
228
234
|
// router `val` is unused (we resolve a single entry below instead); for any
|
|
229
235
|
// other router `draftSource` is.
|
|
230
|
-
var val = useValStega(
|
|
231
|
-
var draftSource = useDraftModuleSource(
|
|
236
|
+
var val = useValStega(valModule);
|
|
237
|
+
var draftSource = useDraftModuleSource(valModule && core.Internal.getValPath(valModule) || undefined);
|
|
232
238
|
var resolvedParams = resolveParams(params);
|
|
233
239
|
// Careful: null means there was an error - undefined means no params
|
|
234
240
|
if (resolvedParams === null) {
|
|
235
241
|
return null;
|
|
236
242
|
}
|
|
237
|
-
var path =
|
|
238
|
-
var schema =
|
|
243
|
+
var path = valModule && core.Internal.getValPath(valModule);
|
|
244
|
+
var schema = valModule && core.Internal.getSchema(valModule);
|
|
239
245
|
// `.jsonValues()` router: map params → the entry key and load ONLY that
|
|
240
246
|
// entry's backing `*.val.json` (one dynamic import), like `useValKey`.
|
|
241
247
|
if (routeFromVal.isJsonValuesRecordSchema(schema)) {
|
|
242
|
-
var source =
|
|
248
|
+
var source = valModule && core.Internal.getSource(valModule);
|
|
243
249
|
var url = routeFromVal.getValRouteUrlFromVal(resolvedParams || {}, "useValRoute", path, schema, source);
|
|
244
250
|
if (!url) {
|
|
245
251
|
return null;
|
|
@@ -251,27 +257,30 @@ function useValRouteStega(selector, params) {
|
|
|
251
257
|
}
|
|
252
258
|
var content = draft.status === "content" ? draft.content : undefined;
|
|
253
259
|
if (content === undefined) {
|
|
254
|
-
content = readCommittedJsonEntry(
|
|
260
|
+
content = readCommittedJsonEntry(valModule, url);
|
|
255
261
|
}
|
|
256
262
|
if (content === undefined) {
|
|
257
263
|
return null;
|
|
258
264
|
}
|
|
259
265
|
return stega.stegaEncode(content, {
|
|
260
266
|
disabled: !valOverlayContext.draftMode,
|
|
261
|
-
root: routeFromVal.getJsonEntryStegaRoot(
|
|
267
|
+
root: routeFromVal.getJsonEntryStegaRoot(valModule, url)
|
|
262
268
|
});
|
|
263
269
|
}
|
|
264
270
|
var route = routeFromVal.initValRouteFromVal(resolvedParams || {}, "useValRoute", path, schema, val);
|
|
265
271
|
return route;
|
|
266
272
|
}
|
|
267
273
|
function useValRouteUrl(selector, params) {
|
|
268
|
-
|
|
274
|
+
// A view is a pointer: everything below reads a path, a schema and a source
|
|
275
|
+
// off this, and a pointer has none of them. See `resolveViewedModule`.
|
|
276
|
+
var valModule = core.Internal.resolveViewedModule(selector);
|
|
277
|
+
var val = useValStega(valModule);
|
|
269
278
|
var resolvedParams = params === undefined ? undefined : resolveParams(params);
|
|
270
279
|
// Careful: null means there was an error - undefined means no params
|
|
271
280
|
if (resolvedParams === null) {
|
|
272
281
|
return null;
|
|
273
282
|
}
|
|
274
|
-
var route = routeFromVal.getValRouteUrlFromVal(resolvedParams || {}, "useValRouteUrl",
|
|
283
|
+
var route = routeFromVal.getValRouteUrlFromVal(resolvedParams || {}, "useValRouteUrl", valModule && core.Internal.getValPath(valModule), valModule && core.Internal.getSchema(valModule), val);
|
|
275
284
|
return route;
|
|
276
285
|
}
|
|
277
286
|
|
|
@@ -16,6 +16,8 @@ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e };
|
|
|
16
16
|
|
|
17
17
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
18
18
|
|
|
19
|
+
/** What `useVal` gives back — see `ResolvedVal` in `@valbuild/react/stega`. */
|
|
20
|
+
|
|
19
21
|
function useValStega(selector) {
|
|
20
22
|
var valOverlayContext = ValOverlayContext.useValOverlayContext();
|
|
21
23
|
var moduleIds = React__default["default"].useMemo(function () {
|
|
@@ -141,8 +143,6 @@ function draftJsonEntry(draftSource, key) {
|
|
|
141
143
|
};
|
|
142
144
|
}
|
|
143
145
|
|
|
144
|
-
// The (loosened) content type a single `.jsonValues()` entry resolves to.
|
|
145
|
-
|
|
146
146
|
// Module-level cache of in-flight/resolved entry loads, so `React.use` gets a
|
|
147
147
|
// stable promise across renders (keyed by module path + entry key).
|
|
148
148
|
var jsonEntryPromiseCache = new Map();
|
|
@@ -159,7 +159,10 @@ var jsonEntryPromiseCache = new Map();
|
|
|
159
159
|
*/
|
|
160
160
|
function useValKeyStega(selector, key) {
|
|
161
161
|
var valOverlayContext = ValOverlayContext.useValOverlayContext();
|
|
162
|
-
|
|
162
|
+
// A view is a pointer: everything below reads a path, a schema and a source
|
|
163
|
+
// off this, and a pointer has none of them. See `resolveViewedModule`.
|
|
164
|
+
var valModule = core.Internal.resolveViewedModule(selector);
|
|
165
|
+
var moduleFilePath = valModule && core.Internal.getValPath(valModule);
|
|
163
166
|
var draftSource = useDraftModuleSource(moduleFilePath || undefined);
|
|
164
167
|
var draft = draftJsonEntry(draftSource, key);
|
|
165
168
|
if (draft.status === "absent") {
|
|
@@ -169,11 +172,11 @@ function useValKeyStega(selector, key) {
|
|
|
169
172
|
}
|
|
170
173
|
var content = draft.status === "content" ? draft.content : undefined;
|
|
171
174
|
if (content === undefined) {
|
|
172
|
-
content = readCommittedJsonEntry(
|
|
175
|
+
content = readCommittedJsonEntry(valModule, key);
|
|
173
176
|
}
|
|
174
177
|
return stega.stegaEncode(content, {
|
|
175
178
|
disabled: !valOverlayContext.draftMode,
|
|
176
|
-
root: routeFromVal.getJsonEntryStegaRoot(
|
|
179
|
+
root: routeFromVal.getJsonEntryStegaRoot(valModule, key)
|
|
177
180
|
});
|
|
178
181
|
}
|
|
179
182
|
|
|
@@ -224,22 +227,25 @@ function resolveParams(params) {
|
|
|
224
227
|
}
|
|
225
228
|
function useValRouteStega(selector, params) {
|
|
226
229
|
var valOverlayContext = ValOverlayContext.useValOverlayContext();
|
|
230
|
+
// A view is a pointer: everything below reads a path, a schema and a source
|
|
231
|
+
// off this, and a pointer has none of them. See `resolveViewedModule`.
|
|
232
|
+
var valModule = core.Internal.resolveViewedModule(selector);
|
|
227
233
|
// Both called unconditionally to keep hook order stable. For a `.jsonValues()`
|
|
228
234
|
// router `val` is unused (we resolve a single entry below instead); for any
|
|
229
235
|
// other router `draftSource` is.
|
|
230
|
-
var val = useValStega(
|
|
231
|
-
var draftSource = useDraftModuleSource(
|
|
236
|
+
var val = useValStega(valModule);
|
|
237
|
+
var draftSource = useDraftModuleSource(valModule && core.Internal.getValPath(valModule) || undefined);
|
|
232
238
|
var resolvedParams = resolveParams(params);
|
|
233
239
|
// Careful: null means there was an error - undefined means no params
|
|
234
240
|
if (resolvedParams === null) {
|
|
235
241
|
return null;
|
|
236
242
|
}
|
|
237
|
-
var path =
|
|
238
|
-
var schema =
|
|
243
|
+
var path = valModule && core.Internal.getValPath(valModule);
|
|
244
|
+
var schema = valModule && core.Internal.getSchema(valModule);
|
|
239
245
|
// `.jsonValues()` router: map params → the entry key and load ONLY that
|
|
240
246
|
// entry's backing `*.val.json` (one dynamic import), like `useValKey`.
|
|
241
247
|
if (routeFromVal.isJsonValuesRecordSchema(schema)) {
|
|
242
|
-
var source =
|
|
248
|
+
var source = valModule && core.Internal.getSource(valModule);
|
|
243
249
|
var url = routeFromVal.getValRouteUrlFromVal(resolvedParams || {}, "useValRoute", path, schema, source);
|
|
244
250
|
if (!url) {
|
|
245
251
|
return null;
|
|
@@ -251,27 +257,30 @@ function useValRouteStega(selector, params) {
|
|
|
251
257
|
}
|
|
252
258
|
var content = draft.status === "content" ? draft.content : undefined;
|
|
253
259
|
if (content === undefined) {
|
|
254
|
-
content = readCommittedJsonEntry(
|
|
260
|
+
content = readCommittedJsonEntry(valModule, url);
|
|
255
261
|
}
|
|
256
262
|
if (content === undefined) {
|
|
257
263
|
return null;
|
|
258
264
|
}
|
|
259
265
|
return stega.stegaEncode(content, {
|
|
260
266
|
disabled: !valOverlayContext.draftMode,
|
|
261
|
-
root: routeFromVal.getJsonEntryStegaRoot(
|
|
267
|
+
root: routeFromVal.getJsonEntryStegaRoot(valModule, url)
|
|
262
268
|
});
|
|
263
269
|
}
|
|
264
270
|
var route = routeFromVal.initValRouteFromVal(resolvedParams || {}, "useValRoute", path, schema, val);
|
|
265
271
|
return route;
|
|
266
272
|
}
|
|
267
273
|
function useValRouteUrl(selector, params) {
|
|
268
|
-
|
|
274
|
+
// A view is a pointer: everything below reads a path, a schema and a source
|
|
275
|
+
// off this, and a pointer has none of them. See `resolveViewedModule`.
|
|
276
|
+
var valModule = core.Internal.resolveViewedModule(selector);
|
|
277
|
+
var val = useValStega(valModule);
|
|
269
278
|
var resolvedParams = params === undefined ? undefined : resolveParams(params);
|
|
270
279
|
// Careful: null means there was an error - undefined means no params
|
|
271
280
|
if (resolvedParams === null) {
|
|
272
281
|
return null;
|
|
273
282
|
}
|
|
274
|
-
var route = routeFromVal.getValRouteUrlFromVal(resolvedParams || {}, "useValRouteUrl",
|
|
283
|
+
var route = routeFromVal.getValRouteUrlFromVal(resolvedParams || {}, "useValRouteUrl", valModule && core.Internal.getValPath(valModule), valModule && core.Internal.getSchema(valModule), val);
|
|
275
284
|
return route;
|
|
276
285
|
}
|
|
277
286
|
|
|
@@ -8,6 +8,8 @@ import '@valbuild/shared/client';
|
|
|
8
8
|
import '@valbuild/core/patch';
|
|
9
9
|
import 'react/jsx-runtime';
|
|
10
10
|
|
|
11
|
+
/** What `useVal` gives back — see `ResolvedVal` in `@valbuild/react/stega`. */
|
|
12
|
+
|
|
11
13
|
function useValStega(selector) {
|
|
12
14
|
var valOverlayContext = useValOverlayContext();
|
|
13
15
|
var moduleIds = React.useMemo(function () {
|
|
@@ -133,8 +135,6 @@ function draftJsonEntry(draftSource, key) {
|
|
|
133
135
|
};
|
|
134
136
|
}
|
|
135
137
|
|
|
136
|
-
// The (loosened) content type a single `.jsonValues()` entry resolves to.
|
|
137
|
-
|
|
138
138
|
// Module-level cache of in-flight/resolved entry loads, so `React.use` gets a
|
|
139
139
|
// stable promise across renders (keyed by module path + entry key).
|
|
140
140
|
var jsonEntryPromiseCache = new Map();
|
|
@@ -151,7 +151,10 @@ var jsonEntryPromiseCache = new Map();
|
|
|
151
151
|
*/
|
|
152
152
|
function useValKeyStega(selector, key) {
|
|
153
153
|
var valOverlayContext = useValOverlayContext();
|
|
154
|
-
|
|
154
|
+
// A view is a pointer: everything below reads a path, a schema and a source
|
|
155
|
+
// off this, and a pointer has none of them. See `resolveViewedModule`.
|
|
156
|
+
var valModule = Internal.resolveViewedModule(selector);
|
|
157
|
+
var moduleFilePath = valModule && Internal.getValPath(valModule);
|
|
155
158
|
var draftSource = useDraftModuleSource(moduleFilePath || undefined);
|
|
156
159
|
var draft = draftJsonEntry(draftSource, key);
|
|
157
160
|
if (draft.status === "absent") {
|
|
@@ -161,11 +164,11 @@ function useValKeyStega(selector, key) {
|
|
|
161
164
|
}
|
|
162
165
|
var content = draft.status === "content" ? draft.content : undefined;
|
|
163
166
|
if (content === undefined) {
|
|
164
|
-
content = readCommittedJsonEntry(
|
|
167
|
+
content = readCommittedJsonEntry(valModule, key);
|
|
165
168
|
}
|
|
166
169
|
return stegaEncode(content, {
|
|
167
170
|
disabled: !valOverlayContext.draftMode,
|
|
168
|
-
root: getJsonEntryStegaRoot(
|
|
171
|
+
root: getJsonEntryStegaRoot(valModule, key)
|
|
169
172
|
});
|
|
170
173
|
}
|
|
171
174
|
|
|
@@ -216,22 +219,25 @@ function resolveParams(params) {
|
|
|
216
219
|
}
|
|
217
220
|
function useValRouteStega(selector, params) {
|
|
218
221
|
var valOverlayContext = useValOverlayContext();
|
|
222
|
+
// A view is a pointer: everything below reads a path, a schema and a source
|
|
223
|
+
// off this, and a pointer has none of them. See `resolveViewedModule`.
|
|
224
|
+
var valModule = Internal.resolveViewedModule(selector);
|
|
219
225
|
// Both called unconditionally to keep hook order stable. For a `.jsonValues()`
|
|
220
226
|
// router `val` is unused (we resolve a single entry below instead); for any
|
|
221
227
|
// other router `draftSource` is.
|
|
222
|
-
var val = useValStega(
|
|
223
|
-
var draftSource = useDraftModuleSource(
|
|
228
|
+
var val = useValStega(valModule);
|
|
229
|
+
var draftSource = useDraftModuleSource(valModule && Internal.getValPath(valModule) || undefined);
|
|
224
230
|
var resolvedParams = resolveParams(params);
|
|
225
231
|
// Careful: null means there was an error - undefined means no params
|
|
226
232
|
if (resolvedParams === null) {
|
|
227
233
|
return null;
|
|
228
234
|
}
|
|
229
|
-
var path =
|
|
230
|
-
var schema =
|
|
235
|
+
var path = valModule && Internal.getValPath(valModule);
|
|
236
|
+
var schema = valModule && Internal.getSchema(valModule);
|
|
231
237
|
// `.jsonValues()` router: map params → the entry key and load ONLY that
|
|
232
238
|
// entry's backing `*.val.json` (one dynamic import), like `useValKey`.
|
|
233
239
|
if (isJsonValuesRecordSchema(schema)) {
|
|
234
|
-
var source =
|
|
240
|
+
var source = valModule && Internal.getSource(valModule);
|
|
235
241
|
var url = getValRouteUrlFromVal(resolvedParams || {}, "useValRoute", path, schema, source);
|
|
236
242
|
if (!url) {
|
|
237
243
|
return null;
|
|
@@ -243,27 +249,30 @@ function useValRouteStega(selector, params) {
|
|
|
243
249
|
}
|
|
244
250
|
var content = draft.status === "content" ? draft.content : undefined;
|
|
245
251
|
if (content === undefined) {
|
|
246
|
-
content = readCommittedJsonEntry(
|
|
252
|
+
content = readCommittedJsonEntry(valModule, url);
|
|
247
253
|
}
|
|
248
254
|
if (content === undefined) {
|
|
249
255
|
return null;
|
|
250
256
|
}
|
|
251
257
|
return stegaEncode(content, {
|
|
252
258
|
disabled: !valOverlayContext.draftMode,
|
|
253
|
-
root: getJsonEntryStegaRoot(
|
|
259
|
+
root: getJsonEntryStegaRoot(valModule, url)
|
|
254
260
|
});
|
|
255
261
|
}
|
|
256
262
|
var route = initValRouteFromVal(resolvedParams || {}, "useValRoute", path, schema, val);
|
|
257
263
|
return route;
|
|
258
264
|
}
|
|
259
265
|
function useValRouteUrl(selector, params) {
|
|
260
|
-
|
|
266
|
+
// A view is a pointer: everything below reads a path, a schema and a source
|
|
267
|
+
// off this, and a pointer has none of them. See `resolveViewedModule`.
|
|
268
|
+
var valModule = Internal.resolveViewedModule(selector);
|
|
269
|
+
var val = useValStega(valModule);
|
|
261
270
|
var resolvedParams = params === undefined ? undefined : resolveParams(params);
|
|
262
271
|
// Careful: null means there was an error - undefined means no params
|
|
263
272
|
if (resolvedParams === null) {
|
|
264
273
|
return null;
|
|
265
274
|
}
|
|
266
|
-
var route = getValRouteUrlFromVal(resolvedParams || {}, "useValRouteUrl",
|
|
275
|
+
var route = getValRouteUrlFromVal(resolvedParams || {}, "useValRouteUrl", valModule && Internal.getValPath(valModule), valModule && Internal.getSchema(valModule), val);
|
|
267
276
|
return route;
|
|
268
277
|
}
|
|
269
278
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { type ResolvableModule, SelectorSource } from "@valbuild/core";
|
|
2
|
+
import { type JsonEntryContentOf, type Resolvable, type ResolvedVal, type RouteValueOf } from "@valbuild/react/stega";
|
|
3
3
|
import { ValConfig } from "@valbuild/core";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
/** What `useVal` gives back — see `ResolvedVal` in `@valbuild/react/stega`. */
|
|
5
|
+
export type UseValType<T extends SelectorSource> = ResolvedVal<T>;
|
|
6
|
+
declare function useValStega<T extends Resolvable>(selector: T): UseValType<T>;
|
|
7
7
|
/**
|
|
8
8
|
* Client counterpart to `fetchValKey`: resolves a SINGLE `.jsonValues()` entry
|
|
9
9
|
* by key, loading only that entry's backing `*.val.json` (one dynamic import).
|
|
@@ -14,10 +14,9 @@ type JsonEntryContentOf<T extends ValModule<GenericSelector<SourceObject>>> = T
|
|
|
14
14
|
* overlay; in production — and whenever there is no draft view — it resolves the
|
|
15
15
|
* entry's lazy import thunk from the local module.
|
|
16
16
|
*/
|
|
17
|
-
declare function useValKeyStega<T extends
|
|
18
|
-
|
|
19
|
-
declare function
|
|
20
|
-
declare function useValRouteUrl<T extends ValModule<GenericSelector<SourceObject>>>(selector: T, params?: Record<string, string | string[]> | Promise<Record<string, string | string[]>>): string | null;
|
|
17
|
+
declare function useValKeyStega<T extends ResolvableModule>(selector: T, key: string): JsonEntryContentOf<T> | undefined;
|
|
18
|
+
declare function useValRouteStega<T extends ResolvableModule>(selector: T, params: Record<string, string | string[]> | Promise<Record<string, string | string[]>>): RouteValueOf<T>;
|
|
19
|
+
declare function useValRouteUrl<T extends ResolvableModule>(selector: T, params?: Record<string, string | string[]> | Promise<Record<string, string | string[]>>): string | null;
|
|
21
20
|
export declare function initValClient(config: ValConfig): {
|
|
22
21
|
useValStega: typeof useValStega;
|
|
23
22
|
useValKeyStega: typeof useValKeyStega;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import {
|
|
1
|
+
import { type JsonEntryContentOf, type Resolvable, type ResolvedVal, type RouteValueOf } from "@valbuild/react/stega";
|
|
2
|
+
import { ValConfig, ValModules, type ResolvableModule } from "@valbuild/core";
|
|
3
3
|
import { ValServer, type ValPatchStore } from "@valbuild/server";
|
|
4
4
|
import { type ValDraftMode } from "./valDraftMode.js";
|
|
5
5
|
import type { ValHttpMode } from "./initValServer.js";
|
|
@@ -10,8 +10,7 @@ declare const initFetchValStega: (config: ValConfig, valApiEndpoints: string, va
|
|
|
10
10
|
name: string;
|
|
11
11
|
value: string;
|
|
12
12
|
} | undefined;
|
|
13
|
-
}>) => <T extends
|
|
14
|
-
type FetchValRouteReturnType<T extends ValModule<GenericSelector<SourceObject>>> = T extends ValModule<infer S> ? S extends SourceObject ? NonNullable<S>[string] extends JsonSource<infer C> ? C | null : StegaOfSource<NonNullable<S>[string]> | null : never : never;
|
|
13
|
+
}>) => <T extends Resolvable>(selector: T) => Promise<ResolvedVal<T>>;
|
|
15
14
|
declare const initFetchValRouteStega: (config: ValConfig, valApiEndpoints: string, valServerPromise: Promise<ValServer>, isEnabled: () => Promise<boolean>, getHeaders: () => Promise<{
|
|
16
15
|
get(name: string): string | null;
|
|
17
16
|
}>, getCookies: () => Promise<{
|
|
@@ -19,7 +18,7 @@ declare const initFetchValRouteStega: (config: ValConfig, valApiEndpoints: strin
|
|
|
19
18
|
name: string;
|
|
20
19
|
value: string;
|
|
21
20
|
} | undefined;
|
|
22
|
-
}>) => <T extends
|
|
21
|
+
}>) => <T extends ResolvableModule>(selector: T, params: Promise<Record<string, string | string[]>> | Record<string, string | string[]> | unknown) => Promise<RouteValueOf<T>>;
|
|
23
22
|
/**
|
|
24
23
|
* Loads a single `.jsonValues()` entry's DRAFT content via the in-process
|
|
25
24
|
* `/json` endpoint (which replays pending patches). Returns `undefined` when the
|
|
@@ -60,7 +59,6 @@ export type DraftJsonEntry = {
|
|
|
60
59
|
* a null/undefined result.
|
|
61
60
|
*/
|
|
62
61
|
export declare function resolveDraftOrCommittedEntry(draft: DraftJsonEntry, loadCommitted: () => Promise<unknown | undefined>): Promise<unknown | undefined>;
|
|
63
|
-
type JsonEntryContentOf<T extends ValModule<GenericSelector<SourceObject>>> = T extends ValModule<infer S> ? S extends Record<string, infer V> ? V extends JsonSource<infer C> ? C : never : never : never;
|
|
64
62
|
/**
|
|
65
63
|
* Resolves ONE `.jsonValues()` entry by key, loading only that entry instead of
|
|
66
64
|
* the whole record — the runtime-scaling counterpart to the eager `fetchVal`.
|
|
@@ -77,7 +75,7 @@ export declare const initFetchValKeyStega: (valServerPromise: Promise<JsonEntryV
|
|
|
77
75
|
name: string;
|
|
78
76
|
value: string;
|
|
79
77
|
} | undefined;
|
|
80
|
-
}>) => <T extends
|
|
78
|
+
}>) => <T extends ResolvableModule>(selector: T, key: string) => Promise<JsonEntryContentOf<T> | undefined>;
|
|
81
79
|
declare const initFetchValRouteUrl: (config: ValConfig, valApiEndpoints: string, valServerPromise: Promise<ValServer>, isEnabled: () => Promise<boolean>, getHeaders: () => Promise<{
|
|
82
80
|
get(name: string): string | null;
|
|
83
81
|
}>, getCookies: () => Promise<{
|
|
@@ -85,7 +83,7 @@ declare const initFetchValRouteUrl: (config: ValConfig, valApiEndpoints: string,
|
|
|
85
83
|
name: string;
|
|
86
84
|
value: string;
|
|
87
85
|
} | undefined;
|
|
88
|
-
}>) => <T extends
|
|
86
|
+
}>) => <T extends ResolvableModule>(selector: T, params?: Promise<Record<string, string | string[]>> | Record<string, string | string[]> | unknown) => Promise<string | null>;
|
|
89
87
|
/**
|
|
90
88
|
* Val's content readers for the server side of a TanStack Start app.
|
|
91
89
|
*
|
|
@@ -20,13 +20,19 @@ export type ValHttpMode = {
|
|
|
20
20
|
* service is the store of record: it mints its own commit shas and knows the
|
|
21
21
|
* project's branch, so there is nothing to bake into the build.
|
|
22
22
|
*
|
|
23
|
-
* Where there is one: `
|
|
23
|
+
* Where there is one: `gitCommit` is the commit the running code was built
|
|
24
24
|
* from, and it is load bearing. See the note at the use.
|
|
25
|
+
*
|
|
26
|
+
* The same two names `val.config.ts` and `ValApiOptions` use, and flat for
|
|
27
|
+
* the same reason: a platform hands these over as
|
|
28
|
+
* `process.env.VERCEL_GIT_COMMIT_SHA` and friends, typed
|
|
29
|
+
* `string | undefined`, and two optional strings take that as it comes
|
|
30
|
+
* rather than making every caller write a ternary to build an object.
|
|
31
|
+
*
|
|
32
|
+
* Taken together or not at all -- one without the other is refused.
|
|
25
33
|
*/
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
branch: string;
|
|
29
|
-
};
|
|
34
|
+
gitCommit?: string;
|
|
35
|
+
gitBranch?: string;
|
|
30
36
|
/**
|
|
31
37
|
* Val's content service, when it is not the real one.
|
|
32
38
|
*
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var version = require('./version-
|
|
5
|
+
var version = require('./version-b9cc48bc.cjs.dev.js');
|
|
6
6
|
var createForOfIteratorHelper = require('./createForOfIteratorHelper-e75681d7.cjs.dev.js');
|
|
7
7
|
var core = require('@valbuild/core');
|
|
8
8
|
var stega = require('@valbuild/react/stega');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var version = require('./version-
|
|
5
|
+
var version = require('./version-a7b44d6c.cjs.prod.js');
|
|
6
6
|
var createForOfIteratorHelper = require('./createForOfIteratorHelper-0324e063.cjs.prod.js');
|
|
7
7
|
var core = require('@valbuild/core');
|
|
8
8
|
var stega = require('@valbuild/react/stega');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as _asyncToGenerator, a as _regenerator, r as readValEnableCookie, V as VERSION$1 } from './version-
|
|
1
|
+
import { _ as _asyncToGenerator, a as _regenerator, r as readValEnableCookie, V as VERSION$1 } from './version-f7d654bf.esm.js';
|
|
2
2
|
import { _ as _objectSpread2, a as _slicedToArray, b as _createForOfIteratorHelper } from './createForOfIteratorHelper-485c2ce1.esm.js';
|
|
3
3
|
import { Internal as Internal$1, initVal as initVal$1, DEFAULT_CONTENT_HOST } from '@valbuild/core';
|
|
4
4
|
import * as core from '@valbuild/core';
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"tanstack-router",
|
|
15
15
|
"react"
|
|
16
16
|
],
|
|
17
|
-
"version": "0.
|
|
17
|
+
"version": "0.134.0",
|
|
18
18
|
"main": "dist/valbuild-tanstack.cjs.js",
|
|
19
19
|
"module": "dist/valbuild-tanstack.esm.js",
|
|
20
20
|
"exports": {
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"exports": true
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@valbuild/
|
|
46
|
-
"@valbuild/
|
|
47
|
-
"@valbuild/
|
|
48
|
-
"@valbuild/
|
|
49
|
-
"@valbuild/server": "0.
|
|
50
|
-
"@valbuild/
|
|
51
|
-
"@valbuild/
|
|
45
|
+
"@valbuild/language-server": "0.134.0",
|
|
46
|
+
"@valbuild/mcp": "0.134.0",
|
|
47
|
+
"@valbuild/react": "0.134.0",
|
|
48
|
+
"@valbuild/core": "0.134.0",
|
|
49
|
+
"@valbuild/server": "0.134.0",
|
|
50
|
+
"@valbuild/ui": "0.134.0",
|
|
51
|
+
"@valbuild/shared": "0.134.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@tanstack/react-router": "^1.170.33",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var version = require('../../dist/version-
|
|
5
|
+
var version = require('../../dist/version-b9cc48bc.cjs.dev.js');
|
|
6
6
|
var core = require('@valbuild/core');
|
|
7
7
|
var createForOfIteratorHelper = require('../../dist/createForOfIteratorHelper-e75681d7.cjs.dev.js');
|
|
8
8
|
var server = require('@valbuild/server');
|
|
@@ -506,7 +506,7 @@ function getHost(headers) {
|
|
|
506
506
|
var initFetchValRouteStega = function initFetchValRouteStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies) {
|
|
507
507
|
return /*#__PURE__*/function () {
|
|
508
508
|
var _ref2 = version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee2(selector, params) {
|
|
509
|
-
var resolvedParams, path, schema, source, url, enabled, draft, content, fetchVal, val, route, _t5;
|
|
509
|
+
var resolvedParams, valModule, path, schema, source, url, enabled, draft, content, fetchVal, val, route, _t5;
|
|
510
510
|
return version._regenerator().w(function (_context2) {
|
|
511
511
|
while (1) switch (_context2.p = _context2.n) {
|
|
512
512
|
case 0:
|
|
@@ -514,15 +514,18 @@ var initFetchValRouteStega = function initFetchValRouteStega(config, valApiEndpo
|
|
|
514
514
|
return Promise.resolve(params);
|
|
515
515
|
case 1:
|
|
516
516
|
resolvedParams = _context2.v;
|
|
517
|
-
path
|
|
518
|
-
|
|
517
|
+
// A view is a pointer: everything below reads a path, a schema and a source
|
|
518
|
+
// off this, and a pointer has none of them. See `resolveViewedModule`.
|
|
519
|
+
valModule = core.Internal.resolveViewedModule(selector);
|
|
520
|
+
path = valModule && core.Internal.getValPath(valModule);
|
|
521
|
+
schema = valModule && core.Internal.getSchema(valModule); // `.jsonValues()` router: map params → the entry key and load ONLY that
|
|
519
522
|
// entry's backing `*.val.json`, instead of eagerly resolving the whole
|
|
520
523
|
// record via `fetchVal`.
|
|
521
524
|
if (!routeFromVal.isJsonValuesRecordSchema(schema)) {
|
|
522
525
|
_context2.n = 11;
|
|
523
526
|
break;
|
|
524
527
|
}
|
|
525
|
-
source =
|
|
528
|
+
source = valModule && core.Internal.getSource(valModule);
|
|
526
529
|
url = routeFromVal.getValRouteUrlFromVal(resolvedParams, "fetchValRoute", path, schema, source);
|
|
527
530
|
if (url) {
|
|
528
531
|
_context2.n = 2;
|
|
@@ -569,17 +572,17 @@ var initFetchValRouteStega = function initFetchValRouteStega(config, valApiEndpo
|
|
|
569
572
|
case 10:
|
|
570
573
|
return _context2.a(2, stega.stegaEncode(content, {
|
|
571
574
|
disabled: !enabled,
|
|
572
|
-
root: routeFromVal.getJsonEntryStegaRoot(
|
|
575
|
+
root: routeFromVal.getJsonEntryStegaRoot(valModule, url)
|
|
573
576
|
}));
|
|
574
577
|
case 11:
|
|
575
578
|
fetchVal = initFetchValStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies);
|
|
576
|
-
_t5 =
|
|
579
|
+
_t5 = valModule;
|
|
577
580
|
if (!_t5) {
|
|
578
581
|
_context2.n = 13;
|
|
579
582
|
break;
|
|
580
583
|
}
|
|
581
584
|
_context2.n = 12;
|
|
582
|
-
return fetchVal(
|
|
585
|
+
return fetchVal(valModule);
|
|
583
586
|
case 12:
|
|
584
587
|
_t5 = _context2.v;
|
|
585
588
|
case 13:
|
|
@@ -696,7 +699,18 @@ function _resolveDraftOrCommittedEntry() {
|
|
|
696
699
|
}
|
|
697
700
|
function loadDraftJsonEntry(_x7, _x8, _x9, _x0) {
|
|
698
701
|
return _loadDraftJsonEntry.apply(this, arguments);
|
|
699
|
-
}
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* Resolves ONE `.jsonValues()` entry by key, loading only that entry instead of
|
|
705
|
+
* the whole record — the runtime-scaling counterpart to the eager `fetchVal`.
|
|
706
|
+
*
|
|
707
|
+
* Production (Val disabled): resolves the entry's lazy import thunk from the
|
|
708
|
+
* locally-bundled module. One dynamic import, no server round-trip.
|
|
709
|
+
*
|
|
710
|
+
* Enabled (draft mode): reads the entry through `/json`, which replays pending
|
|
711
|
+
* patches, so uncommitted Studio edits show up. Falls back to the local thunk if
|
|
712
|
+
* the draft read yields nothing.
|
|
713
|
+
*/
|
|
700
714
|
function _loadDraftJsonEntry() {
|
|
701
715
|
_loadDraftJsonEntry = version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee7(valServerPromise, getCookies, moduleFilePath, key) {
|
|
702
716
|
var _cookies3;
|
|
@@ -781,21 +795,10 @@ function _loadDraftJsonEntry() {
|
|
|
781
795
|
}));
|
|
782
796
|
return _loadDraftJsonEntry.apply(this, arguments);
|
|
783
797
|
}
|
|
784
|
-
/**
|
|
785
|
-
* Resolves ONE `.jsonValues()` entry by key, loading only that entry instead of
|
|
786
|
-
* the whole record — the runtime-scaling counterpart to the eager `fetchVal`.
|
|
787
|
-
*
|
|
788
|
-
* Production (Val disabled): resolves the entry's lazy import thunk from the
|
|
789
|
-
* locally-bundled module. One dynamic import, no server round-trip.
|
|
790
|
-
*
|
|
791
|
-
* Enabled (draft mode): reads the entry through `/json`, which replays pending
|
|
792
|
-
* patches, so uncommitted Studio edits show up. Falls back to the local thunk if
|
|
793
|
-
* the draft read yields nothing.
|
|
794
|
-
*/
|
|
795
798
|
var initFetchValKeyStega = function initFetchValKeyStega(valServerPromise, isEnabled, getCookies) {
|
|
796
799
|
return /*#__PURE__*/function () {
|
|
797
800
|
var _ref3 = version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee3(selector, key) {
|
|
798
|
-
var enabled, source, moduleFilePath, draft, content;
|
|
801
|
+
var enabled, valModule, source, moduleFilePath, draft, content;
|
|
799
802
|
return version._regenerator().w(function (_context3) {
|
|
800
803
|
while (1) switch (_context3.p = _context3.n) {
|
|
801
804
|
case 0:
|
|
@@ -811,8 +814,11 @@ var initFetchValKeyStega = function initFetchValKeyStega(valServerPromise, isEna
|
|
|
811
814
|
_context3.p = 3;
|
|
812
815
|
_context3.v;
|
|
813
816
|
case 4:
|
|
814
|
-
|
|
815
|
-
|
|
817
|
+
// A view is a pointer: everything below reads a path and a source off this,
|
|
818
|
+
// and a pointer has neither. See `resolveViewedModule`.
|
|
819
|
+
valModule = core.Internal.resolveViewedModule(selector);
|
|
820
|
+
source = valModule && core.Internal.getSource(valModule);
|
|
821
|
+
moduleFilePath = valModule && core.Internal.getValPath(valModule);
|
|
816
822
|
draft = {
|
|
817
823
|
status: "unavailable"
|
|
818
824
|
};
|
|
@@ -840,7 +846,7 @@ var initFetchValKeyStega = function initFetchValKeyStega(valServerPromise, isEna
|
|
|
840
846
|
case 8:
|
|
841
847
|
return _context3.a(2, stega.stegaEncode(content, {
|
|
842
848
|
disabled: !enabled,
|
|
843
|
-
root: routeFromVal.getJsonEntryStegaRoot(
|
|
849
|
+
root: routeFromVal.getJsonEntryStegaRoot(valModule, key)
|
|
844
850
|
}));
|
|
845
851
|
}
|
|
846
852
|
}, _callee3, null, [[1, 3]]);
|
|
@@ -853,7 +859,7 @@ var initFetchValKeyStega = function initFetchValKeyStega(valServerPromise, isEna
|
|
|
853
859
|
var initFetchValRouteUrl = function initFetchValRouteUrl(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies) {
|
|
854
860
|
return /*#__PURE__*/function () {
|
|
855
861
|
var _ref4 = version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee4(selector, params) {
|
|
856
|
-
var fetchVal, resolvedParams, path, schema, val, route, _t7, _t8;
|
|
862
|
+
var fetchVal, resolvedParams, valModule, path, schema, val, route, _t7, _t8;
|
|
857
863
|
return version._regenerator().w(function (_context4) {
|
|
858
864
|
while (1) switch (_context4.n) {
|
|
859
865
|
case 0:
|
|
@@ -872,15 +878,18 @@ var initFetchValRouteUrl = function initFetchValRouteUrl(config, valApiEndpoints
|
|
|
872
878
|
_t7 = _context4.v;
|
|
873
879
|
case 3:
|
|
874
880
|
resolvedParams = _t7;
|
|
875
|
-
path
|
|
876
|
-
|
|
877
|
-
|
|
881
|
+
// A view is a pointer: everything below reads a path, a schema and a source
|
|
882
|
+
// off this, and a pointer has none of them. See `resolveViewedModule`.
|
|
883
|
+
valModule = core.Internal.resolveViewedModule(selector);
|
|
884
|
+
path = valModule && core.Internal.getValPath(valModule);
|
|
885
|
+
schema = valModule && core.Internal.getSchema(valModule);
|
|
886
|
+
_t8 = valModule;
|
|
878
887
|
if (!_t8) {
|
|
879
888
|
_context4.n = 5;
|
|
880
889
|
break;
|
|
881
890
|
}
|
|
882
891
|
_context4.n = 4;
|
|
883
|
-
return fetchVal(
|
|
892
|
+
return fetchVal(valModule);
|
|
884
893
|
case 4:
|
|
885
894
|
_t8 = _context4.v;
|
|
886
895
|
case 5:
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var version = require('../../dist/version-
|
|
5
|
+
var version = require('../../dist/version-a7b44d6c.cjs.prod.js');
|
|
6
6
|
var core = require('@valbuild/core');
|
|
7
7
|
var createForOfIteratorHelper = require('../../dist/createForOfIteratorHelper-0324e063.cjs.prod.js');
|
|
8
8
|
var server = require('@valbuild/server');
|
|
@@ -506,7 +506,7 @@ function getHost(headers) {
|
|
|
506
506
|
var initFetchValRouteStega = function initFetchValRouteStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies) {
|
|
507
507
|
return /*#__PURE__*/function () {
|
|
508
508
|
var _ref2 = version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee2(selector, params) {
|
|
509
|
-
var resolvedParams, path, schema, source, url, enabled, draft, content, fetchVal, val, route, _t5;
|
|
509
|
+
var resolvedParams, valModule, path, schema, source, url, enabled, draft, content, fetchVal, val, route, _t5;
|
|
510
510
|
return version._regenerator().w(function (_context2) {
|
|
511
511
|
while (1) switch (_context2.p = _context2.n) {
|
|
512
512
|
case 0:
|
|
@@ -514,15 +514,18 @@ var initFetchValRouteStega = function initFetchValRouteStega(config, valApiEndpo
|
|
|
514
514
|
return Promise.resolve(params);
|
|
515
515
|
case 1:
|
|
516
516
|
resolvedParams = _context2.v;
|
|
517
|
-
path
|
|
518
|
-
|
|
517
|
+
// A view is a pointer: everything below reads a path, a schema and a source
|
|
518
|
+
// off this, and a pointer has none of them. See `resolveViewedModule`.
|
|
519
|
+
valModule = core.Internal.resolveViewedModule(selector);
|
|
520
|
+
path = valModule && core.Internal.getValPath(valModule);
|
|
521
|
+
schema = valModule && core.Internal.getSchema(valModule); // `.jsonValues()` router: map params → the entry key and load ONLY that
|
|
519
522
|
// entry's backing `*.val.json`, instead of eagerly resolving the whole
|
|
520
523
|
// record via `fetchVal`.
|
|
521
524
|
if (!routeFromVal.isJsonValuesRecordSchema(schema)) {
|
|
522
525
|
_context2.n = 11;
|
|
523
526
|
break;
|
|
524
527
|
}
|
|
525
|
-
source =
|
|
528
|
+
source = valModule && core.Internal.getSource(valModule);
|
|
526
529
|
url = routeFromVal.getValRouteUrlFromVal(resolvedParams, "fetchValRoute", path, schema, source);
|
|
527
530
|
if (url) {
|
|
528
531
|
_context2.n = 2;
|
|
@@ -569,17 +572,17 @@ var initFetchValRouteStega = function initFetchValRouteStega(config, valApiEndpo
|
|
|
569
572
|
case 10:
|
|
570
573
|
return _context2.a(2, stega.stegaEncode(content, {
|
|
571
574
|
disabled: !enabled,
|
|
572
|
-
root: routeFromVal.getJsonEntryStegaRoot(
|
|
575
|
+
root: routeFromVal.getJsonEntryStegaRoot(valModule, url)
|
|
573
576
|
}));
|
|
574
577
|
case 11:
|
|
575
578
|
fetchVal = initFetchValStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies);
|
|
576
|
-
_t5 =
|
|
579
|
+
_t5 = valModule;
|
|
577
580
|
if (!_t5) {
|
|
578
581
|
_context2.n = 13;
|
|
579
582
|
break;
|
|
580
583
|
}
|
|
581
584
|
_context2.n = 12;
|
|
582
|
-
return fetchVal(
|
|
585
|
+
return fetchVal(valModule);
|
|
583
586
|
case 12:
|
|
584
587
|
_t5 = _context2.v;
|
|
585
588
|
case 13:
|
|
@@ -696,7 +699,18 @@ function _resolveDraftOrCommittedEntry() {
|
|
|
696
699
|
}
|
|
697
700
|
function loadDraftJsonEntry(_x7, _x8, _x9, _x0) {
|
|
698
701
|
return _loadDraftJsonEntry.apply(this, arguments);
|
|
699
|
-
}
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* Resolves ONE `.jsonValues()` entry by key, loading only that entry instead of
|
|
705
|
+
* the whole record — the runtime-scaling counterpart to the eager `fetchVal`.
|
|
706
|
+
*
|
|
707
|
+
* Production (Val disabled): resolves the entry's lazy import thunk from the
|
|
708
|
+
* locally-bundled module. One dynamic import, no server round-trip.
|
|
709
|
+
*
|
|
710
|
+
* Enabled (draft mode): reads the entry through `/json`, which replays pending
|
|
711
|
+
* patches, so uncommitted Studio edits show up. Falls back to the local thunk if
|
|
712
|
+
* the draft read yields nothing.
|
|
713
|
+
*/
|
|
700
714
|
function _loadDraftJsonEntry() {
|
|
701
715
|
_loadDraftJsonEntry = version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee7(valServerPromise, getCookies, moduleFilePath, key) {
|
|
702
716
|
var _cookies3;
|
|
@@ -781,21 +795,10 @@ function _loadDraftJsonEntry() {
|
|
|
781
795
|
}));
|
|
782
796
|
return _loadDraftJsonEntry.apply(this, arguments);
|
|
783
797
|
}
|
|
784
|
-
/**
|
|
785
|
-
* Resolves ONE `.jsonValues()` entry by key, loading only that entry instead of
|
|
786
|
-
* the whole record — the runtime-scaling counterpart to the eager `fetchVal`.
|
|
787
|
-
*
|
|
788
|
-
* Production (Val disabled): resolves the entry's lazy import thunk from the
|
|
789
|
-
* locally-bundled module. One dynamic import, no server round-trip.
|
|
790
|
-
*
|
|
791
|
-
* Enabled (draft mode): reads the entry through `/json`, which replays pending
|
|
792
|
-
* patches, so uncommitted Studio edits show up. Falls back to the local thunk if
|
|
793
|
-
* the draft read yields nothing.
|
|
794
|
-
*/
|
|
795
798
|
var initFetchValKeyStega = function initFetchValKeyStega(valServerPromise, isEnabled, getCookies) {
|
|
796
799
|
return /*#__PURE__*/function () {
|
|
797
800
|
var _ref3 = version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee3(selector, key) {
|
|
798
|
-
var enabled, source, moduleFilePath, draft, content;
|
|
801
|
+
var enabled, valModule, source, moduleFilePath, draft, content;
|
|
799
802
|
return version._regenerator().w(function (_context3) {
|
|
800
803
|
while (1) switch (_context3.p = _context3.n) {
|
|
801
804
|
case 0:
|
|
@@ -811,8 +814,11 @@ var initFetchValKeyStega = function initFetchValKeyStega(valServerPromise, isEna
|
|
|
811
814
|
_context3.p = 3;
|
|
812
815
|
_context3.v;
|
|
813
816
|
case 4:
|
|
814
|
-
|
|
815
|
-
|
|
817
|
+
// A view is a pointer: everything below reads a path and a source off this,
|
|
818
|
+
// and a pointer has neither. See `resolveViewedModule`.
|
|
819
|
+
valModule = core.Internal.resolveViewedModule(selector);
|
|
820
|
+
source = valModule && core.Internal.getSource(valModule);
|
|
821
|
+
moduleFilePath = valModule && core.Internal.getValPath(valModule);
|
|
816
822
|
draft = {
|
|
817
823
|
status: "unavailable"
|
|
818
824
|
};
|
|
@@ -840,7 +846,7 @@ var initFetchValKeyStega = function initFetchValKeyStega(valServerPromise, isEna
|
|
|
840
846
|
case 8:
|
|
841
847
|
return _context3.a(2, stega.stegaEncode(content, {
|
|
842
848
|
disabled: !enabled,
|
|
843
|
-
root: routeFromVal.getJsonEntryStegaRoot(
|
|
849
|
+
root: routeFromVal.getJsonEntryStegaRoot(valModule, key)
|
|
844
850
|
}));
|
|
845
851
|
}
|
|
846
852
|
}, _callee3, null, [[1, 3]]);
|
|
@@ -853,7 +859,7 @@ var initFetchValKeyStega = function initFetchValKeyStega(valServerPromise, isEna
|
|
|
853
859
|
var initFetchValRouteUrl = function initFetchValRouteUrl(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies) {
|
|
854
860
|
return /*#__PURE__*/function () {
|
|
855
861
|
var _ref4 = version._asyncToGenerator(/*#__PURE__*/version._regenerator().m(function _callee4(selector, params) {
|
|
856
|
-
var fetchVal, resolvedParams, path, schema, val, route, _t7, _t8;
|
|
862
|
+
var fetchVal, resolvedParams, valModule, path, schema, val, route, _t7, _t8;
|
|
857
863
|
return version._regenerator().w(function (_context4) {
|
|
858
864
|
while (1) switch (_context4.n) {
|
|
859
865
|
case 0:
|
|
@@ -872,15 +878,18 @@ var initFetchValRouteUrl = function initFetchValRouteUrl(config, valApiEndpoints
|
|
|
872
878
|
_t7 = _context4.v;
|
|
873
879
|
case 3:
|
|
874
880
|
resolvedParams = _t7;
|
|
875
|
-
path
|
|
876
|
-
|
|
877
|
-
|
|
881
|
+
// A view is a pointer: everything below reads a path, a schema and a source
|
|
882
|
+
// off this, and a pointer has none of them. See `resolveViewedModule`.
|
|
883
|
+
valModule = core.Internal.resolveViewedModule(selector);
|
|
884
|
+
path = valModule && core.Internal.getValPath(valModule);
|
|
885
|
+
schema = valModule && core.Internal.getSchema(valModule);
|
|
886
|
+
_t8 = valModule;
|
|
878
887
|
if (!_t8) {
|
|
879
888
|
_context4.n = 5;
|
|
880
889
|
break;
|
|
881
890
|
}
|
|
882
891
|
_context4.n = 4;
|
|
883
|
-
return fetchVal(
|
|
892
|
+
return fetchVal(valModule);
|
|
884
893
|
case 4:
|
|
885
894
|
_t8 = _context4.v;
|
|
886
895
|
case 5:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as _asyncToGenerator, a as _regenerator, V as VERSION, s as setValEnableCookieReader } from '../../dist/version-
|
|
1
|
+
import { _ as _asyncToGenerator, a as _regenerator, V as VERSION, s as setValEnableCookieReader } from '../../dist/version-f7d654bf.esm.js';
|
|
2
2
|
import { Internal } from '@valbuild/core';
|
|
3
3
|
import { _ as _objectSpread2, a as _slicedToArray, d as _defineProperty } from '../../dist/createForOfIteratorHelper-485c2ce1.esm.js';
|
|
4
4
|
import { createValApiRouter, createValServer } from '@valbuild/server';
|
|
@@ -485,7 +485,7 @@ function getHost(headers) {
|
|
|
485
485
|
var initFetchValRouteStega = function initFetchValRouteStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies) {
|
|
486
486
|
return /*#__PURE__*/function () {
|
|
487
487
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(selector, params) {
|
|
488
|
-
var resolvedParams, path, schema, source, url, enabled, draft, content, fetchVal, val, route, _t5;
|
|
488
|
+
var resolvedParams, valModule, path, schema, source, url, enabled, draft, content, fetchVal, val, route, _t5;
|
|
489
489
|
return _regenerator().w(function (_context2) {
|
|
490
490
|
while (1) switch (_context2.p = _context2.n) {
|
|
491
491
|
case 0:
|
|
@@ -493,15 +493,18 @@ var initFetchValRouteStega = function initFetchValRouteStega(config, valApiEndpo
|
|
|
493
493
|
return Promise.resolve(params);
|
|
494
494
|
case 1:
|
|
495
495
|
resolvedParams = _context2.v;
|
|
496
|
-
path
|
|
497
|
-
|
|
496
|
+
// A view is a pointer: everything below reads a path, a schema and a source
|
|
497
|
+
// off this, and a pointer has none of them. See `resolveViewedModule`.
|
|
498
|
+
valModule = Internal.resolveViewedModule(selector);
|
|
499
|
+
path = valModule && Internal.getValPath(valModule);
|
|
500
|
+
schema = valModule && Internal.getSchema(valModule); // `.jsonValues()` router: map params → the entry key and load ONLY that
|
|
498
501
|
// entry's backing `*.val.json`, instead of eagerly resolving the whole
|
|
499
502
|
// record via `fetchVal`.
|
|
500
503
|
if (!isJsonValuesRecordSchema(schema)) {
|
|
501
504
|
_context2.n = 11;
|
|
502
505
|
break;
|
|
503
506
|
}
|
|
504
|
-
source =
|
|
507
|
+
source = valModule && Internal.getSource(valModule);
|
|
505
508
|
url = getValRouteUrlFromVal(resolvedParams, "fetchValRoute", path, schema, source);
|
|
506
509
|
if (url) {
|
|
507
510
|
_context2.n = 2;
|
|
@@ -548,17 +551,17 @@ var initFetchValRouteStega = function initFetchValRouteStega(config, valApiEndpo
|
|
|
548
551
|
case 10:
|
|
549
552
|
return _context2.a(2, stegaEncode(content, {
|
|
550
553
|
disabled: !enabled,
|
|
551
|
-
root: getJsonEntryStegaRoot(
|
|
554
|
+
root: getJsonEntryStegaRoot(valModule, url)
|
|
552
555
|
}));
|
|
553
556
|
case 11:
|
|
554
557
|
fetchVal = initFetchValStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies);
|
|
555
|
-
_t5 =
|
|
558
|
+
_t5 = valModule;
|
|
556
559
|
if (!_t5) {
|
|
557
560
|
_context2.n = 13;
|
|
558
561
|
break;
|
|
559
562
|
}
|
|
560
563
|
_context2.n = 12;
|
|
561
|
-
return fetchVal(
|
|
564
|
+
return fetchVal(valModule);
|
|
562
565
|
case 12:
|
|
563
566
|
_t5 = _context2.v;
|
|
564
567
|
case 13:
|
|
@@ -675,7 +678,18 @@ function _resolveDraftOrCommittedEntry() {
|
|
|
675
678
|
}
|
|
676
679
|
function loadDraftJsonEntry(_x7, _x8, _x9, _x0) {
|
|
677
680
|
return _loadDraftJsonEntry.apply(this, arguments);
|
|
678
|
-
}
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* Resolves ONE `.jsonValues()` entry by key, loading only that entry instead of
|
|
684
|
+
* the whole record — the runtime-scaling counterpart to the eager `fetchVal`.
|
|
685
|
+
*
|
|
686
|
+
* Production (Val disabled): resolves the entry's lazy import thunk from the
|
|
687
|
+
* locally-bundled module. One dynamic import, no server round-trip.
|
|
688
|
+
*
|
|
689
|
+
* Enabled (draft mode): reads the entry through `/json`, which replays pending
|
|
690
|
+
* patches, so uncommitted Studio edits show up. Falls back to the local thunk if
|
|
691
|
+
* the draft read yields nothing.
|
|
692
|
+
*/
|
|
679
693
|
function _loadDraftJsonEntry() {
|
|
680
694
|
_loadDraftJsonEntry = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(valServerPromise, getCookies, moduleFilePath, key) {
|
|
681
695
|
var _cookies3;
|
|
@@ -760,21 +774,10 @@ function _loadDraftJsonEntry() {
|
|
|
760
774
|
}));
|
|
761
775
|
return _loadDraftJsonEntry.apply(this, arguments);
|
|
762
776
|
}
|
|
763
|
-
/**
|
|
764
|
-
* Resolves ONE `.jsonValues()` entry by key, loading only that entry instead of
|
|
765
|
-
* the whole record — the runtime-scaling counterpart to the eager `fetchVal`.
|
|
766
|
-
*
|
|
767
|
-
* Production (Val disabled): resolves the entry's lazy import thunk from the
|
|
768
|
-
* locally-bundled module. One dynamic import, no server round-trip.
|
|
769
|
-
*
|
|
770
|
-
* Enabled (draft mode): reads the entry through `/json`, which replays pending
|
|
771
|
-
* patches, so uncommitted Studio edits show up. Falls back to the local thunk if
|
|
772
|
-
* the draft read yields nothing.
|
|
773
|
-
*/
|
|
774
777
|
var initFetchValKeyStega = function initFetchValKeyStega(valServerPromise, isEnabled, getCookies) {
|
|
775
778
|
return /*#__PURE__*/function () {
|
|
776
779
|
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(selector, key) {
|
|
777
|
-
var enabled, source, moduleFilePath, draft, content;
|
|
780
|
+
var enabled, valModule, source, moduleFilePath, draft, content;
|
|
778
781
|
return _regenerator().w(function (_context3) {
|
|
779
782
|
while (1) switch (_context3.p = _context3.n) {
|
|
780
783
|
case 0:
|
|
@@ -790,8 +793,11 @@ var initFetchValKeyStega = function initFetchValKeyStega(valServerPromise, isEna
|
|
|
790
793
|
_context3.p = 3;
|
|
791
794
|
_context3.v;
|
|
792
795
|
case 4:
|
|
793
|
-
|
|
794
|
-
|
|
796
|
+
// A view is a pointer: everything below reads a path and a source off this,
|
|
797
|
+
// and a pointer has neither. See `resolveViewedModule`.
|
|
798
|
+
valModule = Internal.resolveViewedModule(selector);
|
|
799
|
+
source = valModule && Internal.getSource(valModule);
|
|
800
|
+
moduleFilePath = valModule && Internal.getValPath(valModule);
|
|
795
801
|
draft = {
|
|
796
802
|
status: "unavailable"
|
|
797
803
|
};
|
|
@@ -819,7 +825,7 @@ var initFetchValKeyStega = function initFetchValKeyStega(valServerPromise, isEna
|
|
|
819
825
|
case 8:
|
|
820
826
|
return _context3.a(2, stegaEncode(content, {
|
|
821
827
|
disabled: !enabled,
|
|
822
|
-
root: getJsonEntryStegaRoot(
|
|
828
|
+
root: getJsonEntryStegaRoot(valModule, key)
|
|
823
829
|
}));
|
|
824
830
|
}
|
|
825
831
|
}, _callee3, null, [[1, 3]]);
|
|
@@ -832,7 +838,7 @@ var initFetchValKeyStega = function initFetchValKeyStega(valServerPromise, isEna
|
|
|
832
838
|
var initFetchValRouteUrl = function initFetchValRouteUrl(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies) {
|
|
833
839
|
return /*#__PURE__*/function () {
|
|
834
840
|
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(selector, params) {
|
|
835
|
-
var fetchVal, resolvedParams, path, schema, val, route, _t7, _t8;
|
|
841
|
+
var fetchVal, resolvedParams, valModule, path, schema, val, route, _t7, _t8;
|
|
836
842
|
return _regenerator().w(function (_context4) {
|
|
837
843
|
while (1) switch (_context4.n) {
|
|
838
844
|
case 0:
|
|
@@ -851,15 +857,18 @@ var initFetchValRouteUrl = function initFetchValRouteUrl(config, valApiEndpoints
|
|
|
851
857
|
_t7 = _context4.v;
|
|
852
858
|
case 3:
|
|
853
859
|
resolvedParams = _t7;
|
|
854
|
-
path
|
|
855
|
-
|
|
856
|
-
|
|
860
|
+
// A view is a pointer: everything below reads a path, a schema and a source
|
|
861
|
+
// off this, and a pointer has none of them. See `resolveViewedModule`.
|
|
862
|
+
valModule = Internal.resolveViewedModule(selector);
|
|
863
|
+
path = valModule && Internal.getValPath(valModule);
|
|
864
|
+
schema = valModule && Internal.getSchema(valModule);
|
|
865
|
+
_t8 = valModule;
|
|
857
866
|
if (!_t8) {
|
|
858
867
|
_context4.n = 5;
|
|
859
868
|
break;
|
|
860
869
|
}
|
|
861
870
|
_context4.n = 4;
|
|
862
|
-
return fetchVal(
|
|
871
|
+
return fetchVal(valModule);
|
|
863
872
|
case 4:
|
|
864
873
|
_t8 = _context4.v;
|
|
865
874
|
case 5:
|