Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@
"@shopify/hydrogen-react": "^2026.4.0",
"@tailwindcss/typography": "^0.5.19",
"@tailwindcss/vite": "^4.2.2",
"@takumi-rs/core": "2.0.0-beta.12",
"@takumi-rs/helpers": "2.0.0-beta.12",
"@takumi-rs/image-response": "2.0.0-beta.12",
"@takumi-rs/wasm": "2.0.0-beta.12",
"@tanstack/ai": "^0.20.1",
"@tanstack/ai-anthropic": "^0.10.1",
"@tanstack/ai-client": "^0.11.3",
Expand Down Expand Up @@ -108,6 +104,7 @@
"resend": "^6.10.0",
"streamdown": "^2.5.0",
"tailwind-merge": "^3.5.0",
"takumi-js": "2.0.0-beta.14",
"tar-stream": "^3.1.8",
"three": "^0.183.2",
"troika-three-text": "^0.52.4",
Expand Down
147 changes: 107 additions & 40 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions src/server/og/generate.server.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
ImageResponse,
type ImageResponseOptions,
} from '@takumi-rs/image-response'
import takumiWasmModule from '@takumi-rs/wasm/auto'
import { ImageResponse, type ImageResponseOptions } from 'takumi-js/response'
import { findLibrary } from '~/libraries'
import type { LibraryId } from '~/libraries'
import { loadOgAssets as loadNodeOgAssets } from './assets.server'
Expand Down Expand Up @@ -76,7 +72,6 @@ export async function generateOgImageResponse(
},
],
images: [{ src: ISLAND_KEY, data: assets.islandPng }],
module: takumiWasmModule,
...init,
}

Expand Down
32 changes: 0 additions & 32 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { sentryTanstackStart } from '@sentry/tanstackstart-react/vite'
import { defineConfig } from 'vite'
import type { PluginOption } from 'vite'
import { redact } from '@tanstack/redact/vite'
import contentCollections from '@content-collections/vite'
import { devtools as tanstackDevtools } from '@tanstack/devtools-vite'
Expand All @@ -10,16 +9,10 @@ import { cloudflare } from '@cloudflare/vite-plugin'
import { analyzer } from 'vite-bundle-analyzer'
import viteReact from '@vitejs/plugin-react'
import fs from 'node:fs'
import { createRequire } from 'node:module'
import os from 'node:os'
import path from 'node:path'

const nodeRequire = createRequire(import.meta.url)
const isDev = process.env.NODE_ENV !== 'production'
const takumiWasmRuntimePath = path.join(
path.dirname(path.dirname(nodeRequire.resolve('@takumi-rs/wasm/no-bundler'))),
'bundlers/workerd.js',
)
const shouldUseRedact = process.env.DISABLE_REDACT !== 'true'
const localRedactPackageRoot = process.env.LOCAL_REDACT_PACKAGE_ROOT
const shouldUseSentryPlugin =
Expand All @@ -37,21 +30,6 @@ const envDir =
? defaultCheckoutEnvDir
: __dirname

function edgeTakumiWasmImport(): PluginOption {
return {
name: 'tanstack-edge-takumi-wasm-import',
enforce: 'pre',
transform(code, id) {
if (!id.includes('/node_modules/takumi-js/dist/render-')) return

return code.replace(
/import\(\s*\/\*\s*@vite-ignore\s*\*\/\s*['"]@takumi-rs\/wasm['"]\s*\)/g,
'import("@takumi-rs/wasm/no-bundler")',
)
},
}
}

// Runtime-specific `react-dom/server` variants aren't in @tanstack/redact/vite's
// default alias map. Funnel them all to `@tanstack/redact/server` at the
// top-level resolve so Workers get a single server implementation.
Expand Down Expand Up @@ -122,10 +100,6 @@ export default defineConfig({
find: 'unicorn-magic',
replacement: 'unicorn-magic/node',
},
{
find: '@takumi-rs/wasm/auto',
replacement: takumiWasmRuntimePath,
},
...(shouldUseRedact
? [
useSyncExternalStoreShimIndexAlias,
Expand Down Expand Up @@ -181,11 +155,6 @@ export default defineConfig({
// CTA packages use execa which has a broken unicorn-magic dependency
'@tanstack/create',
'discord-interactions',
// OG image generation: takumi ships a native .node binary
'@takumi-rs/core',
'@takumi-rs/image-response',
'@takumi-rs/helpers',
'takumi-js',
// Don't pre-bundle CLI so we always get fresh changes during dev
...(isDev ? ['@tanstack/cli'] : []),
// Lucide can resolve differently across Vite environments when combined
Expand Down Expand Up @@ -249,7 +218,6 @@ export default defineConfig({
},
},
plugins: [
edgeTakumiWasmImport(),
cloudflare({
viteEnvironment: { name: 'ssr' },
}),
Expand Down