@valbuild/tanstack 0.150.1 → 0.150.3

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,36 @@
1
1
  # @valbuild/tanstack
2
2
 
3
+ ## 0.150.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`bc0cc43`](https://github.com/valbuild/val/commit/bc0cc433e157cca08f9ee384a4fb8be9bd3dad2c)]:
8
+ - @valbuild/ui@0.150.3
9
+ - @valbuild/core@0.150.3
10
+ - @valbuild/shared@0.150.3
11
+ - @valbuild/react@0.150.3
12
+ - @valbuild/server@0.150.3
13
+ - @valbuild/language-server@0.150.3
14
+ - @valbuild/mcp@0.150.3
15
+
16
+ ## 0.150.2
17
+
18
+ ### Patch Changes
19
+
20
+ - [#946](https://github.com/valbuild/val/pull/946) [`e24dc6e`](https://github.com/valbuild/val/commit/e24dc6e56e7647654e27ee2390d2181b0eaff3ad) Thanks [@freekh](https://github.com/freekh)! - Content analytics now warns in development about edit tags that leak out of React. With analytics on, `ValProvider` looks at the page as a visitor gets it and names every place content arrived with its edit tag still in it: a `<title>`, a `<meta>`, JSON-LD, a share link built with `encodeURIComponent`, or any other attribute or text. Each warning says which content it was and where, and that `val.raw()` fixes it. Open the site in a window where Val is not enabled to see them; production never runs the check.
21
+
22
+ Also fixed: text inside a fragment (`<li>{a}<> — {b}</></li>`) kept its edit tag on the page. It is now cleaned, and the element the fragment sits in is tagged with its content instead.
23
+
24
+ - [#944](https://github.com/valbuild/val/pull/944) [`155a079`](https://github.com/valbuild/val/commit/155a0792c2a437a1cbcdd6342131999be70e0d70) Thanks [@freekh](https://github.com/freekh)! - A TanStack splat route now has a page of its own. `src/routes/docs.$.tsx` serves `/docs` as well as everything under it, the way TanStack Router matches it, and `/docs` is now a valid key in its Val module. It used to be refused ("does not match `/docs/[..._splat]`"), so the page TanStack served at `/docs` could not be given content. `useValRoute` on that page reads the `/docs` entry.
25
+ - Updated dependencies [[`e24dc6e`](https://github.com/valbuild/val/commit/e24dc6e56e7647654e27ee2390d2181b0eaff3ad), [`c674aae`](https://github.com/valbuild/val/commit/c674aae361be3c75b5232acb41ea6d8da973c678), [`c044e55`](https://github.com/valbuild/val/commit/c044e55452ba34ec5b7b38c935c9c25491d980be), [`36412b2`](https://github.com/valbuild/val/commit/36412b28bb009083f652b26462b76a74c80ff595), [`155a079`](https://github.com/valbuild/val/commit/155a0792c2a437a1cbcdd6342131999be70e0d70), [`8f598b6`](https://github.com/valbuild/val/commit/8f598b618b794e59ef5b9c6ef94650be4ff006e7), [`95d17e6`](https://github.com/valbuild/val/commit/95d17e6bbecceb2f09d6a6226808e9c60b2d4795), [`520d22c`](https://github.com/valbuild/val/commit/520d22cc721ff23b83e4bae0b4ba7f52a6a0fa0c)]:
26
+ - @valbuild/react@0.150.2
27
+ - @valbuild/ui@0.150.2
28
+ - @valbuild/shared@0.150.2
29
+ - @valbuild/core@0.150.2
30
+ - @valbuild/server@0.150.2
31
+ - @valbuild/language-server@0.150.2
32
+ - @valbuild/mcp@0.150.2
33
+
3
34
  ## 0.150.1
4
35
 
5
36
  ### Patch Changes
@@ -7,7 +7,7 @@ var core = require('@valbuild/core');
7
7
  var stega = require('@valbuild/react/stega');
8
8
  var React = require('react');
9
9
  var ValOverlayContext = require('../../dist/ValOverlayContext-198b4bd1.cjs.dev.js');
10
- var routeFromVal = require('../../dist/routeFromVal-2f65a4fc.cjs.dev.js');
10
+ var routeFromVal = require('../../dist/routeFromVal-3c3915e2.cjs.dev.js');
11
11
  require('@valbuild/core/patch');
12
12
  require('react/jsx-runtime');
13
13
  require('@valbuild/shared/client');
@@ -7,7 +7,7 @@ var core = require('@valbuild/core');
7
7
  var stega = require('@valbuild/react/stega');
8
8
  var React = require('react');
9
9
  var ValOverlayContext = require('../../dist/ValOverlayContext-d9b22d1a.cjs.prod.js');
10
- var routeFromVal = require('../../dist/routeFromVal-a13ac8a3.cjs.prod.js');
10
+ var routeFromVal = require('../../dist/routeFromVal-b31a9e00.cjs.prod.js');
11
11
  require('@valbuild/core/patch');
12
12
  require('react/jsx-runtime');
13
13
  require('@valbuild/shared/client');
@@ -3,7 +3,7 @@ import { Internal } from '@valbuild/core';
3
3
  import { getModuleIds, stegaEncode } from '@valbuild/react/stega';
4
4
  import React from 'react';
5
5
  import { u as useValOverlayContext } from '../../dist/ValOverlayContext-6411bbe3.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';
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-06590f50.esm.js';
7
7
  import '@valbuild/core/patch';
8
8
  import 'react/jsx-runtime';
9
9
  import '@valbuild/shared/client';
@@ -239,6 +239,14 @@ val) {
239
239
  // An optional segment the URL left out (`{-$locale}`): it contributes
240
240
  // nothing to the key, so `/about` is the key for `{ locale: undefined }`.
241
241
  delete missingParamKeys[key];
242
+ } else if (part.type === "array-param" && part.optional && (value === undefined || value === null || value === "" || Array.isArray(value) && value.length === 0)) {
243
+ // A splat with nothing in it: `/docs` on a `docs.$` route, which
244
+ // TanStack hands over as an empty `_splat`. The directory's own page,
245
+ // so its key is `/docs` -- not `/docs/`, which no one wrote.
246
+ delete missingParamKeys[key];
247
+ if ("*" in missingParamKeys) {
248
+ delete missingParamKeys["*"];
249
+ }
242
250
  } else if (typeof value !== "string" && !Array.isArray(value)) {
243
251
  missingPatterns.push(part);
244
252
  } else if (Array.isArray(value)) {
@@ -241,6 +241,14 @@ val) {
241
241
  // An optional segment the URL left out (`{-$locale}`): it contributes
242
242
  // nothing to the key, so `/about` is the key for `{ locale: undefined }`.
243
243
  delete missingParamKeys[key];
244
+ } else if (part.type === "array-param" && part.optional && (value === undefined || value === null || value === "" || Array.isArray(value) && value.length === 0)) {
245
+ // A splat with nothing in it: `/docs` on a `docs.$` route, which
246
+ // TanStack hands over as an empty `_splat`. The directory's own page,
247
+ // so its key is `/docs` -- not `/docs/`, which no one wrote.
248
+ delete missingParamKeys[key];
249
+ if ("*" in missingParamKeys) {
250
+ delete missingParamKeys["*"];
251
+ }
244
252
  } else if (typeof value !== "string" && !Array.isArray(value)) {
245
253
  missingPatterns.push(part);
246
254
  } else if (Array.isArray(value)) {
@@ -241,6 +241,14 @@ val) {
241
241
  // An optional segment the URL left out (`{-$locale}`): it contributes
242
242
  // nothing to the key, so `/about` is the key for `{ locale: undefined }`.
243
243
  delete missingParamKeys[key];
244
+ } else if (part.type === "array-param" && part.optional && (value === undefined || value === null || value === "" || Array.isArray(value) && value.length === 0)) {
245
+ // A splat with nothing in it: `/docs` on a `docs.$` route, which
246
+ // TanStack hands over as an empty `_splat`. The directory's own page,
247
+ // so its key is `/docs` -- not `/docs/`, which no one wrote.
248
+ delete missingParamKeys[key];
249
+ if ("*" in missingParamKeys) {
250
+ delete missingParamKeys["*"];
251
+ }
244
252
  } else if (typeof value !== "string" && !Array.isArray(value)) {
245
253
  missingPatterns.push(part);
246
254
  } else if (Array.isArray(value)) {
@@ -6,7 +6,7 @@ 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-f85739a4.cjs.dev.js');
9
+ var version = require('./version-ea2d51c0.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');
@@ -1350,6 +1350,28 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
1350
1350
  (_tracker = tracker) === null || _tracker === void 0 || _tracker.stop();
1351
1351
  };
1352
1352
  }, [analytics, contentVersion, mountOverlay, hasDraft, snapshot, isCanvas, route, router]);
1353
+
1354
+ /**
1355
+ * The leak warning, in development, for the page a visitor gets with
1356
+ * analytics on: every edit tag that reached it somewhere `autoTagJSX` could
1357
+ * not take it out -- JSON-LD, the title, a `<meta>`, a share link -- named
1358
+ * in the console. Every visitor gets those tags after hydration, so a leak
1359
+ * not seen here ships.
1360
+ *
1361
+ * A visitor's page only, as the analytics script's gate has it: an
1362
+ * editor's is rendered from a draft, and content the server read for one
1363
+ * carries its tags in its text until the browser renders it again (see the
1364
+ * showcase's docs route) -- which no visitor ever gets, and which the
1365
+ * advice in the warning would not fix.
1366
+ */
1367
+ React__default["default"].useEffect(function () {
1368
+ if (!stega.isReactDevelopmentBuild() || !analytics || mountOverlay !== false || isValStudioPath(location.pathname)) {
1369
+ return;
1370
+ }
1371
+ return stega.watchStegaLeaks(function (leak) {
1372
+ core.Internal.log.warn(stega.stegaLeakMessage(leak));
1373
+ });
1374
+ }, [analytics, mountOverlay]);
1353
1375
  React__default["default"].useEffect(function () {
1354
1376
  // Activate the Suspense gate after hydration. Inside a transition so
1355
1377
  // already-visible (static) content stays on screen while useValStega
@@ -6,7 +6,7 @@ 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-eaf09d70.cjs.prod.js');
9
+ var version = require('./version-1a45b20c.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');
@@ -1350,6 +1350,28 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
1350
1350
  (_tracker = tracker) === null || _tracker === void 0 || _tracker.stop();
1351
1351
  };
1352
1352
  }, [analytics, contentVersion, mountOverlay, hasDraft, snapshot, isCanvas, route, router]);
