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
Perl でも React.js の server-side rendering がしたい! ...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
zoncoen
June 24, 2015
Programming
0
2.2k
Perl でも React.js の server-side rendering がしたい! / perl meets javascript with reactjs
Gotanda.pm#5 LT 資料
zoncoen
June 24, 2015
Tweet
Share
More Decks by zoncoen
See All by zoncoen
About Merpay Engineering Productivity Team
zoncoen
0
1.9k
Perl の HTTP/2 事情 / HTTP2 in Perl
zoncoen
0
480
YAPC::Asia 2014
zoncoen
0
2.7k
同期的にプレゼンテーションするツールをつくった話
zoncoen
1
1k
Gunosy.go #4 ~ flag.go ~ #gunosygo
zoncoen
0
240
Gunosy.go #3 ~ expvar.go ~ #gunosygo
zoncoen
1
760
初心者がGoでpercol実装してみた話 / Golang + Reveal.js + Websocket で同期的にプレゼンテーションしたい #hikarie_go
zoncoen
0
2.6k
Other Decks in Programming
See All in Programming
「ブロックテーマでは再現できない」は本当か?
inc2734
0
1.1k
Go Conference mini in Sendai 2026 : Goに新機能を提案し実装されるまでのフロー徹底解説
yamatoya
0
380
CSC307 Lecture 12
javiergs
PRO
0
450
Raku Raku Notion 20260128
hareyakayuruyaka
0
420
Claude Codeと2つの巻き戻し戦略 / Two Rewind Strategies with Claude Code
fruitriin
0
190
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
200
Python’s True Superpower
hynek
0
190
Geminiの機能を調べ尽くしてみた
naruyoshimi
0
170
PJのドキュメントを全部Git管理にしたら、一番喜んだのはAIだった
nanaism
0
210
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
2k
Package Management Learnings from Homebrew
mikemcquaid
0
280
Go1.26 go fixをプロダクトに適用して困ったこと
kurakura0916
0
300
Featured
See All Featured
How to Ace a Technical Interview
jacobian
281
24k
Un-Boring Meetings
codingconduct
0
210
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Leo the Paperboy
mayatellez
4
1.5k
Visualization
eitanlees
150
17k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
350
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Designing Powerful Visuals for Engaging Learning
tmiket
0
250
Joys of Absence: A Defence of Solitary Play
codingconduct
1
300
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
350
Transcript
Perl Ͱ React.js ͷ server-side rendering ͕͍ͨ͠ʂ Gotanda.pm #5 @zoncoen
ͱ͍͏ਓ͍Δ͔͠Εͳ͍ ʢੈք͍ʣ
Ͱ͖ΔΑ
What is React.js • JavaScript view library • Facebook
Why server-side rendering? • ॳظϩʔυ࣌ؒͷվળ • SEO ! React.js ରԠͯ͠Δ
• React.renderToString() • ReactElement ͷ initial HTML Λฦ͢ with Node.js
web server React.renderToString(React.createElement(MyClass, {data: data})); <div data-reactid=".1emne5x67eo" data-react-checksum="154602720"></div>
with other languages • Ruby (on Rails): react-rails ! •
Python: python-react ! → ֤ݴޠ͔Β JavaScript ͷؔΛ࣮ߦ react_component('MyComponent', {data: data}, {prerender: true}) render_component('my-component.jsx', {'data': data}, to_static_markup=true)
Perl ͰΕΔʢͣ | ͖ʣ
How to implement • renderToString() ͷ࣮ߦ݁Ռ͕͋Ε͍͍ → Perl ͔Β JavaScript
ͷؔΛ࣮ߦ
JavaScript::V8 • Perl interface to the V8 JavaScript engine •
Latest version released on 28 Dec 2012 … ! • ͱΓ͋͑ͣ V8 v3.14.5.8 Ͱಈ͘͜ͱΛ֬ೝ
Example #!/usr/bin/env perl use strict; use warnings; use utf8; !
use JavaScript::V8; ! my $context = JavaScript::V8::Context->new(); ! my $result = $context->eval(q| (function () { return 'Hello, JavaScript world!'; })(); |); ! print "$result\n";
Demo https://github.com/zoncoen-sample/reactjs_server-side- rendering_with_perl