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
next.jsを使ったuniversal React 入門
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Hori Godai
December 14, 2018
Programming
340
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
next.jsを使ったuniversal React 入門
Hori Godai
December 14, 2018
More Decks by Hori Godai
See All by Hori Godai
TypeScript Compiler APIを使って 型のユニットテストをブラウザーで動かす
steelydylan
3
290
エディター付きのReact開発環境を ブラウザーだけで実装した話
steelydylan
9
2.1k
HonoでReact・TypeScriptの実行環境をブラウザー上に作る
steelydylan
1
2.7k
複数ピンをまとめて表示するYahoo!地図用のJavaScriptライブラリをつくりま作りました
steelydylan
1
1.3k
Nuxtでのサーバー、クライアント間データ共有について
steelydylan
0
1k
a-blog cmsの静的書き出し機能を使って、 自分のブログを100%静的にした話
steelydylan
0
450
MySQLの GEOMETRY 型とJavaScriptの Geolocation API の活用事例
steelydylan
1
540
アップルップルの新しいオープンソースの紹介
steelydylan
0
570
a-blog cms をよくするために 取り組んだ3つのこと
steelydylan
0
650
Other Decks in Programming
See All in Programming
kubernetes コンポーネント開発入門 / 新卒N年目の勉強会&交流会!〜〇〇への誘い〜 #n_study
mazrean
0
160
FastAPI の並行処理モデルを完全に理解する
hoto17296
9
3.8k
Webエンジニアなのにブラウザの仕組みがわからないので、Pythonで自作してみた
tatsuki12
4
1.7k
XHTMLが残したもの
yosuke_furukawa
PRO
1
410
DynamoDBの基礎を振り返りながらベクトル検索機能を理解する
musan
3
270
AI駆動開発にグラフDBを重ねてみた
satoshi256kbyte
2
740
Laravelのアプリケーションをどこにデプロイするか #ツナギメオフライン.9
akase244
0
120
{ Android | Kotlin } Gradle Plugin in 2026
ryunen344
1
290
私のClaude Code活用法 (個人開発編) - PHPerKaigi mini #4(2026/08/24)
panda_program
1
210
GraphRAGのKnowledge Graphを 直接!見る/View-GraphRAG's-KnowledgeGraph-directly!
tyumugi1113
0
240
バグを直したら useEffect が消えた
colorful12
3
840
新人はどこまで自力でやり、どこからAIに頼るべきか/エンジニア育成に向き合う_先輩たちの悩みと知見共有会
toppan_digital_dev
1
560
Featured
See All Featured
A designer walks into a library…
pauljervisheath
211
25k
4 Signs Your Business is Dying
shpigford
187
23k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4.3k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
890
Believing is Seeing
oripsolob
1
210
Into the Great Unknown - MozCon
thekraken
41
2.7k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.8k
Design in an AI World
tapps
1
300
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.5k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
310
From π to Pie charts
rasagy
0
350
Transcript
next.jsを使ったuniversal React入門
自己紹介
自己紹介 @steelydylan React, TypeScript が大好きなフロントエンドエンジニア
目次 Universal JavaScriptとは Reactを使う場合 next.jsがオススメの理由 next.js 説明 next.js高度な使い方 netlifyとは netlifyとの連携
lambda functionとは netlifyの lambda function の利用
Universal JavaScriptとは フロントエンド、サーバーサイドに左右されず一貫して動くJavaScript のこと
Reactの場合 Express.js next.js
Next.jsがおすすめ 理由 TypeScriptを使いやすい フロントエンドとサーバーサイドで処理をわけやすい
next.jsがおすすめ $ npm install --save next react react-dom
next.jsがおすすめ { "scripts": { "dev": "next", "build": "next build", "start":
"next start" } }
next.jsがおすすめ ./pages/index.js を作成し、 export default () => <div>Welcome to next.js!</div>
next.jsがおすすめ これだけ!
next.js高度な設定 TypeScriptを利用 styled‑componentをSSRする
TypeScriptを利用 Babelのpresetを下記のように記述 .babelrc "presets": [ "next/babel", "@zeit/next-typescript/babel" ], next.config.js const
withTypescript = require('@zeit/next-typescript') const withCSS = require('@zeit/next-css') module.exports = withTypescript(withCSS());
styled‑componentをSSR .babelrc "plugins": [ [ "styled-components", { "ssr": true, "displayName":
true, "preprocess": false } ] ]
netlifyとは 静的サイトを簡単に公開することができるサイト gitとの連携が容易で、pushされた時のビルドコマンドを指定することが できる! npm run build など
netlifyとの連携 package.json "scripts": { "build": "next build && npm run
lambda" }
lambda function とは サーバーを必要とせず、必要時にのみ関数を実行できるもの Node.jsなどの言語にも対応している。
netlifyの lambda function の利用 npm install netlify-lambda --save-dev
netlifyの lambda function の利用 package.json "scripts": { "lambda": "netlify-lambda build
functions", "lambda-local": "netlify-lambda serve functions", }
netlifyの lambda function の利用 netlify.tomlの作成 [build] command = "npm run
export" publish = "out" functions = "lambda"
netlifyの lambda function の利用 記述例 exports.handler = async (event, context,
callback) => { return callback(null, { statusCode: 200, headers: { 'Content-type': 'application/json' }, body: JSON.stringify({ test: 'hoge' }) }); };
netlifyの lambda function の利用 run.jsという名前で作成した場合、下のURLでアクセス可能 https://example.com/.netlify/functions/run
実際のgithubレポジトリ https://github.com/steelydylan/next‑starter‑kit