Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
React & ES6 with Sprockets
Search
yachibit
June 04, 2015
Programming
6.5k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
React & ES6 with Sprockets
yachibit
June 04, 2015
More Decks by yachibit
See All by yachibit
企画を Software Factory-ready にする——開発が高速になったとき、PdMの仕事はどう変わったか
yachibit
1
330
もしgroovesのPMが ドラッカーの 『マネジメント』を読んだら
yachibit
0
240
Rails and Rack
yachibit
0
130
社会人になってから大学院でUXを学んでいる話
yachibit
0
800
エンジニアが人間中心設計をやってみた/engineer-challenged-hcd
yachibit
3
5.1k
Other Decks in Programming
See All in Programming
AI時代のIaC入門 〜なぜインフラをコードで管理したいのか?〜 / Introduction to IaC in the AI Era
akihisaikeda
6
1.4k
선언형 햅틱 라이브러리 진동을 소개합니다
l2hyunwoo
1
280
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
3
1.4k
Coding with AI: How to trust the storyteller (AWS Community Day Adria, Ljubljana 2026)
slobodan
0
140
Inertia Rails: The One-Person Framework with React & Friends
skryukov
0
380
あなたの await、OS まで届いてる? strace で覗く JavaScript の非同期
hasutosasaki
1
2.2k
Web Framework Benchmark Battle 2026, Any%
a_matsuda
3
3.1k
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
270
AmebaブログはKMPから卒業します
kmars0605
0
320
AI駆動開発4年目の現在地(『あなたはFDEになるべきか?』イベント資料)
kumaiu
0
130
ActionController meets Protocol Buffers
sorah
1
780
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
2k
Featured
See All Featured
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
The Cost Of JavaScript in 2023
addyosmani
56
10k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8.2k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
Exploring anti-patterns in Rails
aemeredith
4
560
Rails Girls Zürich Keynote
gr2m
96
14k
ラッコキーワード サービス紹介資料
rakko
5
5.7M
30 Presentation Tips
portentint
PRO
1
460
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
Believing is Seeing
oripsolob
1
270
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
580
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
440
Transcript
React & ES6! with Sprockets Omote-sando.rb #1 June 4, 2015
by @yachibit
me • name: ୩ ༞ଠ (Yuta Yachi) • id: yachibit
• founder: Omote-sando.rb • company: Grooves Inc. • love: :beers:
None
Today’s Goal • Want to use ES6 !! • Want
to use browserify !!!! • Server-side rendering for SEO • Manage JS libraries with npm & gulp • Keep features of Assets-pipeline
Sprockets • Dependencies management of JS and CSS • Transpile
altJS • Minify & compress assets • Inserts an MD5 fingerprint into each filename
Cons of Sprockets • Depend on a library version of
gem • Not good compatible with JS ecosystem • browserify, babel, power-assert, jade …
Pros of Sprockets • Assets are served as separate filesʢin
developmentʣ • Responds with a new compiled file If files have changed • Invalidate caches by altering MD5 fingerprint
Use React & ES6 with Sprockets
Use React & ES6 with Sprockets • 1. Write JSX
with ES6. e.g. `frontend/javascripts/` • 2. Transpile with gulp & babel • 3. Place transpiled files in `app/assets/javascrips/ components` • 4. Process with Sprockets
gulpfile.coffee
Why use react-rails?
Why use react-rails? • Server-side rendering • `react_component` helper •
easily to use `renderToString` in Rails Views
Sample • https://github.com/yachibit-sandbox/ react_with_rails_and_gulp
THX :beers:
Refs • RailsGuides - The Asset Pipeline • http://guides.rubyonrails.org/asset_pipeline.html •
Sprockets࠶ߟ ϞμϯͳJSͷΤίγεςϜͱRailsͷΑΓྑ͍ؔΛ୳͢ • http://qiita.com/joker1007/items/9068e223744b3ac8c6dd • RailsͰࡢࠓͷJSͷΤίγεςϜ(gulpͱ͔ͦ͏͍͏ͷ)Λ͏ʹ͋ͨͬͯ͜ͷΑ͏ʹͨ͠ͱ͍͏ϝϞ • http://qiita.com/oreshinya/items/3d025dde2edc56622cc4 • 3 ways to integrate Ruby on Rails + React + Flux • http://www.openmindedinnovations.com/blogs/3-ways-to-integrate-ruby-on-rails-react-flux • Gulp on Rails: Replacing the Asset Pipeline • http://viget.com/extend/gulp-rails-asset-pipeline
Refs • Gulp - a modern approach to asset pipeline
for Rails developers • http://blog.arkency.com/2015/03/gulp-modern-approach-to-asset-pipeline-for-rails-developers • Rails, React, Browserify - Packaging your React components • https://medium.com/@olance/rails-react-browserify-e315001d5974 • Can't render browserified JS on server side #181 • https://github.com/reactjs/react-rails/issues/18 • ͳͥ(2015ͷϑϩϯτΤϯυͰɺmakeͰͳ͘)gulpΛબͿͷ͔ • http://mizchi.hatenablog.com/entry/2015/05/11/182118 • npm ͰґଘλεΫҰݩԽ͢Δ • http://qiita.com/Jxck_/items/efaff21b977ddc782971