1353
+
1354
+ /**
1355
+ * The leak warning, in development, for the page a visitor gets with
1356
+ * analytics on: every edit tag that reached it somewhere `autoTagJSX` could
1357
+ * not take it out -- JSON-LD, the title, a `<meta>`, a share link -- named
1358
+ * in the console. Every visitor gets those tags after hydration, so a leak
1359
+ * not seen here ships.
1360
+ *
1361
+ * A visitor's page only, as the analytics script's gate has it: an
1362
+ * editor's is rendered from a draft, and content the server read for one
1363
+ * carries its tags in its text until the browser renders it again (see the
1364
+ * showcase's docs route) -- which no visitor ever gets, and which the
1365
+ * advice in the warning would not fix.
1366
+ */
1367
+ React__default["default"].useEffect(function () {
1368
+ if (!stega.isReactDevelopmentBuild() || !analytics || mountOverlay !== false || isValStudioPath(location.pathname)) {
1369
+ return;
1370
+ }
1371
+ return stega.watchStegaLeaks(function (leak) {
1372
+ core.Internal.log.warn(stega.stegaLeakMessage(leak));
1373
+ });
1374
+ }, [analytics, mountOverlay]);
1353
1375
  React__default["default"].useEffect(function () {
1354
1376
  // Activate the Suspense gate after hydration. Inside a transition so
1355
1377
  // already-visible (static) content stays on screen while useValStega
@@ -4,8 +4,8 @@ import { Internal as Internal$1, initVal as initVal$1, DEFAULT_CONTENT_HOST } fr
4
4
  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
- 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-0c5ae3fd.esm.js';
7
+ import { stegaEncode, stegaDecodeStrings, attrs, raw, isReactDevelopmentBuild, watchStegaLeaks, stegaLeakMessage, SET_AUTO_TAG_JSX_ENABLED, autoTagJSX } from '@valbuild/react/stega';
8
+ import { r as readValEnableCookie, _ as _toConsumableArray, V as VERSION$1 } from './version-25995c7c.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';
@@ -1326,6 +1326,28 @@ var ValTanStackProvider = function ValTanStackProvider(props) {
1326
1326
  (_tracker = tracker) === null || _tracker === void 0 || _tracker.stop();
1327
1327
  };
1328
1328
  }, [analytics, contentVersion, mountOverlay, hasDraft, snapshot, isCanvas, route, router]);
