@valbuild/tanstack 0.148.1 → 0.148.2

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 CHANGED
@@ -1,5 +1,34 @@
1
1
  # @valbuild/tanstack
2
2
 
3
+ ## 0.148.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#892](https://github.com/valbuild/val/pull/892) [`6f1eca1`](https://github.com/valbuild/val/commit/6f1eca14cd924bc7aa9cc573c690f8386b1d91bb) Thanks [@freekh](https://github.com/freekh)! - `<ValApp demo>` no longer says "This demo was built without its content" now and again, on a build that has its content. The demo started Val's server before `<ValModulesClient>` had registered the modules, and on a page that had the server's code already it read them before they were there. It now starts once `ValApp`'s children are rendered.
8
+
9
+ - [#889](https://github.com/valbuild/val/pull/889) [`dc7c8cc`](https://github.com/valbuild/val/commit/dc7c8ccd82f643e662d00225fabec411b5d39e3a) Thanks [@freekh](https://github.com/freekh)! - Val is quieter in your app's console. Errors and warnings you can act on still
10
+ print, now prefixed with `[val]` so you can filter them. Val's own debug
11
+ output, which used to reach your terminal and browser console, is now off by
12
+ default. That includes the `Invalid JWT` line that printed on every request
13
+ with an expired session cookie, the "verifying draft mode" and polling notices,
14
+ and the Studio's sync and WebSocket chatter.
15
+
16
+ To turn the debug output back on, for example when reporting a bug:
17
+
18
+ - on the server, set `VAL_DEBUG=1`
19
+ - in the browser, run `localStorage.setItem("val:debug", "1")` in the console.
20
+ It takes effect immediately, with no reload. Remove the key to turn it off
21
+ again.
22
+
23
+ - Updated dependencies [[`dc7c8cc`](https://github.com/valbuild/val/commit/dc7c8ccd82f643e662d00225fabec411b5d39e3a)]:
24
+ - @valbuild/core@0.148.2
25
+ - @valbuild/shared@0.148.2
26
+ - @valbuild/server@0.148.2
27
+ - @valbuild/react@0.148.2
28
+ - @valbuild/ui@0.148.2
29
+ - @valbuild/language-server@0.148.2
30
+ - @valbuild/mcp@0.148.2
31
+
3
32
  ## 0.148.1
4
33
 
5
34
  ### Patch Changes
@@ -6,8 +6,8 @@ var _typeof = require('../../dist/typeof-dd0246a1.cjs.dev.js');
6
6
  var core = require('@valbuild/core');
7
7
  var stega = require('@valbuild/react/stega');
8
8
  var React = require('react');
9
- var ValOverlayContext = require('../../dist/ValOverlayContext-510328ec.cjs.dev.js');
10
- var routeFromVal = require('../../dist/routeFromVal-0ea4586f.cjs.dev.js');
9
+ var ValOverlayContext = require('../../dist/ValOverlayContext-e5de843b.cjs.dev.js');
10
+ var routeFromVal = require('../../dist/routeFromVal-2f65a4fc.cjs.dev.js');
11
11
  require('@valbuild/core/patch');
12
12
  require('react/jsx-runtime');
13
13
  require('@valbuild/shared/client');
@@ -336,7 +336,7 @@ function resolveParams(params) {
336
336
  // diagnosable error instead of a cryptic `TypeError: React.use is not a
337
337
  // function`. Callers treat null as the error sentinel.
338
338
  if (!("use" in React__default["default"])) {
339
- console.error("Val: useValRoute received a Promise params argument but React.use is unavailable. Upgrade to React 19+ or pre-resolve the promise before passing it.");
339
+ core.Internal.log.error("useValRoute received a Promise params argument but React.use is unavailable. Upgrade to React 19+ or pre-resolve the promise before passing it.");
340
340
  return null;
341
341
  }
342
342
  return React__default["default"].use(params);
@@ -6,8 +6,8 @@ var _typeof = require('../../dist/typeof-8998e126.cjs.prod.js');
6
6
  var core = require('@valbuild/core');
7
7
  var stega = require('@valbuild/react/stega');
8
8
  var React = require('react');
9
- var ValOverlayContext = require('../../dist/ValOverlayContext-d3acd157.cjs.prod.js');
10
- var routeFromVal = require('../../dist/routeFromVal-97a52f43.cjs.prod.js');
9
+ var ValOverlayContext = require('../../dist/ValOverlayContext-98f8e877.cjs.prod.js');
10
+ var routeFromVal = require('../../dist/routeFromVal-a13ac8a3.cjs.prod.js');
11
11
  require('@valbuild/core/patch');
12
12
  require('react/jsx-runtime');
13
13
  require('@valbuild/shared/client');
@@ -336,7 +336,7 @@ function resolveParams(params) {
336
336
  // diagnosable error instead of a cryptic `TypeError: React.use is not a
337
337
  // function`. Callers treat null as the error sentinel.
338
338
  if (!("use" in React__default["default"])) {
339
- console.error("Val: useValRoute received a Promise params argument but React.use is unavailable. Upgrade to React 19+ or pre-resolve the promise before passing it.");
339
+ core.Internal.log.error("useValRoute received a Promise params argument but React.use is unavailable. Upgrade to React 19+ or pre-resolve the promise before passing it.");
340
340
  return null;
341
341
  }
342
342
  return React__default["default"].use(params);
@@ -2,8 +2,8 @@ import { c as _typeof } from '../../dist/typeof-66e2d869.esm.js';
2
2
  import { Internal } from '@valbuild/core';
3
3
  import { getModuleIds, stegaEncode } from '@valbuild/react/stega';
4
4
  import React from 'react';
5
- import { u as useValOverlayContext } from '../../dist/ValOverlayContext-6278320b.esm.js';
6
- import { j as jsonValuesRecordToFill, f as fillJsonValuesRecord, g as getJsonEntryStegaRoot, b as bundledJsonEntryImport, i as isJsonValuesRecordSchema, a as getValRouteUrlFromVal, c as initValRouteFromVal } from '../../dist/routeFromVal-9f1f8725.esm.js';
5
+ import { u as useValOverlayContext } from '../../dist/ValOverlayContext-2837c67f.esm.js';
6
+ import { j as jsonValuesRecordToFill, f as fillJsonValuesRecord, g as getJsonEntryStegaRoot, b as bundledJsonEntryImport, i as isJsonValuesRecordSchema, a as getValRouteUrlFromVal, c as initValRouteFromVal } from '../../dist/routeFromVal-40cd8a5b.esm.js';
7
7
  import '@valbuild/core/patch';
8
8
  import 'react/jsx-runtime';
9
9
  import '@valbuild/shared/client';
@@ -328,7 +328,7 @@ function resolveParams(params) {
328
328
  // diagnosable error instead of a cryptic `TypeError: React.use is not a
329
329
  // function`. Callers treat null as the error sentinel.
330
330
  if (!("use" in React)) {
331
- console.error("Val: useValRoute received a Promise params argument but React.use is unavailable. Upgrade to React 19+ or pre-resolve the promise before passing it.");
331
+ Internal.log.error("useValRoute received a Promise params argument but React.use is unavailable. Upgrade to React 19+ or pre-resolve the promise before passing it.");
332
332
  return null;
333
333
  }
334
334
  return React.use(params);
@@ -1,4 +1,5 @@
1
1
  import { f as _toPropertyKey, b as _createForOfIteratorHelper, g as _defineProperty } from './typeof-66e2d869.esm.js';
2
+ import { Internal } from '@valbuild/core';
2
3
  import { deepEqual } from '@valbuild/core/patch';
3
4
  import React from 'react';
4
5
  import { jsx } from 'react/jsx-runtime';
@@ -150,7 +151,7 @@ var ValExternalStore = /*#__PURE__*/function () {
150
151
  var missing = paths.filter(function (p) {
151
152
  return !_this.loadedSources.has(p);
152
153
  });
153
- console.error("Val: draft module(s) did not load within ".concat(LOAD_TIMEOUT_MS, "ms; rendering with partial data. Missing: ").concat(missing.join(", ")));
154
+ Internal.log.error("draft module(s) did not load within ".concat(LOAD_TIMEOUT_MS, "ms; rendering with partial data. Missing: ").concat(missing.join(", ")));
154
155
  cleanup();
155
156
  resolve();
156
157
  }, LOAD_TIMEOUT_MS);
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var _typeof = require('./typeof-8998e126.cjs.prod.js');
4
+ var core = require('@valbuild/core');
4
5
  var patch = require('@valbuild/core/patch');
5
6
  var React = require('react');
6
7
  var jsxRuntime = require('react/jsx-runtime');
@@ -156,7 +157,7 @@ var ValExternalStore = /*#__PURE__*/function () {
156
157
  var missing = paths.filter(function (p) {
157
158
  return !_this.loadedSources.has(p);
158
159
  });
159
- console.error("Val: draft module(s) did not load within ".concat(LOAD_TIMEOUT_MS, "ms; rendering with partial data. Missing: ").concat(missing.join(", ")));
160
+ core.Internal.log.error("draft module(s) did not load within ".concat(LOAD_TIMEOUT_MS, "ms; rendering with partial data. Missing: ").concat(missing.join(", ")));
160
161
  cleanup();
161
162
  resolve();
162
163
  }, LOAD_TIMEOUT_MS);
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var _typeof = require('./typeof-dd0246a1.cjs.dev.js');
4
+ var core = require('@valbuild/core');
4
5
  var patch = require('@valbuild/core/patch');
5
6
  var React = require('react');
6
7
  var jsxRuntime = require('react/jsx-runtime');
@@ -156,7 +157,7 @@ var ValExternalStore = /*#__PURE__*/function () {
156
157
  var missing = paths.filter(function (p) {
157
158
  return !_this.loadedSources.has(p);
158
159
  });
159
- console.error("Val: draft module(s) did not load within ".concat(LOAD_TIMEOUT_MS, "ms; rendering with partial data. Missing: ").concat(missing.join(", ")));
160
+ core.Internal.log.error("draft module(s) did not load within ".concat(LOAD_TIMEOUT_MS, "ms; rendering with partial data. Missing: ").concat(missing.join(", ")));
160
161
  cleanup();
161
162
  resolve();
162
163
  }, LOAD_TIMEOUT_MS);
@@ -162,34 +162,34 @@ schema,
162
162
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
163
163
  val) {
164
164
  if (!path) {
165
- console.error("Val: ".concat(methodName, " can only be used with a Val module (details: no Val path found)."));
165
+ core.Internal.log.error("".concat(methodName, " can only be used with a Val module (details: no Val path found)."));
166
166
  return null;
167
167
  }
168
168
  if (val === null) {
169
169
  return null;
170
170
  }
171
171
  if (_typeof._typeof(val) !== "object") {
172
- console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: expected type object, found ").concat(_typeof._typeof(val), " instead)."));
172
+ core.Internal.log.error("".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: expected type object, found ").concat(_typeof._typeof(val), " instead)."));
173
173
  return null;
174
174
  }
175
175
  if (Array.isArray(val)) {
176
- console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: expected type object, found array instead)."));
176
+ core.Internal.log.error("".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: expected type object, found array instead)."));
177
177
  return null;
178
178
  }
179
179
  if (!schema) {
180
- console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: no schema found)."));
180
+ core.Internal.log.error("".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: no schema found)."));
181
181
  return null;
182
182
  }
