AppView in a box as a Vite plugin thing hatk.dev
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: expose callXrpc bridge on globalThis in production

SvelteKit SSR load functions call callXrpc via globalThis.__hatk_callXrpc,
but main.ts never set it. Now exposes callXrpc, parseSessionCookie, and
sessionCookieName before loading the SvelteKit handler.

Bumps to 0.0.1-alpha.28.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+8 -2
+1 -1
packages/hatk/package.json
··· 1 1 { 2 2 "name": "@hatk/hatk", 3 - "version": "0.0.1-alpha.27", 3 + "version": "0.0.1-alpha.28", 4 4 "license": "MIT", 5 5 "bin": { 6 6 "hatk": "dist/cli.js"
+7 -1
packages/hatk/src/main.ts
··· 10 10 import { getDialect } from './database/dialect.ts' 11 11 import { setSearchPort } from './database/fts.ts' 12 12 import { initFeeds, listFeeds } from './feeds.ts' 13 - import { initXrpc, listXrpc, configureRelay } from './xrpc.ts' 13 + import { initXrpc, listXrpc, configureRelay, callXrpc } from './xrpc.ts' 14 14 import { initOpengraph } from './opengraph.ts' 15 15 import { initLabels, getLabelDefinitions } from './labels.ts' 16 16 import { startIndexer } from './indexer.ts' ··· 21 21 import { relayHttpUrl } from './config.ts' 22 22 import { runBackfill } from './backfill.ts' 23 23 import { initOAuth } from './oauth/server.ts' 24 + import { parseSessionCookie, getSessionCookieName } from './oauth/session.ts' 24 25 import { loadOnLoginHook } from './hooks.ts' 25 26 import { initSetup } from './setup.ts' 26 27 import { initServer } from './server-init.ts' ··· 185 186 admins: config.admins, 186 187 onResync: runBackfillAndRestart, 187 188 }) 189 + 190 + // Expose server bridge on globalThis so SvelteKit SSR can call XRPC handlers directly 191 + ;(globalThis as any).__hatk_callXrpc = callXrpc 192 + ;(globalThis as any).__hatk_parseSessionCookie = parseSessionCookie 193 + ;(globalThis as any).__hatk_sessionCookieName = getSessionCookieName() 188 194 189 195 // Detect SvelteKit build output and use it as fallback handler 190 196 let fallback: any = undefined