We moved Railway's frontend off Next.js. Builds went from 10+ mins to under 2
TL;DR Highlight
This is a practical experience of Railway migrating its production frontend from Next.js to Vite + TanStack Start, reducing build times from over 10 minutes to under 2 minutes. Teams that deploy multiple times a day can feel how build time directly affects development speed.
Who Should Read
Frontend developers who are operating client-centric dashboards or SPAs with Next.js and are experiencing increasing build times or feel it doesn't align with a server-first paradigm. Especially for teams that deploy multiple times a day and want to resolve build bottlenecks.
Core Mechanics
- Railway's production frontend (dashboard, canvas, entire railway.com) has been fully transitioned from Next.js to Vite + TanStack Router, completing the migration without downtime in just two PRs.
- Existing Next.js builds took over 10 minutes, with 6 minutes being Next.js's own processing time, especially stuck in the 'finalizing page optimization' stage for nearly half the time. For teams deploying multiple times a day, this wasn't just an inconvenience but a heavy tax on each iteration.
- Railway apps have a rich state-based interface for the dashboard and a real-time, WebSocket-heavy structure for the canvas, fundamentally incompatible with Next.js's server-first design approach.
- Trying to handle layout sharing while maintaining the Pages Router led to adding custom abstractions on top of the framework, with all layout patterns being workarounds rather than framework features. Switching to the App Router would solve some problems, but it would enforce a server-first paradigm, which also didn't fit.
- The reasons for choosing TanStack Start + Vite are fourfold: type-safe routing with automatic inference of route and search parameters, Pathless Layout Route supporting layouts as a first-class concept, a fast development loop with virtually no feedback loop due to instant HMR, and the flexibility to apply SSR selectively where needed, such as on marketing pages.
- The migration was divided into two stages. PR 1 replaced Next.js dependencies such as next/image, next/head, and next/router with native browser APIs or framework-agnostic alternatives without touching the framework itself. PR 2 actually migrated over 200 routes.
- Added Nitro as the server layer and replaced next.config.js with Nitro configuration. Integrated over 500 redirects, security headers, and caching rules in one place. Also, replaced Node.js APIs (Buffer, url.parse, etc.) that Next.js polyfilled with browser-native alternatives, resulting in cleaner code.
Evidence
- There was a case sharing from a team that experienced a similar migration. Integrating a Next.js landing page and a TanStack Router SPA into a single Vite + TanStack Start app reduced build time from 12 minutes to under 2 minutes, and it no longer made sense to fight Next.js's server-first assumptions in a client-centric, real-time state app.
- There were reports that Next.js builds were particularly slow on the Railway platform. Railway is container-based, so a 2-minute build on Vercel takes 12 minutes on Railway, while direct VPS deployment takes about 20 seconds. This adds context to Railway's migration decision.
- There was concern that developers using AI coding tools would be more strongly drawn to Next.js/Vercel, given that LLMs are very familiar with Next.js and the Vercel ecosystem and Vercel is aggressively investing in LLM tool integration.
- There was also critical feedback that 2 minutes is still too long. There were comments like 'a 2-minute build is still ridiculous' and a cynical response like 'amazing that 10 minutes was normal. How far we've fallen'.
- It was pointed out that the original article did not mention which version of Next.js was being used or whether Turbopack was enabled. Since build times could change if Turbopack was enabled, the point of comparison is unclear.
How to Apply
- If your current Next.js app is client-centric (SPA, dashboard, real-time features-focused) and builds take 5 minutes or more, you can refer to the method of migrating in two PRs. Replacing Next.js-specific APIs such as next/image, next/head, and next/router with framework-agnostic alternatives in the first PR, and then replacing the framework itself in the second PR can reduce risk.
- If you are managing over 500 redirects, security headers, and caching rules in next.config.js, you can move them to a Nitro server layer and integrate them into a single file. Like Railway's case, you can achieve both configuration file unification and code cleanup.
- If you are implementing layouts on top of the Pages Router with custom abstractions, TanStack Router's Pathless Layout Route can replace those workarounds. You can also automatically obtain file system-based route generation and type-safe routing.
- If you need image optimization without next/image, you can use edge image optimization from a CDN like Fastly, as Railway did, or leverage external services like Cloudflare Image Resizing to achieve the same effect without framework dependency.
Terminology
Related Papers
Jamesob's guide to running SOTA LLMs locally
2천 달러짜리 RTX 3090 한 장부터 4만 달러짜리 RTX PRO 6000 4장 셋업까지, 로컬에서 최신 LLM을 직접 돌리는 방법을 하드웨어 선택·구성·실행 설정까지 통째로 정리한 실전 가이드다.
Faster embeddings: how we rebuilt the ONNX path in Manticore
Manticore Search가 기존 SentenceTransformers/Candle 백엔드를 ONNX Runtime으로 교체해 텍스트 임베딩 생성 속도를 평균 14배 향상시켰다. 별도 모델 서비스 없이 DB 내부에서 직접 임베딩을 처리하는 구조에서 INSERT 속도가 곧 임베딩 속도이기 때문에 이 개선은 실질적인 ingest 처리량 향상으로 직결된다.
Asymmetric Quantization: Near-Lossless Retrieval with 97% Storage Reduction
멀티벡터 검색 모델의 문서 벡터를 1비트 이진값으로 압축하고 쿼리 벡터만 int8로 유지하는 비대칭 양자화 기법으로, 스토리지를 97% 줄이면서 검색 품질 손실을 0.61점(NDCG@10 기준)에 그치게 만든 실제 프로덕션 적용 사례다.
Show HN: Bash4LLM+ – A lightweight, dependency-free Bash wrapper for LLM APIs
Python이나 Node.js 없이 순수 Bash만으로 Groq 등 OpenAI 호환 LLM API를 호출할 수 있는 단일 스크립트 도구로, Termux(Android)를 포함한 모든 Unix 환경에서 동작한다.
Wayfinder Router: deterministic routing of queries between local and hosted LLM
프롬프트의 복잡도를 모델 호출 없이 오프라인으로 점수화해서 간단한 쿼리는 로컬 모델로, 어려운 쿼리는 유료 모델로 자동 라우팅하는 CLI 도구다. LLM 비용을 줄이면서도 응답 품질을 유지하고 싶은 개발자에게 유용하다.
Apple Neural Engine: Architecture, Programming, and Performance
Apple 기기에 내장된 AI 전용 칩인 ANE(Apple Neural Engine)를 리버스 엔지니어링으로 분석한 302페이지짜리 기술 문서로, Core ML 아래 숨겨진 내부 구조와 직접 접근 경로를 처음으로 공개한다.