183
183
  if (!(schema instanceof core.RecordSchema)) {
184
- console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: schema is not a record)."));
184
+ core.Internal.log.error("".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: schema is not a record)."));
185
185
  } else if (!schema["currentRouter"]) {
186
- console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: router is not set)."));
186
+ core.Internal.log.error("".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: router is not set)."));
187
187
  } else if (schema["currentRouter"].getRouterId() !== core.Internal.tanstackRouter.getRouterId() && schema["currentRouter"].getRouterId() !== core.Internal.externalPageRouter.getRouterId()) {
188
- console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: router is not the TanStack Router or External URL Page Router)."));
188
+ core.Internal.log.error("".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: router is not the TanStack Router or External URL Page Router)."));
189
189
  return null;
190
190
  }
191
191
  if (_typeof._typeof(resolvedParams) !== "object") {
192
- console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: params is not an object)."));
192
+ core.Internal.log.error("".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: params is not an object)."));
193
193
  return null;
194
194
  }
195
195
  var _Internal$splitModule = core.Internal.splitModuleFilePathAndModulePath(path),
@@ -206,7 +206,7 @@ val) {
206
206
  */
207
207
  var srcFolder = client.getTanStackRouterSourceFolder(moduleFilePath);
208
208
  if (!srcFolder) {
209
- console.error("Val: ".concat(methodName, " was used with a Val module that is not in the /routes or /src/routes folder. Name the module after the route file it belongs to, e.g. /src/routes/posts.$postId.val.ts next to /src/routes/posts.$postId.tsx."));
209
+ core.Internal.log.error("".concat(methodName, " was used with a Val module that is not in the /routes or /src/routes folder. Name the module after the route file it belongs to, e.g. /src/routes/posts.$postId.val.ts next to /src/routes/posts.$postId.tsx."));
210
210
  return null;
211
211
  }
212
212
  var pattern = client.getPatternFromModuleFilePath(moduleFilePath, srcFolder);
@@ -286,11 +286,11 @@ val) {
286
286
  return "[...".concat(part.paramName, "]");
287
287
  }
288
288
  });
289
- console.error("Val: ".concat(methodName, " could not find route since parameters: ").concat(errorMessageParams.join(", "), " where not provided. Make sure the Val module is named after the route file it belongs to, e.g. /src/routes/posts.$postId.val.ts next to /src/routes/posts.$postId.tsx."));
289
+ core.Internal.log.error("".concat(methodName, " could not find route since parameters: ").concat(errorMessageParams.join(", "), " where not provided. Make sure the Val module is named after the route file it belongs to, e.g. /src/routes/posts.$postId.val.ts next to /src/routes/posts.$postId.tsx."));
290
290
  return null;
291
291
  }
292
292
  if (Object.keys(missingParamKeys).length > 0) {
293
- console.error("Val: ".concat(methodName, " could not find route since parameters: ").concat(Object.keys(missingParamKeys).join(", "), " where not found in the path of: ").concat(moduleFilePath, ". Make sure ").concat(moduleFilePath, " is named after the route file it belongs to."));
293
+ core.Internal.log.error("".concat(methodName, " could not find route since parameters: ").concat(Object.keys(missingParamKeys).join(", "), " where not found in the path of: ").concat(moduleFilePath, ". Make sure ").concat(moduleFilePath, " is named after the route file it belongs to."));
294
294
  // We do not return null here since we found a route that matches the path
295
295
  // though chances are that there's something wrong in the way ${methodName} is used
296
296
  }
@@ -160,34 +160,34 @@ schema,
160
160
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
161
161
  val) {
162
162
  if (!path) {
163
- console.error("Val: ".concat(methodName, " can only be used with a Val module (details: no Val path found)."));
163
+ Internal.log.error("".concat(methodName, " can only be used with a Val module (details: no Val path found)."));
164
164
  return null;
165
165
  }
166
166
  if (val === null) {
167
167
  return null;
168
168
  }
169
169
  if (_typeof(val) !== "object") {
170
- console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: expected type object, found ").concat(_typeof(val), " instead)."));
170
+ Internal.log.error("".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: expected type object, found ").concat(_typeof(val), " instead)."));
171
171
  return null;
172
172
  }
173
173
  if (Array.isArray(val)) {
174
- console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: expected type object, found array instead)."));
174
+ Internal.log.error("".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: expected type object, found array instead)."));
175
175
  return null;
176
176
  }
177
177
  if (!schema) {
178
- console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: no schema found)."));
178
+ Internal.log.error("".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: no schema found)."));
179
179
  return null;
180
180
  }
181
181
  if (!(schema instanceof RecordSchema)) {
182
- console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: schema is not a record)."));
182
+ Internal.log.error("".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: schema is not a record)."));
183
183
  } else if (!schema["currentRouter"]) {
184
- console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: router is not set)."));
184
+ Internal.log.error("".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: router is not set)."));
185
185
  } else if (schema["currentRouter"].getRouterId() !== Internal.tanstackRouter.getRouterId() && schema["currentRouter"].getRouterId() !== Internal.externalPageRouter.getRouterId()) {
186
- console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: router is not the TanStack Router or External URL Page Router)."));
186
+ Internal.log.error("".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: router is not the TanStack Router or External URL Page Router)."));
187
187
  return null;
188
188
  }
189
189
  if (_typeof(resolvedParams) !== "object") {
190
- console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: params is not an object)."));
190
+ Internal.log.error("".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: params is not an object)."));
191
191
  return null;
192
192
  }
193
193
  var _Internal$splitModule = Internal.splitModuleFilePathAndModulePath(path),
@@ -204,7 +204,7 @@ val) {
204
204
  */
205
205
  var srcFolder = getTanStackRouterSourceFolder(moduleFilePath);
206
206
  if (!srcFolder) {
207
- console.error("Val: ".concat(methodName, " was used with a Val module that is not in the /routes or /src/routes folder. Name the module after the route file it belongs to, e.g. /src/routes/posts.$postId.val.ts next to /src/routes/posts.$postId.tsx."));
207
+ Internal.log.error("".concat(methodName, " was used with a Val module that is not in the /routes or /src/routes folder. Name the module after the route file it belongs to, e.g. /src/routes/posts.$postId.val.ts next to /src/routes/posts.$postId.tsx."));
208
208
  return null;
209
209
  }
210
210
  var pattern = getPatternFromModuleFilePath(moduleFilePath, srcFolder);
@@ -284,11 +284,11 @@ val) {
284
284
  return "[...".concat(part.paramName, "]");
285
285
  }
286
286
  });
287
- console.error("Val: ".concat(methodName, " could not find route since parameters: ").concat(errorMessageParams.join(", "), " where not provided. Make sure the Val module is named after the route file it belongs to, e.g. /src/routes/posts.$postId.val.ts next to /src/routes/posts.$postId.tsx."));
287
+ Internal.log.error("".concat(methodName, " could not find route since parameters: ").concat(errorMessageParams.join(", "), " where not provided. Make sure the Val module is named after the route file it belongs to, e.g. /src/routes/posts.$postId.val.ts next to /src/routes/posts.$postId.tsx."));
288
288
  return null;
289
289
  }
