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
2.9k
10
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Nuxt.jsが掲げる"Universal Vue.js Applications"とは何者か
Yosuke Ishikawa
October 04, 2017
More Decks by Yosuke Ishikawa
See All by Yosuke Ishikawa
効率的な開発手段として VRTを活用する
ishkawa
1
250
アプリを起動せずにアプリを開発して品質と生産性を上げる
ishkawa
0
4.6k
Achieving Testability in Presentation Layer
ishkawa
4
4k
Introducing Wire: Dependency Injection by Code Generator
ishkawa
12
1.4k
Declarative UICollectionView
ishkawa
28
8.6k
Static Dependency Injection by Code Generation
ishkawa
15
6.8k
実践クライアントサイドSwift
ishkawa
23
4.4k
JSON-RPC on APIKit
ishkawa
5
69k
RxSwiftは開発をどう変えたか?
ishkawa
12
4.2k
Other Decks in Programming
See All in Programming
Build-to-own AI: Agentic Development for Humans
inesmontani
PRO
0
130
ビデオ通話が繋がる0.2秒で何が起きているのか
supurazako
2
160
壊れたパーサから始める関数型設計と構成的なパーサ #fp_matsuri
raiga0310
2
420
2年かけて Deno に DOMMatrix を実装した話 / How I implemented DOMMatrix in Deno over two years
petamoriken
0
190
Claude Team Plan導入・ガイド
tk3fftk
0
240
Welcome to the "Parametricity" 🏙️ − Generic だけど Specific な世界 −
guvalif
PRO
1
190
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
470
わからない話を追いかけたら、プログラミング言語を作る側にいた
ydah
2
130
PHP に部分適用が来るぞ!……ところで何それ?おいしいの? #phpcon / phpcon-2026
shogogg
0
440
Haskell/Servantを通してWebミドルウェアを捉え直す
pizzacat83
1
630
Lean は証明の正しさを確認するためだけのツールって思ってませんか?
inoueasei
1
130
【SRE NEXT 2026 Lunch Session】一人目専任SREの立ち上げを加速する ― AIと進めたオンボーディングで2分を0.04秒にした話
pkshadeck
PRO
0
3.3k
Featured
See All Featured
Chasing Engaging Ingredients in Design
codingconduct
0
250
Become a Pro
speakerdeck
PRO
31
6k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.7k
Faster Mobile Websites
deanohume
310
32k
How to Ace a Technical Interview
jacobian
281
24k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
650
Building Adaptive Systems
keathley
44
3.1k
How GitHub (no longer) Works
holman
316
150k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
190
Building an army of robots
kneath
306
46k
It's Worth the Effort
3n
188
29k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.5k
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
サーバーの動作はカスタマイズ可能 外れすぎない範囲で使うのが良さそう