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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
yachibit
June 04, 2015
Programming
6.4k
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
もしgroovesのPMが ドラッカーの 『マネジメント』を読んだら
yachibit
0
230
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
20260828_品質と開発生産性を両立させる、AI時代のE2Eテストの考え方
magicpod
0
200
Webの地図
yosuke_furukawa
PRO
6
4.3k
自分的「カンファレンスの楽しみ方」
syumai
0
200
AI に Inclusive UI を書かせよう — Design Rules Skill で Compose UI を作り直す
theoriatec2024
1
470
GKE アップグレード前に知っておきたい Blue/Green と PDB の関係
stkk
0
160
Deep dive into the select statement (GopherCon UK)
jespino
0
180
AI × TiDD / 2026.09.05 Redmine 大阪
tokudiro
1
130
GKE で Pod の見方を変えたら、スケールアウト時の挙動を真に捉えられた話
stkk
0
110
Building an Out-of-Order CPU
latte72
1
760
型解析で実現する Go の言語内 DSL / Conference に Go! タイムテーブルの歩き方 for Gophers
mazrean
0
140
信頼性の目標を誰も求めてない
shubox
0
500
XHTMLが残したもの
yosuke_furukawa
PRO
2
710
Featured
See All Featured
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
690
New Earth Scene 8
popppiees
3
2.6k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
240
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.9k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
270
The Pragmatic Product Professional
lauravandoore
37
7.4k
Speed Design
sergeychernyshev
33
2.1k
How GitHub (no longer) Works
holman
316
150k
The Curse of the Amulet
leimatthew05
2
14k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
4
630
Typedesign – Prime Four
hannesfritz
42
3.2k
Ethics towards AI in product and experience design
skipperchong
2
370
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