290
290
  if (Object.keys(missingParamKeys).length > 0) {
291
- console.error("Val: ".concat(methodName, " could not find route since parameters: ").concat(Object.keys(missingParamKeys).join(", "), " where not found in the path of: ").concat(moduleFilePath, ". Make sure ").concat(moduleFilePath, " is named after the route file it belongs to."));
291
+ Internal.log.error("".concat(methodName, " could not find route since parameters: ").concat(Object.keys(missingParamKeys).join(", "), " where not found in the path of: ").concat(moduleFilePath, ". Make sure ").concat(moduleFilePath, " is named after the route file it belongs to."));
292
292
  // We do not return null here since we found a route that matches the path
293
293
  // though chances are that there's something wrong in the way ${methodName} is used
294
294
  }
@@ -162,34 +162,34 @@ schema,
162
162
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
163
163
  val) {
164
164
  if (!path) {
165
- console.error("Val: ".concat(methodName, " can only be used with a Val module (details: no Val path found)."));
165
+ core.Internal.log.error("".concat(methodName, " can only be used with a Val module (details: no Val path found)."));
166
166
  return null;
167
167
  }
168
168
  if (val === null) {
169
169
  return null;
170
170
  }
171
171
  if (_typeof._typeof(val) !== "object") {
172
- console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: expected type object, found ").concat(_typeof._typeof(val), " instead)."));
172
+ core.Internal.log.error("".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: expected type object, found ").concat(_typeof._typeof(val), " instead)."));
173
173
  return null;
174
174
  }
175
175
  if (Array.isArray(val)) {
176
- console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: expected type object, found array instead)."));
176
+ core.Internal.log.error("".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: expected type object, found array instead)."));
177
177
  return null;
178
178
  }
179
179
  if (!schema) {
180
- console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: no schema found)."));
180
+ core.Internal.log.error("".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: no schema found)."));
181
181
  return null;
182
182
  }
183
183
  if (!(schema instanceof core.RecordSchema)) {
184
- console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: schema is not a record)."));
184
+ core.Internal.log.error("".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: schema is not a record)."));
185
185
  } else if (!schema["currentRouter"]) {
186
- console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: router is not set)."));
186
+ core.Internal.log.error("".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: router is not set)."));
187
187
  } else if (schema["currentRouter"].getRouterId() !== core.Internal.tanstackRouter.getRouterId() && schema["currentRouter"].getRouterId() !== core.Internal.externalPageRouter.getRouterId()) {
188
- console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: router is not the TanStack Router or External URL Page Router)."));
188
+ core.Internal.log.error("".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: router is not the TanStack Router or External URL Page Router)."));
189
189
  return null;
190
190
  }
191
191
  if (_typeof._typeof(resolvedParams) !== "object") {
192
- console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: params is not an object)."));
192
+ core.Internal.log.error("".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: params is not an object)."));
193
193
  return null;
194
194
  }
195
195
  var _Internal$splitModule = core.Internal.splitModuleFilePathAndModulePath(path),
@@ -206,7 +206,7 @@ val) {
206
206
  */
207
207
  var srcFolder = client.getTanStackRouterSourceFolder(moduleFilePath);
208
208
  if (!srcFolder) {
209
- console.error("Val: ".concat(methodName, " was used with a Val module that is not in the /routes or /src/routes folder. Name the module after the route file it belongs to, e.g. /src/routes/posts.$postId.val.ts next to /src/routes/posts.$postId.tsx."));
209
+ core.Internal.log.error("".concat(methodName, " was used with a Val module that is not in the /routes or /src/routes folder. Name the module after the route file it belongs to, e.g. /src/routes/posts.$postId.val.ts next to /src/routes/posts.$postId.tsx."));
210
210
  return null;
211
211
  }
212
212
  var pattern = client.getPatternFromModuleFilePath(moduleFilePath, srcFolder);
@@ -286,11 +286,11 @@ val) {
286
286
  return "[...".concat(part.paramName, "]");
287
287
  }
288
288
  });
289
- console.error("Val: ".concat(methodName, " could not find route since parameters: ").concat(errorMessageParams.join(", "), " where not provided. Make sure the Val module is named after the route file it belongs to, e.g. /src/routes/posts.$postId.val.ts next to /src/routes/posts.$postId.tsx."));
289
+ core.Internal.log.error("".concat(methodName, " could not find route since parameters: ").concat(errorMessageParams.join(", "), " where not provided. Make sure the Val module is named after the route file it belongs to, e.g. /src/routes/posts.$postId.val.ts next to /src/routes/posts.$postId.tsx."));
290
290
  return null;
291
291
  }
292
292
  if (Object.keys(missingParamKeys).length > 0) {
293
- console.error("Val: ".concat(methodName, " could not find route since parameters: ").concat(Object.keys(missingParamKeys).join(", "), " where not found in the path of: ").concat(moduleFilePath, ". Make sure ").concat(moduleFilePath, " is named after the route file it belongs to."));
293
+ core.Internal.log.error("".concat(methodName, " could not find route since parameters: ").concat(Object.keys(missingParamKeys).join(", "), " where not found in the path of: ").concat(moduleFilePath, ". Make sure ").concat(moduleFilePath, " is named after the route file it belongs to."));
294
294
  // We do not return null here since we found a route that matches the path
295
295
  // though chances are that there's something wrong in the way ${methodName} is used
296
296
  }
@@ -6,12 +6,12 @@ var asyncToGenerator = require('./asyncToGenerator-c3823d62.cjs.dev.js');
6
6
  var _typeof = require('./typeof-dd0246a1.cjs.dev.js');
7
7
  var core = require('@valbuild/core');
8
8
  var stega = require('@valbuild/react/stega');
9
- var version = require('./version-fd860c4b.cjs.dev.js');
9
+ var version = require('./version-2d885c7d.cjs.dev.js');
10
10
  var internal = require('@valbuild/react/internal');
11
11
  var ui = require('@valbuild/ui');
12
12
  var reactRouter = require('@tanstack/react-router');
13
13
  var React = require('react');
14
- var ValOverlayContext = require('./ValOverlayContext-510328ec.cjs.dev.js');
14
+ var ValOverlayContext = require('./ValOverlayContext-e5de843b.cjs.dev.js');
15
15
  var client = require('@valbuild/shared/client');
16
16
  var jsxRuntime = require('react/jsx-runtime');
17
17
  var demoServiceWorker = require('./demoServiceWorker-382e1b63.cjs.dev.js');
@@ -1157,7 +1157,7 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
1157
1157
  useConsoleLogEnableVal(mountOverlay);
1158
1158
  React__default["default"].useEffect(function () {
1159
1159
  if (location.search === "?message_onready=true") {
1160
- console.warn("Val is verifying draft mode...");
1160
+ core.Internal.log.debug("verifying draft mode...");
1161
1161
  return;
1162
1162
  }
1163
1163
  if (isValStudioPath(location.pathname)) {
@@ -1324,7 +1324,7 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
1324
1324
  var valProviderOverlayListener = function valProviderOverlayListener(event) {
1325
1325
  if (event instanceof CustomEvent) {
1326
1326
  if (!(event !== null && event !== void 0 && event.detail.type)) {
1327
- console.error("Val: invalid event detail (val-overlay-provider)", event);
1327
+ core.Internal.log.error("invalid event detail (val-overlay-provider)", event);
1328
1328
  }
1329
1329
  if (event.detail.type === "spa-ready") {
1330
1330
  setSpaReady(true);
@@ -1346,10 +1346,10 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
1346
1346
  });
1347
1347
  }
1348
1348
  } else {
1349
- console.error("Val: invalid event detail (val-overlay-provider)", event.detail);
1349
+ core.Internal.log.error("invalid event detail (val-overlay-provider)", event.detail);
1350
1350
  }
1351
1351
  } else {
1352
- console.error("Val: invalid event (val-overlay-provider)", event);
1352
+ core.Internal.log.error("invalid event (val-overlay-provider)", event);
1353
1353
  }
1354
1354
  };
1355
1355
  window.addEventListener("val-overlay-provider", valProviderOverlayListener);
@@ -1394,7 +1394,7 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
1394
1394
  return;
1395
1395
  }
1396
1396
  if (res.status !== 200) {
1397
- console.error("Val: could not get draft mode status", res);
1397
+ core.Internal.log.error("could not get draft mode status", res);
1398
1398
  return;
1399
1399
  }
1400
1400
  setDraftMode(function (prev) {
@@ -1406,7 +1406,7 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
1406
1406
  return prev;
1407
1407
  });
1408
1408
  })["catch"](function (err) {
1409
- console.error("Val: could not get draft mode status", err);
1409
+ core.Internal.log.error("could not get draft mode status", err);
1410
1410
  })["finally"](function () {
1411
1411
  if (pollDraftStatIdRef.current !== pollDraftStatId) {
1412
1412
  return;
@@ -1423,7 +1423,7 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
1423
1423
  * unrecoverable, because the ONLY other thing that clears it is the
1424
1424
  * `val-ready` message the frame never sent.
1425
1425
  */
1426
- console.warn("Val: draft mode did not confirm in time. Falling back to the " + "idle poll — try toggling preview again.");
1426
+ core.Internal.log.warn("draft mode did not confirm in time. Falling back to the " + "idle poll — try toggling preview again.");
1427
1427
  setIframeSrc(null);
1428
1428
  return;
1429
1429
  }
@@ -1496,13 +1496,13 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
1496
1496
  window.dispatchEvent(new Event(VAL_EDIT_LANDED));
1497
1497
  }
1498
1498
  } else {
1499
- console.error("Val: invalid event detail", event.detail);
1499
+ core.Internal.log.error("invalid event detail", event.detail);
1500
1500
  }
