Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
モダンJSフレームワークのビルドプロセス 〜なぜReactは503行、Svelteは12行なのか〜
Search
Maple
November 18, 2025
Programming
450
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
モダンJSフレームワークのビルドプロセス 〜なぜReactは503行、Svelteは12行なのか〜
JSConf 2025
の登壇資料です。
Maple
November 18, 2025
More Decks by Maple
See All by Maple
検索機能リプレイスを4ヶ月→2ヶ月に! AI Agentで実現した2倍速リプレイス
fuuki12
4
1.4k
フロントエンドチームでリアーキテクチャを行っています!
fuuki12
0
320
Other Decks in Programming
See All in Programming
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
720
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.7k
Spring Security 実践 ─ GraphQL APIで実務に役立つ 認証・認可 を学ぶ
wagyu
0
250
Hunting Vulnerabilities in Symfony with LLMs
vinceamstoutz
0
550
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.3k
JJUG CCC 2026 Spring: JSpecify で実現する Kotlin フレンドリーな Java API 設計
ternbusty
1
180
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
720
The NotImplementedError Problem in Ruby
koic
1
860
Oxlintのカスタムルールの現況
syumai
6
1.1k
依存関係から依存物へ―Dependencyという言葉の歴史をひも解く
j_lee
0
120
Strategic Design in the Frontend: Moduliths & Micro Frontends @DDDEurope
manfredsteyer
PRO
0
110
過去最大のMCPアップデート! 2026-07-28 RC版の謎に迫る
licux
6
370
Featured
See All Featured
Crafting Experiences
bethany
1
180
Six Lessons from altMBA
skipperchong
29
4.3k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.5k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
750
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
310
How to Ace a Technical Interview
jacobian
281
24k
Building AI with AI
inesmontani
PRO
1
1.1k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
Facilitating Awesome Meetings
lara
57
7k
ラッコキーワード サービス紹介資料
rakko
1
3.7M
Odyssey Design
rkendrick25
PRO
2
700
Building an army of robots
kneath
306
46k
Transcript
モダンJSフレームワークの ビルドプロセス なぜReactは503行、Svelteは12行なのか フロントエンド テックリード Maple
登壇者紹介 Name Maple Carrier 株式会社SODA Hobby Comment ピアノ、アニメ オフライン登壇初めてです。 2
Agenda 1. 実測値 2. 抽象化アーキテクチャ 3. Svelteのコンパイル戦略 4. React Compilerと未来予想
3
実測値 同じボタンコンポーネントが503行 , 12行になる現実 1. 4
Version Bundler Build Command React 19.1.1 esbuild 0.19.0 esbuild --bundle
--minify --format=esm React Version Bundler Build Command Svelte 5.0.0 Vite 5.0.0 vite build --minify Svelte ビルド環境情報 5
ビルド前ソースコード 1 2 3 4 5 6 7 8 9
10 11 import from export default function const return button button { useState } ; () { [count, setCount] ( ); ( < onClick={() (count )}> Count: {count} </ > ); } 'react' Counter useState setCount = => + 0 1 1 2 3 4 5 6 7 < > let count = 0; </ > < on:click={() count }> Count: {count} </ > script script button button => ++ React Svelte 6
ほぼ同じコード... しかし、ビルドすると? 7
ビルド後ソースコード 1 2 3 4 5 6 7 8 9
var var var var var var var function return __create Object.create; __defProp Object.defineProperty; __getOwnPropDesc Object.getOwnPropertyDescriptor; __getOwnPropNames Object.getOwnPropertyNames; __getProtoOf Object.getPrototypeOf; __hasOwnProp Object.prototype.hasOwnProperty; (cb, mod) () { mod ( , cb[ (cb)[ ]])((mod { exports {} }).exports, mod), mod.exports; }; = = = = = = = => || = : __commonJS __require __getOwnPropNames 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 import as from var export default function let var var $ ; root $. ( ); ($anchor) { count $. ( ); button (); text $. (button); $. (() $. (text, ${$. (count) } )); $. ( , button, () $. (count)); $. ($anchor, button); } * = = = = => ?? => 'svelte/internal/client' `<button> </button>` `Count: '' ` 'click' template Button state root child template_effect set_text get event update append 0 React 503行 Svelte 12行 8
同じUIなのに、 なぜこれほど違うのか? 9
この謎を解明するため、 ビルドプロセスを詳しく 見ていきましょう 10
抽象化アーキテクチャ なぜ503行が必要なのか - 5つの抽象化層の詳細 2. 11
第1層:Component Foundation System createElement, Component基盤、 共通ユーティリティ 第2層:JSX Transformation System JSX変換、動的コンポーネント生成、
Props管理 第3層:UI Update Optimization System UI最適化 第5層:State Management System 状態管理、副作用処理、ライフサイクル 抽象化 第4層:Rendering Control System レンダリング制御 抽象化アーキテクチャ概要 12 ※これは私がReactのビルド後コードを理解しやすくするために整理した独自の分類です
第1層: Component Foundation System 目標 コンポーネントの基盤処理 を実現する 13
createElement: JSX→Virtual DOM Component基底クラス 開発時型チェック Context API基盤 実行時に必要な処理 React ランタイムで処理
コンパイル時で処理 テンプレート→直接DOMコード コンポーネントコンパイル TypeScript統合型チェック 自動依存追跡 同じ目標を異なる戦略で達成 Svelte VS 14
第2層: JSX Transformation System 目標 JSX/テンプレートをDOMに 変換する 15
JSX→createElement変換 動的コンポーネント生成 Props管理と検証 実行時に必要な処理 React ランタイムで処理 コンパイル時で処理 テンプレート→DOM変換 静的コンポーネント解析 TypeScript統合型システム
同じ目標を異なる戦略で達成 Svelte VS 16
第3層: UI Update Optimization System 目標 UI更新を最適化して実行する 17
実行時に必要な処理 仮想DOM表現生成 Diffアルゴリズム 最小限DOM操作 React ランタイムで処理 コンパイル時で処理 コンパイル時更新解析 自動依存追跡 直接DOM操作コード生成
ゼロオーバーヘッド 同じ目標を異なる戦略で達成 Svelte VS 18
第4層: Rendering Control System 目標 レンダリングのパフォーマンス を制御する 19
実行時に必要な処理 中断可能レンダリング Lanes優先度管理 Fiber仮想スタック Concurrent機能 React ランタイムで処理 コンパイル時で処理 シンプルな同期更新 tick()で手動制御
直接実行 予測可能なパフォーマンス 同じ目標を異なる戦略で達成 Svelte VS 20
第5層: State Management System 目標 状態管理とリアクティブ 更新を実現 21
実行時に必要な処理 useState, useReducer useEffect 副作用制御 useMemo, useCallback カスタムHooks React ランタイムで処理
コンパイル時で処理 ネイティブlet/const $: リアクティブ文 自動依存追跡 JavaScript関数 同じ目標を異なる戦略で達成 Svelte VS 22
異なる戦略で同じ目標を達成 23
Svelteのコンパイル戦略 3. 12行を実現するコンパイル時処理 24
抽象化層をすべて削除する Component Foundation System JSX Transformation System UI Update Optimization
System Rendering Control System State Management System 削除される5層 残る必要最小限の機能 直接DOM操作 イベントハンドラー 状態更新関数 25
React Compilerと未来予想 Svelte5 ,React Compiler 4. 27
React Compilerのアプローチ VDOMは維持 自動メモ化でVDOM差分処理を最小化 不要な再レンダリングを抑制 useMemo/useCallback/React.memoが不要に ビルド時自動最適化 26
私が考えるこれまでの変遷と未来予想 2006-2014 jQuery時代 シンプルなDOM操作API プラグインエコシステムの充実 2015-2018 Virtual DOM時代 React, Vue
2が主流 ランタイム抽象化による開発者体験向上 2019-2024 Svelte, Solid.js 認知拡大 パフォーマンス重視へ回帰 ランタイムオーバーヘッドの削減 2025- ハイブリッド時代 React Compiler 既存フレームワークでコンパイル最適化を採用 28
Thank You! 29