@tanstack/start-server-core 1.133.8 → 1.133.10

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.
@@ -0,0 +1 @@
1
+ export declare function getServerFnById(): void;
@@ -0,0 +1,6 @@
1
+ function getServerFnById() {
2
+ }
3
+ export {
4
+ getServerFnById
5
+ };
6
+ //# sourceMappingURL=fake-start-server-fn-manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fake-start-server-fn-manifest.js","sources":["../../src/fake-start-server-fn-manifest.ts"],"sourcesContent":["export function getServerFnById() {}\n"],"names":[],"mappings":"AAAO,SAAS,kBAAkB;AAAC;"}
@@ -1 +1 @@
1
- export declare function getServerFnById(serverFnId: string): Promise<(...args: Array<any>) => Promise<any>>;
1
+ export { getServerFnById } from '#tanstack-start-server-fn-manifest';
@@ -1,7 +1,6 @@
1
1
  export { createStartHandler } from './createStartHandler.js';
2
2
  export { attachRouterServerSsrUtils, createRequestHandler, defineHandlerCallback, transformReadableStreamWithRouter, transformPipeableStreamWithRouter, } from '@tanstack/router-core/ssr/server';
3
3
  export type { HandlerCallback } from '@tanstack/router-core/ssr/server';
4
- export { handleServerAction } from './server-functions-handler.js';
5
4
  export * from './request-response.js';
6
5
  export * from './virtual-modules.js';
7
6
  export { HEADERS } from './constants.js';
package/dist/esm/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { createStartHandler } from "./createStartHandler.js";
2
2
  import { attachRouterServerSsrUtils, createRequestHandler, defineHandlerCallback, transformPipeableStreamWithRouter, transformReadableStreamWithRouter } from "@tanstack/router-core/ssr/server";
3
- import { handleServerAction } from "./server-functions-handler.js";
4
3
  import { clearResponseHeaders, clearSession, deleteCookie, getCookie, getCookies, getRequest, getRequestHeader, getRequestHeaders, getRequestHost, getRequestIP, getRequestProtocol, getRequestUrl, getResponse, getResponseHeader, getResponseHeaders, getResponseStatus, getSession, getValidatedQuery, removeResponseHeader, requestHandler, sealSession, setCookie, setResponseHeader, setResponseHeaders, setResponseStatus, unsealSession, updateSession, useSession } from "./request-response.js";
5
4
  import { VIRTUAL_MODULES } from "./virtual-modules.js";
6
5
  import { HEADERS } from "./constants.js";