1501
1501
  } else {
1502
- console.error("Val: invalid custom event details (val-event)", event.detail);
1502
+ core.Internal.log.error("invalid custom event details (val-event)", event.detail);
1503
1503
  }
1504
1504
  } else {
1505
- console.error("Val: invalid custom event (val-event)", event);
1505
+ core.Internal.log.error("invalid custom event (val-event)", event);
1506
1506
  }
1507
1507
  };
1508
1508
  window.addEventListener("val-event", reactServerComponentRefreshListener);
@@ -1671,7 +1671,7 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
1671
1671
  function useConsoleLogEnableVal(showOverlay) {
1672
1672
  React__default["default"].useEffect(function () {
1673
1673
  if (process.env["NODE_ENV"] === "development" && showOverlay === false && !isValStudioPath(location.pathname)) {
1674
- console.warn("\n###########\n###########\n########### @@@@\n########### @@\n########### @@ @@ @@@@@@ @ @@\n########### @@ @@ @@ @@ @@\n########### @@ @@ %@ @ @@\n#### ##### @@ @@ .@ .@ @@\n### #### @@@@ @@: @@@. @@\n#### ##### @@@@ @@@@ =@@@@@@@@@\n###########\n\nThis page is built with Val Build - the lightweight CMS where content is code.\n\nVal is currently hidden.\n\nTo show Val, go to the following URL:\n".concat(window.location.origin, "/api/val/enable?redirect_to=").concat(encodeURIComponent(window.location.href), "\n \nYou are seeing this message because you are in development mode."));
1674
+ core.Internal.log.warn("\n###########\n###########\n########### @@@@\n########### @@\n########### @@ @@ @@@@@@ @ @@\n########### @@ @@ @@ @@ @@\n########### @@ @@ %@ @ @@\n#### ##### @@ @@ .@ .@ @@\n### #### @@@@ @@: @@@. @@\n#### ##### @@@@ @@@@ =@@@@@@@@@\n###########\n\nThis page is built with Val Build - the lightweight CMS where content is code.\n\nVal is currently hidden.\n\nTo show Val, go to the following URL:\n".concat(window.location.origin, "/api/val/enable?redirect_to=").concat(encodeURIComponent(window.location.href), "\n \nYou are seeing this message because you are in development mode."));
1675
1675
  }
1676
1676
  }, [showOverlay]);
1677
1677
  }
@@ -1945,7 +1945,7 @@ function ValVideo(props) {
1945
1945
  }
1946
1946
  var loadHls = hlsRef.current;
1947
1947
  if (!loadHls) {
1948
- console.warn('Val: this browser cannot play HLS streams on its own. Pass `hls={() => import("hls.js")}` to ValVideo.');
1948
+ core.Internal.log.warn('this browser cannot play HLS streams on its own. Pass `hls={() => import("hls.js")}` to ValVideo.');
1949
1949
  return;
1950
1950
  }
1951
1951
  var destroyed = false;