1329
+
1330
+ /**
1331
+ * The leak warning, in development, for the page a visitor gets with
1332
+ * analytics on: every edit tag that reached it somewhere `autoTagJSX` could
1333
+ * not take it out -- JSON-LD, the title, a `<meta>`, a share link -- named
1334
+ * in the console. Every visitor gets those tags after hydration, so a leak
1335
+ * not seen here ships.
1336
+ *
1337
+ * A visitor's page only, as the analytics script's gate has it: an
1338
+ * editor's is rendered from a draft, and content the server read for one
1339
+ * carries its tags in its text until the browser renders it again (see the
1340
+ * showcase's docs route) -- which no visitor ever gets, and which the
1341
+ * advice in the warning would not fix.
1342
+ */
1343
+ React.useEffect(function () {
1344
+ if (!isReactDevelopmentBuild() || !analytics || mountOverlay !== false || isValStudioPath(location.pathname)) {
1345
+ return;
1346
+ }
1347
+ return watchStegaLeaks(function (leak) {
1348
+ Internal$1.log.warn(stegaLeakMessage(leak));
1349
+ });
1350
+ }, [analytics, mountOverlay]);
1329
1351
  React.useEffect(function () {
1330
1352
  // Activate the Suspense gate after hydration. Inside a transition so
1331
1353
  // already-visible (static) content stays on screen while useValStega
@@ -95,7 +95,7 @@ var packageJson = {
95
95
  "tanstack-router",
96
96
  "react"
97
97
  ],
98
- version: "0.150.1",
98
+ version: "0.150.3",
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.150.1",
96
+ version: "0.150.3",
97
97
  scripts: {
98
98
  typecheck: "tsc --noEmit",
99
99
  test: "jest"
@@ -95,7 +95,7 @@ var packageJson = {
95
95
  "tanstack-router",
96
96
  "react"
97
97
  ],
98
- version: "0.150.1",
98
+ version: "0.150.3",
99
99
  scripts: {
100
100
  typecheck: "tsc --noEmit",
101
101
  test: "jest"
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "tanstack-router",
15
15
  "react"
16
16
  ],
17
- "version": "0.150.1",
17
+ "version": "0.150.3",
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.150.1",
51
- "@valbuild/language-server": "0.150.1",
52
- "@valbuild/mcp": "0.150.1",
53
- "@valbuild/react": "0.150.1",
54
- "@valbuild/server": "0.150.1",
55
- "@valbuild/shared": "0.150.1",
56
- "@valbuild/ui": "0.150.1"
50
+ "@valbuild/core": "0.150.3",
51
+ "@valbuild/language-server": "0.150.3",
52
+ "@valbuild/mcp": "0.150.3",
53
+ "@valbuild/react": "0.150.3",
54
+ "@valbuild/server": "0.150.3",
55
+ "@valbuild/shared": "0.150.3",
56
+ "@valbuild/ui": "0.150.3"
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-f85739a4.cjs.dev.js');
5
+ var version = require('../../dist/version-ea2d51c0.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-2f65a4fc.cjs.dev.js');
12
+ var routeFromVal = require('../../dist/routeFromVal-3c3915e2.cjs.dev.js');
13
13
  var mcp = require('@valbuild/mcp');
14
14
  require('@valbuild/shared/client');
15
15
 
@@ -2,14 +2,14 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = require('../../dist/version-eaf09d70.cjs.prod.js');
5
+ var version = require('../../dist/version-1a45b20c.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-a13ac8a3.cjs.prod.js');
12
+ var routeFromVal = require('../../dist/routeFromVal-b31a9e00.cjs.prod.js');
13
13
  var mcp = require('@valbuild/mcp');
14
14
  require('@valbuild/shared/client');
15
15
 
@@ -1,4 +1,4 @@
1
- import { V as VERSION, _ as _toConsumableArray, s as setValEnableCookieReader } from '../../dist/version-0c5ae3fd.esm.js';
1
+ import { V as VERSION, _ as _toConsumableArray, s as setValEnableCookieReader } from '../../dist/version-25995c7c.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-40cd8a5b.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-06590f50.esm.js';
10
10
  import { initValMcp as initValMcp$1 } from '@valbuild/mcp';
11
11
  import '@valbuild/shared/client';
12
12