@decocms/tanstack 7.2.1 → 7.2.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/package.json +4 -4
- package/src/vite/plugin.js +19 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decocms/tanstack",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Deco framework binding for TanStack Start + Cloudflare Workers",
|
|
6
6
|
"repository": {
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"lint:unused": "knip"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@decocms/blocks": "7.2.
|
|
25
|
-
"@decocms/blocks-admin": "7.2.
|
|
26
|
-
"@decocms/blocks-cli": "7.2.
|
|
24
|
+
"@decocms/blocks": "7.2.2",
|
|
25
|
+
"@decocms/blocks-admin": "7.2.2",
|
|
26
|
+
"@decocms/blocks-cli": "7.2.2",
|
|
27
27
|
"@deco-cx/warp-node": "^0.3.16",
|
|
28
28
|
"fast-json-patch": "^3.1.0",
|
|
29
29
|
"ws": "^8.18.0"
|
package/src/vite/plugin.js
CHANGED
|
@@ -588,14 +588,25 @@ export function decoVitePlugin() {
|
|
|
588
588
|
env.optimizeDeps.esbuildOptions.jsxImportSource = "react";
|
|
589
589
|
}
|
|
590
590
|
|
|
591
|
-
// Force
|
|
592
|
-
// TanStack Start's compiler can register
|
|
591
|
+
// Force these packages through the SSR transform pipeline so
|
|
592
|
+
// TanStack Start's compiler can register their createServerFn handlers
|
|
593
593
|
// (loadDeferredSection in routes/cmsRoute.ts, and loadCmsPage /
|
|
594
|
-
// loadCmsHomePage alongside it) in the
|
|
595
|
-
// manifest. Without this, Vite
|
|
596
|
-
// optimizeDeps before plugins run, the
|
|
597
|
-
// manifest, and every POST /_serverFn/* call
|
|
598
|
-
// HTTP 500 ("Invalid server function ID").
|
|
594
|
+
// loadCmsHomePage alongside it, for @decocms/tanstack) in the
|
|
595
|
+
// per-environment serverFnsById manifest. Without this, Vite
|
|
596
|
+
// pre-bundles the package via optimizeDeps before plugins run, the
|
|
597
|
+
// handler never enters the manifest, and every POST /_serverFn/* call
|
|
598
|
+
// from the browser returns HTTP 500 ("Invalid server function ID").
|
|
599
|
+
// See #197.
|
|
600
|
+
//
|
|
601
|
+
// @decocms/apps-vtex needs this too: its invoke.ts wraps 18 actions/
|
|
602
|
+
// loaders via createInvokeFn (packages/tanstack/src/sdk/createInvoke.ts),
|
|
603
|
+
// each a real `createServerFn(...)` call site. This was missed when
|
|
604
|
+
// createInvokeFn's export was added to @decocms/tanstack's public
|
|
605
|
+
// barrel (apps-monorepo-migration Task 7) — worked by accident under
|
|
606
|
+
// `bun link` (Vite treats symlinked/workspace packages as live source,
|
|
607
|
+
// skipping optimizeDeps pre-bundling for them) but hard-crashes with
|
|
608
|
+
// a real npm install: "createServerFn must be assigned to a variable!"
|
|
609
|
+
// from the Cloudflare Workers runtime's static entry-export scan.
|
|
599
610
|
//
|
|
600
611
|
// @decocms/blocks does NOT need this: despite its
|
|
601
612
|
// validateSection.ts / useScript.ts doc comments mentioning
|
|
@@ -607,7 +618,7 @@ export function decoVitePlugin() {
|
|
|
607
618
|
if (name === "ssr") {
|
|
608
619
|
env.resolve = env.resolve || {};
|
|
609
620
|
const existing = env.resolve.noExternal;
|
|
610
|
-
const additions = ["@decocms/tanstack"];
|
|
621
|
+
const additions = ["@decocms/tanstack", "@decocms/apps-vtex"];
|
|
611
622
|
if (existing === true) {
|
|
612
623
|
// Already noExternal everything — nothing to add.
|
|
613
624
|
} else if (Array.isArray(existing)) {
|