@@ -2126,7 +2126,7 @@ function _startDemoRelay() {
2126
2126
  answer(fetch, event.data).then(function (res) {
2127
2127
  return port.postMessage(res, res.body ? [res.body] : []);
2128
2128
  })["catch"](function (err) {
2129
- console.error("Val: the demo could not answer a relayed request", err);
2129
+ core.Internal.log.error("the demo could not answer a relayed request", err);
2130
2130
  port.postMessage({
2131
2131
  status: 500,
2132
2132
  headers: [["Content-Type", "application/json"]],
@@ -2177,7 +2177,7 @@ function _startDemoRelay() {
2177
2177
  case 6:
2178
2178
  _context2.p = 6;
2179
2179
  _t2 = _context2.v;
2180
- console.error("Val: the demo's service worker did not start", _t2);
2180
+ core.Internal.log.error("the demo's service worker did not start", _t2);
2181
2181
  return _context2.a(2, false);
2182
2182
  }
2183
2183
  }, _callee2, null, [[2, 6]]);
@@ -2205,12 +2205,18 @@ var ValApp = function ValApp(_ref) {
2205
2205
  children = _ref.children,
2206
2206
  demo = _ref.demo;
2207
2207
  var route = "/api/val"; // TODO: make configurable
2208
- var demoStart = useDemoServer(demo === true, config);
2209
2208
  var _useState = React.useState(),
2210
2209
  _useState2 = _typeof._slicedToArray(_useState, 2),
2211
2210
  inMessageMode = _useState2[0],
2212
2211
  setInMessageMode = _useState2[1];
2213
2212
  var isClientSIde = inMessageMode === undefined;
2213
+ // Not before `children` are rendered, which is not on the first render: the
2214
+ // modules the demo's server needs are registered by one of them
2215
+ // (`ValModulesClient`), and a child's effects run before this component's
2216
+ // in the commit that mounts it. Started on the first render, the demo read
2217
+ // them whenever the server's code had loaded -- before the child was there,
2218
+ // on a page that had that code already.
2219
+ var demoStart = useDemoServer(demo === true && inMessageMode === false, config);
2214
2220
  useConfigStorageSave(config);
2215
2221
  var container = React.useRef(null);
2216
2222
  React.useEffect(function () {
@@ -2367,8 +2373,9 @@ var ValApp = function ValApp(_ref) {
2367
2373
  }
2368
2374
  if (demo && demoStart.status !== "ready") {
2369
2375
  // The Studio reads `window.__VAL_DEMO__` when its script starts, so the
2370
- // server it talks to has to be there first. The modules are registered
2371
- // by a child (`ValModulesClient`), whose effect has run by then.
2376
+ // server it talks to has to be there first. The children are rendered
2377
+ // meanwhile: one of them registers the modules that server is started
2378
+ // with.
2372
2379
  return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
2373
2380
  children: children
2374
2381
  });
@@ -2446,7 +2453,7 @@ function useDemoServer(demo, config) {
2446
2453
  };
2447
2454
  }();
2448
2455
  run()["catch"](function (err) {
2449
- console.error("Val: the demo could not start", err);
2456
+ core.Internal.log.error("the demo could not start", err);
2450
2457
  return {
2451
2458
  status: "failed",
2452
2459
  // Most often the server's code did not download: the page is fine,
@@ -6,12 +6,12 @@ var asyncToGenerator = require('./asyncToGenerator-8e5c36c8.cjs.prod.js');
6
6
  var _typeof = require('./typeof-8998e126.cjs.prod.js');
7
7
  var core = require('@valbuild/core');
8
8
  var stega = require('@valbuild/react/stega');
9
- var version = require('./version-684beca4.cjs.prod.js');
9
+ var version = require('./version-60499345.cjs.prod.js');
10
10
  var internal = require('@valbuild/react/internal');
11
11
  var ui = require('@valbuild/ui');
12
12
  var reactRouter = require('@tanstack/react-router');
13
13
  var React = require('react');
14
- var ValOverlayContext = require('./ValOverlayContext-d3acd157.cjs.prod.js');
14
+ var ValOverlayContext = require('./ValOverlayContext-98f8e877.cjs.prod.js');
15
15
  var client = require('@valbuild/shared/client');
16
16
  var jsxRuntime = require('react/jsx-runtime');
17
17
  var demoServiceWorker = require('./demoServiceWorker-994710f7.cjs.prod.js');
@@ -1157,7 +1157,7 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
1157
1157
  useConsoleLogEnableVal(mountOverlay);
1158
1158
  React__default["default"].useEffect(function () {
1159
1159
  if (location.search === "?message_onready=true") {
1160
- console.warn("Val is verifying draft mode...");
1160
+ core.Internal.log.debug("verifying draft mode...");
1161
1161
  return;
1162
1162
  }
1163
1163
  if (isValStudioPath(location.pathname)) {
@@ -1324,7 +1324,7 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
1324
1324
  var valProviderOverlayListener = function valProviderOverlayListener(event) {
1325
1325
  if (event instanceof CustomEvent) {
1326
1326
  if (!(event !== null && event !== void 0 && event.detail.type)) {
1327
- console.error("Val: invalid event detail (val-overlay-provider)", event);
1327
+ core.Internal.log.error("invalid event detail (val-overlay-provider)", event);
1328
1328
  }
1329
1329
  if (event.detail.type === "spa-ready") {
1330
1330
  setSpaReady(true);
@@ -1346,10 +1346,10 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
1346
1346
  });
1347
1347
  }
1348
1348
  } else {
1349
- console.error("Val: invalid event detail (val-overlay-provider)", event.detail);
1349
+ core.Internal.log.error("invalid event detail (val-overlay-provider)", event.detail);
1350
1350
  }
1351
1351
  } else {
1352
- console.error("Val: invalid event (val-overlay-provider)", event);
1352
+ core.Internal.log.error("invalid event (val-overlay-provider)", event);
1353
1353
  }
1354
1354
  };
1355
1355
  window.addEventListener("val-overlay-provider", valProviderOverlayListener);
@@ -1394,7 +1394,7 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
1394
1394
  return;
1395
1395
  }
1396
1396
  if (res.status !== 200) {
1397
- console.error("Val: could not get draft mode status", res);
1397
+ core.Internal.log.error("could not get draft mode status", res);
1398
1398
  return;
1399
1399
  }
1400
1400
  setDraftMode(function (prev) {
@@ -1406,7 +1406,7 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
1406
1406
  return prev;
1407
1407
  });
1408
1408
  })["catch"](function (err) {
1409
- console.error("Val: could not get draft mode status", err);
1409
+ core.Internal.log.error("could not get draft mode status", err);
1410
1410
  })["finally"](function () {
1411
1411
  if (pollDraftStatIdRef.current !== pollDraftStatId) {
1412
1412
  return;
@@ -1423,7 +1423,7 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
1423
1423
  * unrecoverable, because the ONLY other thing that clears it is the
1424
1424
  * `val-ready` message the frame never sent.
1425
1425
  */
1426
- console.warn("Val: draft mode did not confirm in time. Falling back to the " + "idle poll — try toggling preview again.");
1426
+ core.Internal.log.warn("draft mode did not confirm in time. Falling back to the " + "idle poll — try toggling preview again.");
1427
1427
  setIframeSrc(null);
1428
1428
  return;
1429
1429
  }
@@ -1496,13 +1496,13 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
1496
1496
  window.dispatchEvent(new Event(VAL_EDIT_LANDED));
1497
1497
  }
1498
1498
  } else {
1499
- console.error("Val: invalid event detail", event.detail);
1499
+ core.Internal.log.error("invalid event detail", event.detail);
1500
1500
  }
1501
1501
  } else {
1502
- console.error("Val: invalid custom event details (val-event)", event.detail);
1502
+ core.Internal.log.error("invalid custom event details (val-event)", event.detail);
1503
1503
  }
1504
1504
  } else {
1505
- console.error("Val: invalid custom event (val-event)", event);
1505
+ core.Internal.log.error("invalid custom event (val-event)", event);
1506
1506
  }
1507
1507
  };
1508
1508
  window.addEventListener("val-event", reactServerComponentRefreshListener);
@@ -1671,7 +1671,7 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
1671
1671
  function useConsoleLogEnableVal(showOverlay) {
1672
1672
  React__default["default"].useEffect(function () {
1673
1673
  if (process.env["NODE_ENV"] === "development" && showOverlay === false && !isValStudioPath(location.pathname)) {
1674
- console.warn("\n###########\n###########\n########### @@@@\n########### @@\n########### @@ @@ @@@@@@ @ @@\n########### @@ @@ @@ @@ @@\n########### @@ @@ %@ @ @@\n#### ##### @@ @@ .@ .@ @@\n### #### @@@@ @@: @@@. @@\n#### ##### @@@@ @@@@ =@@@@@@@@@\n###########\n\nThis page is built with Val Build - the lightweight CMS where content is code.\n\nVal is currently hidden.\n\nTo show Val, go to the following URL:\n".concat(window.location.origin, "/api/val/enable?redirect_to=").concat(encodeURIComponent(window.location.href), "\n \nYou are seeing this message because you are in development mode."));
1674
+ core.Internal.log.warn("\n###########\n###########\n########### @@@@\n########### @@\n########### @@ @@ @@@@@@ @ @@\n########### @@ @@ @@ @@ @@\n########### @@ @@ %@ @ @@\n#### ##### @@ @@ .@ .@ @@\n### #### @@@@ @@: @@@. @@\n#### ##### @@@@ @@@@ =@@@@@@@@@\n###########\n\nThis page is built with Val Build - the lightweight CMS where content is code.\n\nVal is currently hidden.\n\nTo show Val, go to the following URL:\n".concat(window.location.origin, "/api/val/enable?redirect_to=").concat(encodeURIComponent(window.location.href), "\n \nYou are seeing this message because you are in development mode."));
1675
1675
  }
1676
1676
  }, [showOverlay]);
1677
1677
  }
@@ -1945,7 +1945,7 @@ function ValVideo(props) {
1945
1945
  }
1946
1946
  var loadHls = hlsRef.current;
1947
1947
  if (!loadHls) {
1948
- console.warn('Val: this browser cannot play HLS streams on its own. Pass `hls={() => import("hls.js")}` to ValVideo.');
1948
+ core.Internal.log.warn('this browser cannot play HLS streams on its own. Pass `hls={() => import("hls.js")}` to ValVideo.');
1949
1949
  return;
1950
1950
  }
1951
1951
  var destroyed = false;
@@ -2126,7 +2126,7 @@ function _startDemoRelay() {
2126
2126
  answer(fetch, event.data).then(function (res) {
2127
2127
  return port.postMessage(res, res.body ? [res.body] : []);
2128
2128
  })["catch"](function (err) {
2129
- console.error("Val: the demo could not answer a relayed request", err);
2129
+ core.Internal.log.error("the demo could not answer a relayed request", err);
2130
2130
  port.postMessage({
2131
2131
  status: 500,
2132
2132
  headers: [["Content-Type", "application/json"]],
@@ -2177,7 +2177,7 @@ function _startDemoRelay() {
2177
2177
  case 6:
2178
2178
  _context2.p = 6;
2179
2179
  _t2 = _context2.v;
2180
- console.error("Val: the demo's service worker did not start", _t2);
2180
+ core.Internal.log.error("the demo's service worker did not start", _t2);
2181
2181
  return _context2.a(2, false);
2182
2182
  }
2183
2183
  }, _callee2, null, [[2, 6]]);
@@ -2205,12 +2205,18 @@ var ValApp = function ValApp(_ref) {
2205
2205
  children = _ref.children,
2206
2206
  demo = _ref.demo;
2207
2207
  var route = "/api/val"; // TODO: make configurable
2208
- var demoStart = useDemoServer(demo === true, config);
2209
2208
  var _useState = React.useState(),
2210
2209
  _useState2 = _typeof._slicedToArray(_useState, 2),
2211
2210
  inMessageMode = _useState2[0],
2212
2211
  setInMessageMode = _useState2[1];
2213
2212
  var isClientSIde = inMessageMode === undefined;
2213
+ // Not before `children` are rendered, which is not on the first render: the
2214
+ // modules the demo's server needs are registered by one of them
2215
+ // (`ValModulesClient`), and a child's effects run before this component's
2216
+ // in the commit that mounts it. Started on the first render, the demo read
2217
+ // them whenever the server's code had loaded -- before the child was there,
2218
+ // on a page that had that code already.
2219
+ var demoStart = useDemoServer(demo === true && inMessageMode === false, config);
2214
2220
  useConfigStorageSave(config);
2215
2221
  var container = React.useRef(null);
2216
2222
  React.useEffect(function () {
@@ -2367,8 +2373,9 @@ var ValApp = function ValApp(_ref) {
2367
2373
  }
2368
2374
  if (demo && demoStart.status !== "ready") {
2369
2375
  // The Studio reads `window.__VAL_DEMO__` when its script starts, so the
2370
- // server it talks to has to be there first. The modules are registered
2371
- // by a child (`ValModulesClient`), whose effect has run by then.
2376
+ // server it talks to has to be there first. The children are rendered
2377
+ // meanwhile: one of them registers the modules that server is started
2378
+ // with.
2372
2379
  return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
2373
2380
  children: children
2374
2381
  });
@@ -2446,7 +2453,7 @@ function useDemoServer(demo, config) {
2446
2453
  };
2447
2454
  }();
2448
2455
  run()["catch"](function (err) {
2449
- console.error("Val: the demo could not start", err);
2456
+ core.Internal.log.error("the demo could not start", err);
2450
2457
  return {
2451
2458
  status: "failed",
2452
2459
  // Most often the server's code did not download: the page is fine,
@@ -5,12 +5,12 @@ import * as core from '@valbuild/core';
5
5
  export { core as expr };
6
6
  export { GenericSelector, Schema, VAL_EXTENSION, derefPatch, modules } from '@valbuild/core';
7
7
  import { stegaEncode, stegaDecodeStrings, attrs, raw, SET_AUTO_TAG_JSX_ENABLED, autoTagJSX } from '@valbuild/react/stega';
8
- import { r as readValEnableCookie, _ as _toConsumableArray, V as VERSION$1 } from './version-a77659ce.esm.js';
8
+ import { r as readValEnableCookie, _ as _toConsumableArray, V as VERSION$1 } from './version-c7dc5935.esm.js';
9
9
  export { ValRichText } from '@valbuild/react/internal';
10
10
  import { VERSION, VAL_APP_PATH, VAL_OVERLAY_ID, VAL_APP_ID } from '@valbuild/ui';
11
11
  import { useRouter, useRouterState } from '@tanstack/react-router';
12
12
  import React, { useEffect, useRef, useState } from 'react';
13
- import { V as ValExternalStore, a as ValOverlayProvider } from './ValOverlayContext-6278320b.esm.js';
13
+ import { V as ValExternalStore, a as ValOverlayProvider } from './ValOverlayContext-2837c67f.esm.js';
14
14
  import { VAL_CONFIG_SESSION_STORAGE_KEY, VAL_THEME_SESSION_STORAGE_KEY, VAL_CANVAS_MESSAGE, DEFAULT_CANVAS_SELECTION, DEFAULT_CANVAS_SELECTION_SOFT, isValCanvasStudioMessage, isValCanvasFrame } from '@valbuild/shared/client';
15
15
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
16
16
  import { D as DEMO_CLAIM_MESSAGE, a as DEMO_SERVICE_WORKER_PATH, b as DEMO_RELAY_MESSAGE } from './demoServiceWorker-56fd96cf.esm.js';
@@ -1133,7 +1133,7 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
1133
1133
  useConsoleLogEnableVal(mountOverlay);
1134
1134
  React.useEffect(function () {
1135
1135
  if (location.search === "?message_onready=true") {
1136
- console.warn("Val is verifying draft mode...");
1136
+ Internal$1.log.debug("verifying draft mode...");
1137
1137
  return;
1138
1138
  }
1139
1139
  if (isValStudioPath(location.pathname)) {
@@ -1300,7 +1300,7 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
1300
1300
  var valProviderOverlayListener = function valProviderOverlayListener(event) {
1301
1301
  if (event instanceof CustomEvent) {
1302
1302
  if (!(event !== null && event !== void 0 && event.detail.type)) {
1303
- console.error("Val: invalid event detail (val-overlay-provider)", event);
1303
+ Internal$1.log.error("invalid event detail (val-overlay-provider)", event);
1304
1304
  }
1305
1305
  if (event.detail.type === "spa-ready") {
1306
1306
  setSpaReady(true);
@@ -1322,10 +1322,10 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
1322
1322
  });
1323
1323
  }
1324
1324
  } else {
1325
- console.error("Val: invalid event detail (val-overlay-provider)", event.detail);
1325
+ Internal$1.log.error("invalid event detail (val-overlay-provider)", event.detail);
1326
1326
  }
1327
1327
  } else {
1328
- console.error("Val: invalid event (val-overlay-provider)", event);
1328
+ Internal$1.log.error("invalid event (val-overlay-provider)", event);
1329
1329
  }
1330
1330
  };
1331
1331
  window.addEventListener("val-overlay-provider", valProviderOverlayListener);
@@ -1370,7 +1370,7 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
1370
1370
  return;
1371
1371
  }
1372
1372
  if (res.status !== 200) {
1373
- console.error("Val: could not get draft mode status", res);
1373
+ Internal$1.log.error("could not get draft mode status", res);
1374
1374
  return;
1375
1375
  }
1376
1376
  setDraftMode(function (prev) {
@@ -1382,7 +1382,7 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
1382
1382
  return prev;
1383
1383
  });
1384
1384
  })["catch"](function (err) {
1385
- console.error("Val: could not get draft mode status", err);
1385
+ Internal$1.log.error("could not get draft mode status", err);
1386
1386
  })["finally"](function () {
1387
1387
  if (pollDraftStatIdRef.current !== pollDraftStatId) {
1388
1388
  return;
@@ -1399,7 +1399,7 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
1399
1399
  * unrecoverable, because the ONLY other thing that clears it is the
1400
1400
  * `val-ready` message the frame never sent.
1401
1401
  */
1402
- console.warn("Val: draft mode did not confirm in time. Falling back to the " + "idle poll — try toggling preview again.");
1402
+ Internal$1.log.warn("draft mode did not confirm in time. Falling back to the " + "idle poll — try toggling preview again.");
1403
1403
  setIframeSrc(null);
1404
1404
  return;
1405
1405
  }
@@ -1472,13 +1472,13 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
1472
1472
  window.dispatchEvent(new Event(VAL_EDIT_LANDED));
1473
1473
  }
1474
1474
  } else {
1475
- console.error("Val: invalid event detail", event.detail);
1475
+ Internal$1.log.error("invalid event detail", event.detail);
1476
1476
  }
1477
1477
  } else {
1478
- console.error("Val: invalid custom event details (val-event)", event.detail);
1478
+ Internal$1.log.error("invalid custom event details (val-event)", event.detail);
1479
1479
  }
1480
1480
  } else {
1481
- console.error("Val: invalid custom event (val-event)", event);
1481
+ Internal$1.log.error("invalid custom event (val-event)", event);
1482
1482
  }
1483
1483
  };
1484
1484
  window.addEventListener("val-event", reactServerComponentRefreshListener);
@@ -1647,7 +1647,7 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
1647
1647
  function useConsoleLogEnableVal(showOverlay) {
1648
1648
  React.useEffect(function () {
1649
1649
  if (process.env["NODE_ENV"] === "development" && showOverlay === false && !isValStudioPath(location.pathname)) {
1650
- console.warn("\n###########\n###########\n########### @@@@\n########### @@\n########### @@ @@ @@@@@@ @ @@\n########### @@ @@ @@ @@ @@\n########### @@ @@ %@ @ @@\n#### ##### @@ @@ .@ .@ @@\n### #### @@@@ @@: @@@. @@\n#### ##### @@@@ @@@@ =@@@@@@@@@\n###########\n\nThis page is built with Val Build - the lightweight CMS where content is code.\n\nVal is currently hidden.\n\nTo show Val, go to the following URL:\n".concat(window.location.origin, "/api/val/enable?redirect_to=").concat(encodeURIComponent(window.location.href), "\n \nYou are seeing this message because you are in development mode."));
1650
+ Internal$1.log.warn("\n###########\n###########\n########### @@@@\n########### @@\n########### @@ @@ @@@@@@ @ @@\n########### @@ @@ @@ @@ @@\n########### @@ @@ %@ @ @@\n#### ##### @@ @@ .@ .@ @@\n### #### @@@@ @@: @@@. @@\n#### ##### @@@@ @@@@ =@@@@@@@@@\n###########\n\nThis page is built with Val Build - the lightweight CMS where content is code.\n\nVal is currently hidden.\n\nTo show Val, go to the following URL:\n".concat(window.location.origin, "/api/val/enable?redirect_to=").concat(encodeURIComponent(window.location.href), "\n \nYou are seeing this message because you are in development mode."));
1651
1651
  }
1652
1652
  }, [showOverlay]);
1653
1653
  }
@@ -1921,7 +1921,7 @@ function ValVideo(props) {
1921
1921
  }
1922
1922
  var loadHls = hlsRef.current;
1923
1923
  if (!loadHls) {
1924
- console.warn('Val: this browser cannot play HLS streams on its own. Pass `hls={() => import("hls.js")}` to ValVideo.');
1924
+ Internal$1.log.warn('this browser cannot play HLS streams on its own. Pass `hls={() => import("hls.js")}` to ValVideo.');
1925
1925
  return;
1926
1926
  }
1927
1927
  var destroyed = false;
@@ -2102,7 +2102,7 @@ function _startDemoRelay() {
2102
2102
  answer(fetch, event.data).then(function (res) {
2103
2103
  return port.postMessage(res, res.body ? [res.body] : []);
2104
2104
  })["catch"](function (err) {
2105
- console.error("Val: the demo could not answer a relayed request", err);
2105
+ Internal$1.log.error("the demo could not answer a relayed request", err);
2106
2106
  port.postMessage({
2107
2107
  status: 500,
2108
2108
  headers: [["Content-Type", "application/json"]],
@@ -2153,7 +2153,7 @@ function _startDemoRelay() {
2153
2153
  case 6:
2154
2154
  _context2.p = 6;
2155
2155
  _t2 = _context2.v;
2156
- console.error("Val: the demo's service worker did not start", _t2);
2156
+ Internal$1.log.error("the demo's service worker did not start", _t2);
2157
2157
  return _context2.a(2, false);
2158
2158
  }
2159
2159
  }, _callee2, null, [[2, 6]]);
@@ -2181,12 +2181,18 @@ var ValApp = function ValApp(_ref) {
2181
2181
  children = _ref.children,
2182
2182
  demo = _ref.demo;
2183
2183
  var route = "/api/val"; // TODO: make configurable
2184
- var demoStart = useDemoServer(demo === true, config);
2185
2184
  var _useState = useState(),
2186
2185
  _useState2 = _slicedToArray(_useState, 2),
2187
2186
  inMessageMode = _useState2[0],
2188
2187
  setInMessageMode = _useState2[1];
2189
2188
  var isClientSIde = inMessageMode === undefined;
2189
+ // Not before `children` are rendered, which is not on the first render: the
2190
+ // modules the demo's server needs are registered by one of them
2191
+ // (`ValModulesClient`), and a child's effects run before this component's
2192
+ // in the commit that mounts it. Started on the first render, the demo read
2193
+ // them whenever the server's code had loaded -- before the child was there,
2194
+ // on a page that had that code already.
2195
+ var demoStart = useDemoServer(demo === true && inMessageMode === false, config);
2190
2196
  useConfigStorageSave(config);
2191
2197
  var container = useRef(null);
2192
2198
  useEffect(function () {
@@ -2343,8 +2349,9 @@ var ValApp = function ValApp(_ref) {
2343
2349
  }
2344
2350
  if (demo && demoStart.status !== "ready") {
2345
2351
  // The Studio reads `window.__VAL_DEMO__` when its script starts, so the
2346
- // server it talks to has to be there first. The modules are registered
2347
- // by a child (`ValModulesClient`), whose effect has run by then.
2352
+ // server it talks to has to be there first. The children are rendered
2353
+ // meanwhile: one of them registers the modules that server is started
2354
+ // with.
2348
2355
  return /*#__PURE__*/jsx(Fragment, {
2349
2356
  children: children
2350
2357
  });
@@ -2422,7 +2429,7 @@ function useDemoServer(demo, config) {
2422
2429
  };
2423
2430
  }();
2424
2431
  run()["catch"](function (err) {
2425
- console.error("Val: the demo could not start", err);
2432
+ Internal$1.log.error("the demo could not start", err);
2426
2433
  return {
2427
2434
  status: "failed",
2428
2435
  // Most often the server's code did not download: the page is fine,
@@ -95,7 +95,7 @@ var packageJson = {
95
95
  "tanstack-router",
96
96
  "react"
97
97
  ],
98
- version: "0.148.1",
98
+ version: "0.148.2",
99
99
  scripts: {
100
100
  typecheck: "tsc --noEmit",
101
101
  test: "jest"
@@ -95,7 +95,7 @@ var packageJson = {
95
95
  "tanstack-router",
96
96
  "react"
97
97
  ],
98
- version: "0.148.1",
98
+ version: "0.148.2",
99
99
  scripts: {
100
100
  typecheck: "tsc --noEmit",
101
101
  test: "jest"
@@ -93,7 +93,7 @@ var packageJson = {
93
93
  "tanstack-router",
94
94
  "react"
95
95
  ],
96
- version: "0.148.1",
96
+ version: "0.148.2",
97
97
  scripts: {
98
98
  typecheck: "tsc --noEmit",
99
99
  test: "jest"
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "tanstack-router",
15
15
  "react"
16
16
  ],
17
- "version": "0.148.1",
17
+ "version": "0.148.2",
18
18
  "main": "dist/valbuild-tanstack.cjs.js",
19
19
  "module": "dist/valbuild-tanstack.esm.js",
20
20
  "exports": {
@@ -47,13 +47,13 @@
47
47
  "exports": true
48
48
  },
49
49
  "dependencies": {
50
- "@valbuild/core": "0.148.0",
51
- "@valbuild/language-server": "0.148.1",
52
- "@valbuild/mcp": "0.148.1",
53
- "@valbuild/react": "0.148.1",
54
- "@valbuild/server": "0.148.1",
55
- "@valbuild/shared": "0.148.0",
56
- "@valbuild/ui": "0.148.1"
50
+ "@valbuild/core": "0.148.2",
51
+ "@valbuild/language-server": "0.148.2",
52
+ "@valbuild/mcp": "0.148.2",
53
+ "@valbuild/react": "0.148.2",
54
+ "@valbuild/server": "0.148.2",
55
+ "@valbuild/shared": "0.148.2",
56
+ "@valbuild/ui": "0.148.2"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@tanstack/react-router": "^1.170.41",
@@ -2,14 +2,14 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = require('../../dist/version-fd860c4b.cjs.dev.js');
5
+ var version = require('../../dist/version-2d885c7d.cjs.dev.js');
6
6
  var asyncToGenerator = require('../../dist/asyncToGenerator-c3823d62.cjs.dev.js');
7
7
  var core = require('@valbuild/core');
8
8
  var _typeof = require('../../dist/typeof-dd0246a1.cjs.dev.js');
9
9
  var server = require('@valbuild/server');
10
10
  var stega = require('@valbuild/react/stega');
11
11
  var internal = require('@valbuild/shared/internal');
12
- var routeFromVal = require('../../dist/routeFromVal-0ea4586f.cjs.dev.js');
12
+ var routeFromVal = require('../../dist/routeFromVal-2f65a4fc.cjs.dev.js');
13
13
  var mcp = require('@valbuild/mcp');
14
14
  require('@valbuild/shared/client');
15
15
 
@@ -463,7 +463,7 @@ function _loadDraftSources() {
463
463
  _context8.n = 4;
464
464
  break;
465
465
  }
466
- console.warn("Val: authentication error: ", treeRes.json.message);
466
+ core.Internal.log.debug("authentication error: ", treeRes.json.message);
467
467
  return _context8.a(2, null);
468
468
  case 4:
469
469
  throw Error(JSON.stringify(treeRes.json, null, 2));
@@ -493,7 +493,7 @@ var initFetchValStega = function initFetchValStega(config, valApiEndpoints, valS
493
493
  case 3:
494
494
  _context2.p = 3;
495
495
  _t2 = _context2.v;
496
- console.error("Val: could not check if Val is enabled! This might be due to an error reading draft mode. fetchVal can only be used server-side (in a loader, a server function, or a server route). Use useVal in components.", _t2);
496
+ core.Internal.log.error("could not check if Val is enabled! This might be due to an error reading draft mode. fetchVal can only be used server-side (in a loader, a server function, or a server route). Use useVal in components.", _t2);
497
497
  case 4:
498
498
  if (!enabled) {
499
499
  _context2.n = 16;
@@ -516,7 +516,7 @@ var initFetchValStega = function initFetchValStega(config, valApiEndpoints, valS
516
516
  case 8:
517
517
  _context2.p = 8;
518
518
  _t3 = _context2.v;
519
- console.error("Val: could not read headers! fetchVal can only be used server-side (in a loader, a server function, or a server route). Use useVal in components.", _t3);
519
+ core.Internal.log.error("could not read headers! fetchVal can only be used server-side (in a loader, a server function, or a server route). Use useVal in components.", _t3);
520
520
  headers = null;
521
521
  case 9:
522
522
  _context2.p = 9;
@@ -529,7 +529,7 @@ var initFetchValStega = function initFetchValStega(config, valApiEndpoints, valS
529
529
  case 11:
530
530
  _context2.p = 11;
531
531
  _t4 = _context2.v;
532
- console.error("Val: could not read cookies! fetchVal can only be used server-side (in a loader, a server function, or a server route). Use useVal in components.", _t4);
532
+ core.Internal.log.error("could not read cookies! fetchVal can only be used server-side (in a loader, a server function, or a server route). Use useVal in components.", _t4);
533
533
  cookies = null;
534
534
  case 12:
535
535
  host = headers && getHost(headers);
@@ -605,7 +605,7 @@ var initFetchValStega = function initFetchValStega(config, valApiEndpoints, valS
605
605
  return asyncToGenerator._regenerator().w(function (_context3) {
606
606
  while (1) switch (_context3.n) {
607
607
  case 0:
608
- console.error("Val: failed to fetch ", err);
608
+ core.Internal.log.error("failed to fetch ", err);
609
609
  _t12 = stega.stegaEncode;
610
610
  _t13 = selector;
611
611
  _context3.n = 1;
@@ -859,7 +859,7 @@ var initFetchValDraft = function initFetchValDraft(valServerPromise, isEnabled,
859
859
  _t19 = _context4.v;
860
860
  // Published content, as before this existed: a draft page that renders
861
861
  // the site is a degraded preview, one that fails to render is an outage.
862
- console.error("Val: could not read the draft", _t19);
862
+ core.Internal.log.error("could not read the draft", _t19);
863
863
  return _context4.a(2, onlySnapshot);
864
864
  }
865
865
  }, _callee4, null, [[1, 16]]);
@@ -1404,7 +1404,7 @@ function _loadDraftJsonEntry() {
1404
1404
  _context12.n = 7;
1405
1405
  break;
1406
1406
  }
1407
- console.warn("Val: authentication error: ", res.json.message);
1407
+ core.Internal.log.debug("authentication error: ", res.json.message);
1408
1408
  return _context12.a(2, {
1409
1409
  status: "unavailable"
1410
1410
  });
@@ -1417,7 +1417,7 @@ function _loadDraftJsonEntry() {
1417
1417
  status: "absent"
1418
1418
  });
1419
1419
  case 8:
1420
- console.error("Val: could not load draft JSON entry: ", "message" in res.json ? res.json.message : "status ".concat(res.status));
1420
+ core.Internal.log.error("could not load draft JSON entry: ", "message" in res.json ? res.json.message : "status ".concat(res.status));
1421
1421
  return _context12.a(2, {
1422
1422
  status: "unavailable"
1423
1423
  });
@@ -2,14 +2,14 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = require('../../dist/version-684beca4.cjs.prod.js');
5
+ var version = require('../../dist/version-60499345.cjs.prod.js');
6
6
  var asyncToGenerator = require('../../dist/asyncToGenerator-8e5c36c8.cjs.prod.js');
7
7
  var core = require('@valbuild/core');
8
8
  var _typeof = require('../../dist/typeof-8998e126.cjs.prod.js');
9
9
  var server = require('@valbuild/server');
10
10
  var stega = require('@valbuild/react/stega');
11
11
  var internal = require('@valbuild/shared/internal');
12
- var routeFromVal = require('../../dist/routeFromVal-97a52f43.cjs.prod.js');
12
+ var routeFromVal = require('../../dist/routeFromVal-a13ac8a3.cjs.prod.js');
13
13
  var mcp = require('@valbuild/mcp');
14
14
  require('@valbuild/shared/client');
15
15
 
@@ -463,7 +463,7 @@ function _loadDraftSources() {
463
463
  _context8.n = 4;
464
464
  break;
465
465
  }
466
- console.warn("Val: authentication error: ", treeRes.json.message);
466
+ core.Internal.log.debug("authentication error: ", treeRes.json.message);
467
467
  return _context8.a(2, null);
468
468
  case 4:
469
469
  throw Error(JSON.stringify(treeRes.json, null, 2));
@@ -493,7 +493,7 @@ var initFetchValStega = function initFetchValStega(config, valApiEndpoints, valS
493
493
  case 3:
494
494
  _context2.p = 3;
495
495
  _t2 = _context2.v;
496
- console.error("Val: could not check if Val is enabled! This might be due to an error reading draft mode. fetchVal can only be used server-side (in a loader, a server function, or a server route). Use useVal in components.", _t2);
496
+ core.Internal.log.error("could not check if Val is enabled! This might be due to an error reading draft mode. fetchVal can only be used server-side (in a loader, a server function, or a server route). Use useVal in components.", _t2);
497
497
  case 4:
498
498
  if (!enabled) {
499
499
  _context2.n = 16;
@@ -516,7 +516,7 @@ var initFetchValStega = function initFetchValStega(config, valApiEndpoints, valS
516
516
  case 8:
517
517
  _context2.p = 8;
518
518
  _t3 = _context2.v;
519
- console.error("Val: could not read headers! fetchVal can only be used server-side (in a loader, a server function, or a server route). Use useVal in components.", _t3);
519
+ core.Internal.log.error("could not read headers! fetchVal can only be used server-side (in a loader, a server function, or a server route). Use useVal in components.", _t3);
520
520
  headers = null;
521
521
  case 9:
522
522
  _context2.p = 9;
@@ -529,7 +529,7 @@ var initFetchValStega = function initFetchValStega(config, valApiEndpoints, valS
529
529
  case 11:
530
530
  _context2.p = 11;
531
531
  _t4 = _context2.v;
532
- console.error("Val: could not read cookies! fetchVal can only be used server-side (in a loader, a server function, or a server route). Use useVal in components.", _t4);
532
+ core.Internal.log.error("could not read cookies! fetchVal can only be used server-side (in a loader, a server function, or a server route). Use useVal in components.", _t4);
533
533
  cookies = null;
534
534
  case 12:
535
535
  host = headers && getHost(headers);
@@ -605,7 +605,7 @@ var initFetchValStega = function initFetchValStega(config, valApiEndpoints, valS
605
605
  return asyncToGenerator._regenerator().w(function (_context3) {
606
606
  while (1) switch (_context3.n) {
607
607
  case 0:
608
- console.error("Val: failed to fetch ", err);
608
+ core.Internal.log.error("failed to fetch ", err);
609
609
  _t12 = stega.stegaEncode;
610
610
  _t13 = selector;
611
611
  _context3.n = 1;
@@ -859,7 +859,7 @@ var initFetchValDraft = function initFetchValDraft(valServerPromise, isEnabled,
859
859
  _t19 = _context4.v;
860
860
  // Published content, as before this existed: a draft page that renders
861
861
  // the site is a degraded preview, one that fails to render is an outage.
862
- console.error("Val: could not read the draft", _t19);
862
+ core.Internal.log.error("could not read the draft", _t19);
863
863
  return _context4.a(2, onlySnapshot);
864
864
  }
865
865
  }, _callee4, null, [[1, 16]]);
@@ -1404,7 +1404,7 @@ function _loadDraftJsonEntry() {
1404
1404
  _context12.n = 7;
1405
1405
  break;
1406
1406
  }
1407
- console.warn("Val: authentication error: ", res.json.message);
1407
+ core.Internal.log.debug("authentication error: ", res.json.message);
1408
1408
  return _context12.a(2, {
1409
1409
  status: "unavailable"
1410
1410
  });
@@ -1417,7 +1417,7 @@ function _loadDraftJsonEntry() {
1417
1417
  status: "absent"
1418
1418
  });
1419
1419
  case 8:
1420
- console.error("Val: could not load draft JSON entry: ", "message" in res.json ? res.json.message : "status ".concat(res.status));
1420
+ core.Internal.log.error("could not load draft JSON entry: ", "message" in res.json ? res.json.message : "status ".concat(res.status));
1421
1421
  return _context12.a(2, {
1422
1422
  status: "unavailable"
1423
1423
  });
@@ -1,4 +1,4 @@
1
- import { V as VERSION, _ as _toConsumableArray, s as setValEnableCookieReader } from '../../dist/version-a77659ce.esm.js';
1
+ import { V as VERSION, _ as _toConsumableArray, s as setValEnableCookieReader } from '../../dist/version-c7dc5935.esm.js';
2
2
  import { _ as _asyncToGenerator, a as _regenerator } from '../../dist/asyncToGenerator-500f022f.esm.js';
3
3
  import { Internal } from '@valbuild/core';
4
4
  import { _ as _objectSpread2, a as _slicedToArray, b as _createForOfIteratorHelper, g as _defineProperty, c as _typeof } from '../../dist/typeof-66e2d869.esm.js';
@@ -6,7 +6,7 @@ import { createValApiRouter, createValServer, layeredSnapshot, proposalSnapshotF
6
6
  export { InMemoryPatchStore, createPrettierFormatter } from '@valbuild/server';
7
7
  import { stegaEncode, SET_AUTO_TAG_JSX_ENABLED } from '@valbuild/react/stega';
8
8
  import { memoizePerRequest, VAL_SESSION_COOKIE, JSON_ENTRIES_BATCH_MAX } from '@valbuild/shared/internal';
9
- import { f as fillJsonValuesRecord, j as jsonValuesRecordToFill, c as initValRouteFromVal, g as getJsonEntryStegaRoot, i as isJsonValuesRecordSchema, a as getValRouteUrlFromVal, b as bundledJsonEntryImport } from '../../dist/routeFromVal-9f1f8725.esm.js';
9
+ import { f as fillJsonValuesRecord, j as jsonValuesRecordToFill, c as initValRouteFromVal, g as getJsonEntryStegaRoot, i as isJsonValuesRecordSchema, a as getValRouteUrlFromVal, b as bundledJsonEntryImport } from '../../dist/routeFromVal-40cd8a5b.esm.js';
10
10
  import { initValMcp as initValMcp$1 } from '@valbuild/mcp';
11
11
  import '@valbuild/shared/client';
12
12
 
@@ -442,7 +442,7 @@ function _loadDraftSources() {
442
442
  _context8.n = 4;
443
443
  break;
444
444
  }
445
- console.warn("Val: authentication error: ", treeRes.json.message);
445
+ Internal.log.debug("authentication error: ", treeRes.json.message);
446
446
  return _context8.a(2, null);
447
447
  case 4:
448
448
  throw Error(JSON.stringify(treeRes.json, null, 2));
@@ -472,7 +472,7 @@ var initFetchValStega = function initFetchValStega(config, valApiEndpoints, valS
472
472
  case 3:
473
473
  _context2.p = 3;
474
474
  _t2 = _context2.v;
475
- console.error("Val: could not check if Val is enabled! This might be due to an error reading draft mode. fetchVal can only be used server-side (in a loader, a server function, or a server route). Use useVal in components.", _t2);
475
+ Internal.log.error("could not check if Val is enabled! This might be due to an error reading draft mode. fetchVal can only be used server-side (in a loader, a server function, or a server route). Use useVal in components.", _t2);
476
476
  case 4:
477
477
  if (!enabled) {
478
478
  _context2.n = 16;
@@ -495,7 +495,7 @@ var initFetchValStega = function initFetchValStega(config, valApiEndpoints, valS
495
495
  case 8:
496
496
  _context2.p = 8;
497
497
  _t3 = _context2.v;
498
- console.error("Val: could not read headers! fetchVal can only be used server-side (in a loader, a server function, or a server route). Use useVal in components.", _t3);
498
+ Internal.log.error("could not read headers! fetchVal can only be used server-side (in a loader, a server function, or a server route). Use useVal in components.", _t3);
499
499
  headers = null;
500
500
  case 9:
501
501
  _context2.p = 9;
@@ -508,7 +508,7 @@ var initFetchValStega = function initFetchValStega(config, valApiEndpoints, valS
508
508
  case 11:
509
509
  _context2.p = 11;
510
510
  _t4 = _context2.v;
511
- console.error("Val: could not read cookies! fetchVal can only be used server-side (in a loader, a server function, or a server route). Use useVal in components.", _t4);
511
+ Internal.log.error("could not read cookies! fetchVal can only be used server-side (in a loader, a server function, or a server route). Use useVal in components.", _t4);
512
512
  cookies = null;
513
513
  case 12:
514
514
  host = headers && getHost(headers);
@@ -584,7 +584,7 @@ var initFetchValStega = function initFetchValStega(config, valApiEndpoints, valS
584
584
  return _regenerator().w(function (_context3) {
585
585
  while (1) switch (_context3.n) {
586
586
  case 0:
587
- console.error("Val: failed to fetch ", err);
587
+ Internal.log.error("failed to fetch ", err);
588
588
  _t12 = stegaEncode;
589
589
  _t13 = selector;
590
590
  _context3.n = 1;
@@ -838,7 +838,7 @@ var initFetchValDraft = function initFetchValDraft(valServerPromise, isEnabled,
838
838
  _t19 = _context4.v;
839
839
  // Published content, as before this existed: a draft page that renders
840
840
  // the site is a degraded preview, one that fails to render is an outage.
841
- console.error("Val: could not read the draft", _t19);
841
+ Internal.log.error("could not read the draft", _t19);
842
842
  return _context4.a(2, onlySnapshot);
843
843
  }
844
844
  }, _callee4, null, [[1, 16]]);
@@ -1383,7 +1383,7 @@ function _loadDraftJsonEntry() {
1383
1383
  _context12.n = 7;
1384
1384
  break;
1385
1385
  }
1386
- console.warn("Val: authentication error: ", res.json.message);
1386
+ Internal.log.debug("authentication error: ", res.json.message);
1387
1387
  return _context12.a(2, {
1388
1388
  status: "unavailable"
1389
1389
  });
@@ -1396,7 +1396,7 @@ function _loadDraftJsonEntry() {
1396
1396
  status: "absent"
1397
1397
  });
1398
1398
  case 8:
1399
- console.error("Val: could not load draft JSON entry: ", "message" in res.json ? res.json.message : "status ".concat(res.status));
1399
+ Internal.log.error("could not load draft JSON entry: ", "message" in res.json ? res.json.message : "status ".concat(res.status));
1400
1400
  return _context12.a(2, {
1401
1401
  status: "unavailable"
1402
1402
  });