@valbuild/tanstack 0.150.15 → 0.150.17
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 +36 -0
- package/README.md +29 -7
- package/dist/declarations/src/ValAnalytics.d.ts +4 -0
- package/dist/valbuild-tanstack.cjs.dev.js +1 -1
- package/dist/valbuild-tanstack.cjs.prod.js +1 -1
- package/dist/valbuild-tanstack.esm.js +1 -1
- package/dist/{version-01ac69be.cjs.prod.js → version-892b03ef.cjs.prod.js} +1 -1
- package/dist/{version-0c586fc5.esm.js → version-b4417d62.esm.js} +1 -1
- package/dist/{version-e8454128.cjs.dev.js → version-b6b1be21.cjs.dev.js} +1 -1
- package/package.json +8 -8
- package/server/dist/valbuild-tanstack-server.cjs.dev.js +1 -1
- package/server/dist/valbuild-tanstack-server.cjs.prod.js +1 -1
- package/server/dist/valbuild-tanstack-server.esm.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @valbuild/tanstack
|
|
2
2
|
|
|
3
|
+
## 0.150.17
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#992](https://github.com/valbuild/val/pull/992) [`ea3bf9b`](https://github.com/valbuild/val/commit/ea3bf9bbacd22bbb5485fd798d6b3a2d5916be81) Thanks [@freekh](https://github.com/freekh)! - Content analytics now counts on self-hosted sites (Custom hosting), not only on sites Val hosts.
|
|
8
|
+
|
|
9
|
+
A self-hosted app's own Val server now hands each analytics beacon on to Val's ingest, which counts it. To turn it on:
|
|
10
|
+
|
|
11
|
+
- Run the app with Val's content service: `VAL_API_KEY`, `VAL_SECRET` and `VAL_PROJECT` set. Most deployed apps already do.
|
|
12
|
+
- Set `VAL_ANALYTICS=true`. In TanStack Start, read it in your layout's loader (`{ enabled: process.env.VAL_ANALYTICS === "true" }`) and pass the result to `<ValProvider analytics>`. A self-hosted site has no platform to pass it for you.
|
|
13
|
+
- Switch analytics on for the project in Val's admin. While it is off there, the script on your pages is told so and stops sending.
|
|
14
|
+
|
|
15
|
+
The server forwards only same-origin beacons from a browser. It passes on the visitor's User-Agent and, where your host provides one (Vercel, Cloudflare or CloudFront), their country. It never passes on their IP address. If the api key is not accepted, the server logs one warning naming `VAL_API_KEY` and `VAL_PROJECT`. Local development (fs mode) works as before and counts nothing.
|
|
16
|
+
|
|
17
|
+
`VAL_ANALYTICS_INGEST_URL` overrides where beacons are sent. You will normally not need it.
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [[`ea3bf9b`](https://github.com/valbuild/val/commit/ea3bf9bbacd22bbb5485fd798d6b3a2d5916be81)]:
|
|
20
|
+
- @valbuild/server@0.150.17
|
|
21
|
+
- @valbuild/shared@0.150.17
|
|
22
|
+
- @valbuild/language-server@0.150.17
|
|
23
|
+
- @valbuild/mcp@0.150.17
|
|
24
|
+
- @valbuild/react@0.150.17
|
|
25
|
+
- @valbuild/ui@0.150.16
|
|
26
|
+
|
|
27
|
+
## 0.150.16
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- Updated dependencies [[`c0abcde`](https://github.com/valbuild/val/commit/c0abcde887fa61edb2dd542b9cfd707237a74daf), [`3ac24d4`](https://github.com/valbuild/val/commit/3ac24d46691c646dd5d2789cf2e1d6e2734195d3), [`7db39ef`](https://github.com/valbuild/val/commit/7db39ef722b4f743e6974effd5fedfadc76e6544)]:
|
|
32
|
+
- @valbuild/ui@0.150.16
|
|
33
|
+
- @valbuild/shared@0.150.16
|
|
34
|
+
- @valbuild/server@0.150.16
|
|
35
|
+
- @valbuild/react@0.150.16
|
|
36
|
+
- @valbuild/language-server@0.150.16
|
|
37
|
+
- @valbuild/mcp@0.150.16
|
|
38
|
+
|
|
3
39
|
## 0.150.15
|
|
4
40
|
|
|
5
41
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -400,7 +400,7 @@ does not 404 either.
|
|
|
400
400
|
|
|
401
401
|
## Content analytics
|
|
402
402
|
|
|
403
|
-
Val can count which content your visitors see
|
|
403
|
+
Val can count which content your visitors see. On a site Val hosts it is
|
|
404
404
|
**off by default**, and a setting of the hosted project rather than of the
|
|
405
405
|
code: the owner turns it on in the project's settings, and Val's hosting hands
|
|
406
406
|
it to the site as the `VAL_ANALYTICS` variable, along with the id of the
|
|
@@ -455,11 +455,33 @@ the content version, so a page can be compared before and after a publish. No
|
|
|
455
455
|
cookies, no storage and no visitor IDs, and nothing is sent in draft mode, in
|
|
456
456
|
the Studio or from an automated browser.
|
|
457
457
|
|
|
458
|
-
|
|
459
|
-
the
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
458
|
+
To see the mode working in local development, set `VAL_ANALYTICS=true` in
|
|
459
|
+
`.env.development`: the development server reads it, and nothing else does.
|
|
460
|
+
|
|
461
|
+
### On your own hosting
|
|
462
|
+
|
|
463
|
+
A site Val does not host is counted too, on the Custom hosting plan. Its own
|
|
464
|
+
Val server answers `/api/val/analytics` and forwards each beacon to Val, with
|
|
465
|
+
the `VAL_API_KEY` and `VAL_PROJECT` it already has for publishing. It needs
|
|
466
|
+
two things:
|
|
467
|
+
|
|
468
|
+
1. Content analytics switched on in the project's settings on val.build,
|
|
469
|
+
under Analytics. Switched off there, Val answers the forwarded beacons
|
|
470
|
+
with a 410 and the script stops sending them.
|
|
471
|
+
2. The layout passing `analytics`, since no hosting hands it the setting. Read
|
|
472
|
+
it on the server, so it is never baked into the browser bundle:
|
|
473
|
+
|
|
474
|
+
```tsx
|
|
475
|
+
// src/routes/_site.tsx
|
|
476
|
+
const getValPage = createServerFn().handler(async () => ({
|
|
477
|
+
draft: await fetchValDraft(),
|
|
478
|
+
analytics: { enabled: process.env.VAL_ANALYTICS === "true" },
|
|
479
|
+
}));
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
and set `VAL_ANALYTICS=true` where the site is deployed. The visitor's country
|
|
483
|
+
is read from the host's own header when there is one (`x-vercel-ip-country`,
|
|
484
|
+
`cf-ipcountry` or `cloudfront-viewer-country`); the IP address never is.
|
|
463
485
|
|
|
464
486
|
## Images
|
|
465
487
|
|
|
@@ -497,7 +519,7 @@ SDK of your choice. See [`@valbuild/mcp`](https://www.npmjs.com/package/@valbuil
|
|
|
497
519
|
| `ValImage` wraps `next/image` | `ValImage` is an `<img>` |
|
|
498
520
|
| `fetchVal` in a Server Component | hooks in components; `createServerFn` for loaders |
|
|
499
521
|
| client hooks render published SSR | `ValProvider draft` renders the draft during SSR |
|
|
500
|
-
| no content analytics yet | `ValProvider analytics`
|
|
522
|
+
| no content analytics yet | `ValProvider analytics` |
|
|
501
523
|
|
|
502
524
|
## Schema reference
|
|
503
525
|
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
* (`platformAnalytics.tsx`); a layout that wants to decide reads them in its
|
|
9
9
|
* loader with `fetchValAnalytics()`, from the `val.server.ts` the platform
|
|
10
10
|
* writes, and passes them.
|
|
11
|
+
*
|
|
12
|
+
* A self-hosted site has no platform handing it anything, so its layout reads
|
|
13
|
+
* `VAL_ANALYTICS` from its own environment and passes the result: see
|
|
14
|
+
* `analytics` on `<ValProvider>`.
|
|
11
15
|
*/
|
|
12
16
|
export type ValAnalytics = {
|
|
13
17
|
/** Off unless this says so. */
|
|
@@ -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-
|
|
9
|
+
var version = require('./version-b6b1be21.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');
|
|
@@ -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-
|
|
9
|
+
var version = require('./version-892b03ef.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');
|
|
@@ -5,7 +5,7 @@ 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, 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-
|
|
8
|
+
import { r as readValEnableCookie, _ as _toConsumableArray, V as VERSION$1 } from './version-b4417d62.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';
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"tanstack-router",
|
|
15
15
|
"react"
|
|
16
16
|
],
|
|
17
|
-
"version": "0.150.
|
|
17
|
+
"version": "0.150.17",
|
|
18
18
|
"main": "dist/valbuild-tanstack.cjs.js",
|
|
19
19
|
"module": "dist/valbuild-tanstack.esm.js",
|
|
20
20
|
"exports": {
|
|
@@ -52,13 +52,13 @@
|
|
|
52
52
|
"exports": true
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@valbuild/
|
|
56
|
-
"@valbuild/
|
|
57
|
-
"@valbuild/
|
|
58
|
-
"@valbuild/server": "0.150.
|
|
59
|
-
"@valbuild/
|
|
60
|
-
"@valbuild/
|
|
61
|
-
"@valbuild/
|
|
55
|
+
"@valbuild/mcp": "0.150.17",
|
|
56
|
+
"@valbuild/react": "0.150.17",
|
|
57
|
+
"@valbuild/language-server": "0.150.17",
|
|
58
|
+
"@valbuild/server": "0.150.17",
|
|
59
|
+
"@valbuild/shared": "0.150.17",
|
|
60
|
+
"@valbuild/ui": "0.150.16",
|
|
61
|
+
"@valbuild/core": "0.150.3"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@tanstack/react-router": "^1.170.41",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var version = require('../../dist/version-
|
|
5
|
+
var version = require('../../dist/version-b6b1be21.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');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var version = require('../../dist/version-
|
|
5
|
+
var version = require('../../dist/version-892b03ef.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');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V as VERSION, _ as _toConsumableArray, s as setValEnableCookieReader } from '../../dist/version-
|
|
1
|
+
import { V as VERSION, _ as _toConsumableArray, s as setValEnableCookieReader } from '../../dist/version-b4417d62.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';
|