Rails to Next.js Without a Big Bang

Rails to Next.js Without a Big Bang

How we modernize the UI of a Rails monolith one page at a time, with no feature freeze. Three tools: feature flags, micro frontends, and AI agents. Also a look at AI exploratory testing with Playwright MCP, for when QA becomes the bottleneck. JSConf Japan 2026. English with Japanese subtitles.

Firdaus Al Ghifari

November 22, 2026

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

10 slides
  1. JSConf Japan 2026 Rails to Next.js Without a Big Bang

    ビッグバンなしで Rails から Next.js へ Modernizing a Rails monolith's UI: Feature Flags, Micro Frontends, AI agents RailsモノリスのUIをモダン化:フラグ‧マイクロフロントエンド‧AI Alghi / アルギ Software Engineer @ Money Forward Web Frontend Committee Core Member | OpenFeature & Flipt Contributor (OSS)
  2. Nobody dreams of migrating. 誰も移⾏を夢⾒てはいない。 Everybody is doing one. でも、みんなやっている。

    What goes on the roadmap • New feature 新機能 What we actually do • Upgrade the stack スタックのアップグレード • Redesign • Move old pages to the new UI リデザイン 古いページを新しいUIへ移⾏ • AI assistant • Same behavior, new code AIアシスタント 同じ動作、新しいコード • Shiny dashboard かっこいいダッシュボード • Keep payroll correct 給与計算の正しさを守る Hands up: have you ever worked on a migration? ⼿を挙げて:移⾏プロジェクトに関わったことはありますか? © Money Forward, Inc. 1
  3. Legacy is just code that made money レガシーとは、お⾦を⽣んだコードのこと A big

    bang puts it at risk. Our Payroll UI today (approx.) ビッグバンでの書き換えはそれを危険にさらす So we go gradual: ✓ No feature freeze 機能凍結なし ✓ One page at a time 1ページずつ ✓ Roll back by flipping a flag Rails-rendered UI React UI 80% 20% Mostly Rails-rendered. React is growing. フラグで元に戻せる © Money Forward, Inc. 2
  4. Rails stays the front door Rails が⼊り⼝のまま Routing rules never

    change per page. A flag does the switching. ルーティングルールはページごとに変わらない。切り替えはフラグが⾏う。 Next.js app /new/* (e.g. /new/settings) Router Browser simple path rules Flag ON Rails redirects to the new page Rails monolith everything else (e.g. /settings) © Money Forward, Inc. 3
  5. Ship dark. Turn on later. Delete the flag. こっそり出荷。あとでオン。フラグは削除。 Tool

    1: Feature flags ツール1:フィーチャーフラグ evaluate flag Client app locally, no network call Feature Flag SDK local flag cache refresh flags periodically on error: keep cached flags Feature Flag Server self-hosted Next.js page (React side) Flag OFF New React page returns 404. Rails page stays. Flag ON New React page shows content. Rails redirects to React. © Money Forward, Inc. const [enabled] = useFlag("new-page"); return enabled ? <New /> : <NotFound />; 4
  6. Migrate a widget before a page ページより先にウィジェットを移⾏する Tool 2: Micro

    frontends ツール2:マイクロフロントエンド Micro frontends in production Rails page (server-rendered) 本番で動くマイクロフロントエンド React + Vite, not Next.js React widget: Notification React + Vite(Next.js ではない) React widget: Feature X Started with one small widget ⼩さなウィジェット1つから始めた 1. Request Browser asks Rails for the page (/settings) © Money Forward, Inc. 2. Render Rails returns HTML with a custom element for the widget 3. Load Loads the Vite bundle from /new/mfe/*, served by Next.js 4. Mount Widget mounts in the page, calls the API and renders 5
  7. Skills turn a migration into a pipeline スキルで移⾏をパイプラインにする Tool 3:

    AI agents ツール3:AIエージェント 1 Scope 2 Explore Spec API UI Validate Release Orange circles are human checkpoints. A flag is mandatory. ~60% faster specs AI exploratory testing Open to non-engineers 仕様作成が約60%速い AIによる探索的テスト エンジニア以外にも開かれている Spec writing time (est.) Finds bugs, reduces manual testing A designer shipped a page in 2 to 3 weeks © Money Forward, Inc. 6
  8. Build got fast. Release didn't. ビルドは速くなった。リリースは速くならなかった。 Plot twist, the bottleneck

    moved どんでん返し:ボトルネックが移った React pages (illustrative) Live ▪ Live ▪ In progress ▪ Still to go Still to go QA effort (illustrative) QA effort needed QA capacity available Our answer (pilot): AI agents to help impact analysis, test cases creation, and test execution using Playwright MCP and knowledge bases 私たちの答え(パイロット):AIエージェントで影響分析、テストケース作成、テスト実⾏を⽀援 © Money Forward, Inc. 7
  9. AI exploratory testing: how it works AI探索的テストの仕組み The agent drives

    the browser. Humans read the report. エージェントがブラウザを操作し、⼈がレポートを読む Plan Spec, test plan, knowledge base Agent Skill runs the plan step by step Playwright MCP Drives a real browser Report PASS, FAIL or OBSERVATION Human Reads the report and decides Setup and rules Origins Only localhost, staging, production © Money Forward, Inc. Production Read-only: navigate and assert Feature Flags Confirm ON or OFF before each run 8
  10. Three things I would tell my past self 過去の⾃分に伝えたい3つのこと Lessons

    learned 学んだこと 1 2 3 Flags are debt Slice by user value フラグは負債 ユーザー価値で分割する AI moves the bottleneck Plan the deletion on day one. Not by code size. Small pages first. AIはボトルネックを移す Fix the next one before it hits you. A migration without a big bang is a lot of small, boring wins. Make them cheap and reversible. ビッグバンなしの移⾏は、⼩さく地味な成功の積み重ね。安く、元に戻せるようにしよう。 Alghi | Q&A | linkedin.com/in/alghi | github.com/falghi © Money Forward, Inc. 9

Other Decks in Programming