@@ -29,7 +28,6 @@ export {
29
28
  getResponseStatus,
30
29
  getSession,
31
30
  getValidatedQuery,
32
- handleServerAction,
33
31
  removeResponseHeader,
34
32
  requestHandler,
35
33
  sealSession,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -3,8 +3,6 @@ async function loadVirtualModule(id) {
3
3
  switch (id) {
4
4
  case VIRTUAL_MODULES.startManifest:
5
5
  return await import("tanstack-start-manifest:v");
6
- case VIRTUAL_MODULES.serverFnManifest:
7
- return await import("tanstack-start-server-fn-manifest:v");
8
6
  case VIRTUAL_MODULES.injectedHeadScripts:
9
7
  return await import("tanstack-start-injected-head-scripts:v");
10
8
  default:
@@ -1 +1 @@
1
- {"version":3,"file":"loadVirtualModule.js","sources":["../../src/loadVirtualModule.ts"],"sourcesContent":["import { VIRTUAL_MODULES } from './virtual-modules'\nimport type { VirtualModules } from './virtual-modules'\n\n/**\n * we need to explicitly enumerate all imports with string literals,\n * otherwise vite will not pick them up during build\n */\nexport async function loadVirtualModule<TId extends keyof VirtualModules>(\n id: TId,\n): Promise<VirtualModules[TId]> {\n switch (id) {\n case VIRTUAL_MODULES.startManifest:\n return (await import('tanstack-start-manifest:v')) as any\n case VIRTUAL_MODULES.serverFnManifest:\n return (await import('tanstack-start-server-fn-manifest:v')) as any\n case VIRTUAL_MODULES.injectedHeadScripts:\n return (await import('tanstack-start-injected-head-scripts:v')) as any\n default:\n throw new Error(`Unknown virtual module: ${id}`)\n }\n}\n"],"names":[],"mappings":";AAOA,eAAsB,kBACpB,IAC8B;AAC9B,UAAQ,IAAA;AAAA,IACN,KAAK,gBAAgB;AACnB,aAAQ,MAAM,OAAO,2BAA2B;AAAA,IAClD,KAAK,gBAAgB;AACnB,aAAQ,MAAM,OAAO,qCAAqC;AAAA,IAC5D,KAAK,gBAAgB;AACnB,aAAQ,MAAM,OAAO,wCAAwC;AAAA,IAC/D;AACE,YAAM,IAAI,MAAM,2BAA2B,EAAE,EAAE;AAAA,EAAA;AAErD;"}
1
+ {"version":3,"file":"loadVirtualModule.js","sources":["../../src/loadVirtualModule.ts"],"sourcesContent":["import { VIRTUAL_MODULES } from './virtual-modules'\nimport type { VirtualModules } from './virtual-modules'\n\n/**\n * we need to explicitly enumerate all imports with string literals,\n * otherwise vite will not pick them up during build\n */\nexport async function loadVirtualModule<TId extends keyof VirtualModules>(\n id: TId,\n): Promise<VirtualModules[TId]> {\n switch (id) {\n case VIRTUAL_MODULES.startManifest:\n return (await import('tanstack-start-manifest:v')) as any\n case VIRTUAL_MODULES.injectedHeadScripts:\n return (await import('tanstack-start-injected-head-scripts:v')) as any\n default:\n throw new Error(`Unknown virtual module: ${id}`)\n }\n}\n"],"names":[],"mappings":";AAOA,eAAsB,kBACpB,IAC8B;AAC9B,UAAQ,IAAA;AAAA,IACN,KAAK,gBAAgB;AACnB,aAAQ,MAAM,OAAO,2BAA2B;AAAA,IAClD,KAAK,gBAAgB;AACnB,aAAQ,MAAM,OAAO,wCAAwC;AAAA,IAC/D;AACE,YAAM,IAAI,MAAM,2BAA2B,EAAE,EAAE;AAAA,EAAA;AAErD;"}
@@ -1,7 +1,7 @@
1
1
  import { createSerializationAdapter } from "@tanstack/router-core";
2
2
  import { TSS_SERVER_FUNCTION } from "@tanstack/start-client-core";
3
3
  import { createServerRpc } from "../createServerRpc.js";
4
- import { getServerFnById } from "../getServerFnById.js";
4
+ import { getServerFnById } from "#tanstack-start-server-fn-manifest";
5
5
  const ServerFunctionSerializationAdapter = createSerializationAdapter({
6
6
  key: "$TSS/serverfn",
7
7
  test: (v) => {
@@ -3,7 +3,7 @@ import invariant from "tiny-invariant";
3
3
  import { getDefaultSerovalPlugins, TSS_FORMDATA_CONTEXT, X_TSS_RAW_RESPONSE, X_TSS_SERIALIZED } from "@tanstack/start-client-core";
4
4
  import { toCrossJSONStream, toCrossJSONAsync, fromJSON } from "seroval";
5
5
  import { getResponse } from "./request-response.js";
6
- import { getServerFnById } from "./getServerFnById.js";
6
+ import { getServerFnById } from "#tanstack-start-server-fn-manifest";
7
7
  let regex = void 0;
8
8
  const handleServerAction = async ({
9
9
  request,
@@ -1,10 +1,9 @@
1
1
  export declare const VIRTUAL_MODULES: {
2
2
  readonly startManifest: "tanstack-start-manifest:v";
3
- readonly serverFnManifest: "tanstack-start-server-fn-manifest:v";
3
+ readonly serverFnManifest: "#tanstack-start-server-fn-manifest";
4
4
  readonly injectedHeadScripts: "tanstack-start-injected-head-scripts:v";
5
5
  };
6
6
  export type VirtualModules = {
7
7
  [VIRTUAL_MODULES.startManifest]: typeof import('tanstack-start-manifest:v');
8
- [VIRTUAL_MODULES.serverFnManifest]: typeof import('tanstack-start-server-fn-manifest:v');
9
8
  [VIRTUAL_MODULES.injectedHeadScripts]: typeof import('tanstack-start-injected-head-scripts:v');
10
9
  };
@@ -1,6 +1,6 @@
1
1
  const VIRTUAL_MODULES = {
2
2
  startManifest: "tanstack-start-manifest:v",
3
- serverFnManifest: "tanstack-start-server-fn-manifest:v",
3
+ serverFnManifest: "#tanstack-start-server-fn-manifest",
4
4
  injectedHeadScripts: "tanstack-start-injected-head-scripts:v"
5
5
  };
6
6
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"virtual-modules.js","sources":["../../src/virtual-modules.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/consistent-type-imports */\n\nexport const VIRTUAL_MODULES = {\n startManifest: 'tanstack-start-manifest:v',\n serverFnManifest: 'tanstack-start-server-fn-manifest:v',\n injectedHeadScripts: 'tanstack-start-injected-head-scripts:v',\n} as const\n\nexport type VirtualModules = {\n [VIRTUAL_MODULES.startManifest]: typeof import('tanstack-start-manifest:v')\n [VIRTUAL_MODULES.serverFnManifest]: typeof import('tanstack-start-server-fn-manifest:v')\n [VIRTUAL_MODULES.injectedHeadScripts]: typeof import('tanstack-start-injected-head-scripts:v')\n}\n"],"names":[],"mappings":"AAEO,MAAM,kBAAkB;AAAA,EAC7B,eAAe;AAAA,EACf,kBAAkB;AAAA,EAClB,qBAAqB;AACvB;"}
1
+ {"version":3,"file":"virtual-modules.js","sources":["../../src/virtual-modules.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/consistent-type-imports */\n\nexport const VIRTUAL_MODULES = {\n startManifest: 'tanstack-start-manifest:v',\n serverFnManifest: '#tanstack-start-server-fn-manifest',\n injectedHeadScripts: 'tanstack-start-injected-head-scripts:v',\n} as const\n\nexport type VirtualModules = {\n [VIRTUAL_MODULES.startManifest]: typeof import('tanstack-start-manifest:v')\n [VIRTUAL_MODULES.injectedHeadScripts]: typeof import('tanstack-start-injected-head-scripts:v')\n}\n"],"names":[],"mappings":"AAEO,MAAM,kBAAkB;AAAA,EAC7B,eAAe;AAAA,EACf,kBAAkB;AAAA,EAClB,qBAAqB;AACvB;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/start-server-core",
3
- "version": "1.133.8",
3
+ "version": "1.133.10",
4
4
  "description": "Modern and scalable routing for React applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -40,6 +40,11 @@
40
40
  },
41
41
  "./package.json": "./package.json"
42
42
  },
43
+ "imports": {
44
+ "#tanstack-start-server-fn-manifest": {
45
+ "default": "./dist/esm/fake-start-server-fn-manifest.js"
46
+ }
47
+ },
43
48
  "sideEffects": false,
44
49
  "files": [
45
50
  "dist",
@@ -53,9 +58,9 @@
53
58
  "seroval": "^1.3.2",
54
59
  "tiny-invariant": "^1.3.3",
55
60
  "@tanstack/history": "1.133.3",
56
- "@tanstack/start-client-core": "1.133.8",
57
- "@tanstack/router-core": "1.133.8",
58
- "@tanstack/start-storage-context": "1.133.8"
61
+ "@tanstack/start-client-core": "1.133.10",
62
+ "@tanstack/router-core": "1.133.10",
63
+ "@tanstack/start-storage-context": "1.133.10"
59
64
  },
60
65
  "devDependencies": {
61
66
  "@standard-schema/spec": "^1.0.0",
@@ -0,0 +1 @@
1
+ export function getServerFnById() {}
@@ -1,33 +1 @@
1
- import { loadVirtualModule } from './loadVirtualModule'
2
- import { VIRTUAL_MODULES } from './virtual-modules'
3
-
4
- export async function getServerFnById(serverFnId: string) {
5
- const { default: serverFnManifest } = await loadVirtualModule(
6
- VIRTUAL_MODULES.serverFnManifest,
7
- )
8
-
9
- const serverFnInfo = serverFnManifest[serverFnId]
10
-
11
- if (!serverFnInfo) {
12
- console.info('serverFnManifest', serverFnManifest)
13
- throw new Error('Server function info not found for ' + serverFnId)
14
- }
15
-
16
- const fnModule = await serverFnInfo.importer()
17
-
18
- if (!fnModule) {
19
- console.info('serverFnInfo', serverFnInfo)
20
- throw new Error('Server function module not resolved for ' + serverFnId)
21
- }
22
-
23
- const action = fnModule[serverFnInfo.functionName]
24
-
25
- if (!action) {
26
- console.info('serverFnInfo', serverFnInfo)
27
- console.info('fnModule', fnModule)
28
- throw new Error(
29
- `Server function module export not resolved for serverFn ID: ${serverFnId}`,
30
- )
31
- }
32
- return action
33
- }
1
+ export { getServerFnById } from '#tanstack-start-server-fn-manifest'
package/src/index.tsx CHANGED
@@ -9,8 +9,6 @@ export {
9
9
  } from '@tanstack/router-core/ssr/server'
10
10
  export type { HandlerCallback } from '@tanstack/router-core/ssr/server'
11
11
 
12
- export { handleServerAction } from './server-functions-handler'
13
-
14
12
  export * from './request-response'
15
13
 
16
14
  export * from './virtual-modules'
@@ -11,8 +11,6 @@ export async function loadVirtualModule<TId extends keyof VirtualModules>(
11
11
  switch (id) {
12
12
  case VIRTUAL_MODULES.startManifest:
13
13
  return (await import('tanstack-start-manifest:v')) as any
14
- case VIRTUAL_MODULES.serverFnManifest:
15
- return (await import('tanstack-start-server-fn-manifest:v')) as any
16
14
  case VIRTUAL_MODULES.injectedHeadScripts:
17
15
  return (await import('tanstack-start-injected-head-scripts:v')) as any
18
16
  default:
@@ -10,18 +10,9 @@ declare module 'tanstack-start-route-tree:v' {
10
10
  export const routeTree: AnyRoute | undefined
11
11
  }
12
12
 
13
- declare module 'tanstack-start-server-fn-manifest:v' {
14
- const serverFnManifest: Record<
15
- string,
16
- {
17
- importer: () => Promise<
18
- Record<string, (...args: Array<any>) => Promise<any>> | undefined
19
- >
20
- functionName: string
21
- }
22
- >
23
-
24
- export default serverFnManifest
13
+ declare module '#tanstack-start-server-fn-manifest' {
14
+ type ServerFn = (...args: Array<any>) => Promise<any>
15
+ export function getServerFnById(id: string): Promise<ServerFn>
25
16
  }
26
17
 
27
18
  declare module 'tanstack-start-injected-head-scripts:v' {
@@ -2,12 +2,11 @@
2
2
 
3
3
  export const VIRTUAL_MODULES = {
4
4
  startManifest: 'tanstack-start-manifest:v',
5
- serverFnManifest: 'tanstack-start-server-fn-manifest:v',
5
+ serverFnManifest: '#tanstack-start-server-fn-manifest',
6
6
  injectedHeadScripts: 'tanstack-start-injected-head-scripts:v',
7
7
  } as const
8
8
 
9
9
  export type VirtualModules = {
10
10
  [VIRTUAL_MODULES.startManifest]: typeof import('tanstack-start-manifest:v')
11
- [VIRTUAL_MODULES.serverFnManifest]: typeof import('tanstack-start-server-fn-manifest:v')
12
11
  [VIRTUAL_MODULES.injectedHeadScripts]: typeof import('tanstack-start-injected-head-scripts:v')
13
12
  }
@@ -1,30 +0,0 @@
1
- import { loadVirtualModule } from "./loadVirtualModule.js";
2
- import { VIRTUAL_MODULES } from "./virtual-modules.js";
3
- async function getServerFnById(serverFnId) {
4
- const { default: serverFnManifest } = await loadVirtualModule(
5
- VIRTUAL_MODULES.serverFnManifest
6
- );
7
- const serverFnInfo = serverFnManifest[serverFnId];
8
- if (!serverFnInfo) {
9
- console.info("serverFnManifest", serverFnManifest);
10
- throw new Error("Server function info not found for " + serverFnId);
11
- }
12
- const fnModule = await serverFnInfo.importer();
13
- if (!fnModule) {
14
- console.info("serverFnInfo", serverFnInfo);
15
- throw new Error("Server function module not resolved for " + serverFnId);
16
- }
17
- const action = fnModule[serverFnInfo.functionName];
18
- if (!action) {
19
- console.info("serverFnInfo", serverFnInfo);
20
- console.info("fnModule", fnModule);
21
- throw new Error(
22
- `Server function module export not resolved for serverFn ID: ${serverFnId}`
23
- );
24
- }
25
- return action;
26
- }
27
- export {
28
- getServerFnById
29
- };
30
- //# sourceMappingURL=getServerFnById.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getServerFnById.js","sources":["../../src/getServerFnById.ts"],"sourcesContent":["import { loadVirtualModule } from './loadVirtualModule'\nimport { VIRTUAL_MODULES } from './virtual-modules'\n\nexport async function getServerFnById(serverFnId: string) {\n const { default: serverFnManifest } = await loadVirtualModule(\n VIRTUAL_MODULES.serverFnManifest,\n )\n\n const serverFnInfo = serverFnManifest[serverFnId]\n\n if (!serverFnInfo) {\n console.info('serverFnManifest', serverFnManifest)\n throw new Error('Server function info not found for ' + serverFnId)\n }\n\n const fnModule = await serverFnInfo.importer()\n\n if (!fnModule) {\n console.info('serverFnInfo', serverFnInfo)\n throw new Error('Server function module not resolved for ' + serverFnId)\n }\n\n const action = fnModule[serverFnInfo.functionName]\n\n if (!action) {\n console.info('serverFnInfo', serverFnInfo)\n console.info('fnModule', fnModule)\n throw new Error(\n `Server function module export not resolved for serverFn ID: ${serverFnId}`,\n )\n }\n return action\n}\n"],"names":[],"mappings":";;AAGA,eAAsB,gBAAgB,YAAoB;AACxD,QAAM,EAAE,SAAS,iBAAA,IAAqB,MAAM;AAAA,IAC1C,gBAAgB;AAAA,EAAA;AAGlB,QAAM,eAAe,iBAAiB,UAAU;AAEhD,MAAI,CAAC,cAAc;AACjB,YAAQ,KAAK,oBAAoB,gBAAgB;AACjD,UAAM,IAAI,MAAM,wCAAwC,UAAU;AAAA,EACpE;AAEA,QAAM,WAAW,MAAM,aAAa,SAAA;AAEpC,MAAI,CAAC,UAAU;AACb,YAAQ,KAAK,gBAAgB,YAAY;AACzC,UAAM,IAAI,MAAM,6CAA6C,UAAU;AAAA,EACzE;AAEA,QAAM,SAAS,SAAS,aAAa,YAAY;AAEjD,MAAI,CAAC,QAAQ;AACX,YAAQ,KAAK,gBAAgB,YAAY;AACzC,YAAQ,KAAK,YAAY,QAAQ;AACjC,UAAM,IAAI;AAAA,MACR,+DAA+D,UAAU;AAAA,IAAA;AAAA,EAE7E;AACA,SAAO;AACT;"}