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
Nuxt.jsが掲げる"Universal Vue.js Applications"とは何者か
Search
Yosuke Ishikawa
October 04, 2017
Programming
10
2.8k
Nuxt.jsが掲げる"Universal Vue.js Applications"とは何者か
Yosuke Ishikawa
October 04, 2017
Tweet
Share
More Decks by Yosuke Ishikawa
See All by Yosuke Ishikawa
効率的な開発手段として VRTを活用する
ishkawa
1
230
アプリを起動せずにアプリを開発して品質と生産性を上げる
ishkawa
0
4.5k
Achieving Testability in Presentation Layer
ishkawa
4
3.9k
Introducing Wire: Dependency Injection by Code Generator
ishkawa
12
1.4k
Declarative UICollectionView
ishkawa
28
8.4k
Static Dependency Injection by Code Generation
ishkawa
15
6.7k
実践クライアントサイドSwift
ishkawa
24
4.4k
JSON-RPC on APIKit
ishkawa
5
66k
RxSwiftは開発をどう変えたか?
ishkawa
12
4.1k
Other Decks in Programming
See All in Programming
AI時代のキャリアプラン「技術の引力」からの脱出と「問い」へのいざない / tech-gravity
minodriven
22
8.1k
PostgreSQL を使った快適な go test 環境を求めて
otakakot
0
370
go directiveを最新にしすぎないで欲しい話──あるいは、Go 1.26からgo mod initで作られるgo directiveの値が変わる話 / Go 1.26 リリースパーティ
arthur1
2
400
DSPy入門 Pythonで実現する自動プロンプト最適化 〜人手によるプロンプト調整からの卒業〜
seaturt1e
1
380
ふん…おもしれぇ Parser。RubyKaigi 行ってやるぜ
aki_pin0
0
120
RAGでハマりがちな"Excelの罠"を、データの構造化で突破する
harumiweb
8
2k
Ruby x Terminal
a_matsuda
5
510
モジュラモノリスにおける境界をGoのinternalパッケージで守る
magavel
0
3.3k
CSC307 Lecture 11
javiergs
PRO
0
580
Beyond the Basics: Signal Forms
manfredsteyer
PRO
0
110
izumin5210のプロポーザルのネタ探し #tskaigi_msup
izumin5210
1
490
エージェント開発初心者の僕がエージェントを作った話と今後やりたいこと
thasu0123
0
210
Featured
See All Featured
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
180
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.1k
Context Engineering - Making Every Token Count
addyosmani
9
720
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
130
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
200
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
110
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Crafting Experiences
bethany
1
74
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.9k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
1.9k
Google's AI Overviews - The New Search
badams
0
920
Transcript
Nuxt.js が掲げる "Universal Vue.js Applications" とは何者か
None
None
None
Universal Mode SPA Mode
Universal Mode ← こっち SPA Mode
None
None
わかるようでわからない
でも、使ってみたら理解できた
None
None
None
デベロッパーは1 つの Nuxt.js アプリ( ≒ Vue.js アプリ) を 開発するが...
SSR するサーバーも生成される
"Universal Vue.js Applications"
そういう感じか~
Vue.js のアプリと 生成されるサーバーの関係は?
例 ディレクトリ構造 → ルーティングに反映 asyncData() → サーバーサイドで実行
ルーティング
pages ├── index.vue └── items ├── _id.vue ├── create │
└── index.vue └── index.vue Nuxt.js アプリのディレクトリ構造
export function createRouter () { return new Router({ mode: 'history',
base: '/', (中略) routes: [ {path: "/", component: _d26d9516, name: " {path: "/items", component: _8ac95cea, nam {path: "/items/create", component: _4bfc3 {path: "/items/:id", component: _07563ab3 ] }) } 生成されたサーバーのルーティング
asyncData()
asyncData() 最初に取得するデータをSSR
... <script> export default { async asyncData ({ app })
{ const res = await app.axios.$get('/api/item return { items: res.items, nextCursor: res.nextCursor, } } } </script> Nuxt.js アプリの.vue ファイル
let asyncDatas = await Promise.all(Components.m let promises = [] if
(Component.options.asyncData && typeof Com let promise = promisify(Component.options.a (中略) promises.push(promise) } (中略) return Promise.all(promises) })) context.nuxt.data = asyncDatas.map(r => r[0] || で実行してdata にセット
要するに
Vue.js アプリを書いてたら SSR するサーバーが生成される
None
サーバーはNode.js
サーバーの動作はカスタマイズ可能 外れすぎない範囲で使うのが良さそう