Skip to content

build: use native Node TypeScript - #53

Draft
lewxdev wants to merge 2 commits into
mainfrom
codex/native-node-typescript-server
Draft

build: use native Node TypeScript#53
lewxdev wants to merge 2 commits into
mainfrom
codex/native-node-typescript-server

Conversation

@lewxdev

@lewxdev lewxdev commented Aug 15, 2026

Copy link
Copy Markdown
Owner

summary

  • run the custom server directly with Node.js 24.18.0 native TypeScript type stripping
  • replace the TypeScript-only @/* alias with the package imports map #app/*
  • use explicit .ts, .tsx, and index.ts specifiers so Node, TypeScript, and Next.js share one resolution source
  • use native Node watch/start scripts and scope development watching to the server runtime graph
  • move the custom entrypoint to server/ and refactor non-erasable parameter properties
  • remove tsx plus its transitive esbuild packages
  • leave Next.js responsible for compiling TSX

compatibility

The established #app/* form is intentional. Node.js 24.18.0 accepts the newer #/… form, but TypeScript 5.9.3 still rejects those specifiers. #app/* works in both.

Node's default dependency watcher also observes modules loaded and regenerated by Next.js, which caused restart loops during development. The script therefore uses --watch-path for server/ and app/utils/.

Node.js 24.18.0 documents --watch-path as macOS/Windows-only. Production Linux startup is unaffected, but Linux local development would require a future portable wrapper or a third-party watcher.

The latest main also has a pre-existing React ref type error at app/components/field.tsx:102. It is unchanged here to keep this PR narrowly scoped.

validation

  • npm ci
  • native import("#app/utils/game.ts") under Node.js 24.18.0
  • npm run lint
  • Prettier check across every changed file
  • npm audit — 0 vulnerabilities
  • git diff --check
  • Redis-backed npm run dev — HTTP 200 with the package imports
  • npx tsc --noEmit --incremental false — only the pre-existing React ref error above
  • BASE_URL=http://localhost:3000 npm run build — webpack compiles the package imports successfully, then the unchanged React ref error blocks type checking
  • temporary diagnostic correction of that unrelated annotation allowed the full production build to complete; the correction was reverted
  • Redis-backed npm run start from that build — HTTP 200

Prompt:
pull the latest changes and start implementing this

Co-authored-by: Codex <codex@openai.com>
Prompt:
we should use subpath imports supported by node over ts aliases

Co-authored-by: Codex <codex@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant