Upgrade to Pro — share decks privately, control downloads, hide ads and more …

サーバサイドレンダリング、してますか?

 サーバサイドレンダリング、してますか?

サーバサイドレンダリング、してますか?
~ 憧れのIsomorphic JavaScript ~

Meguro.es #6 2016/10/13
http://meguroes.connpass.com/event/39081/

Shimpei Takamatsu

October 13, 2016
Tweet

More Decks by Shimpei Takamatsu

Other Decks in Technology

Transcript

  1.  ▪ ߴদ ਅฏ (@shimpeiws) ▪ WebΤϯδχΞ @ ΞΧπΩ LXࣄۀ෦

    ɹɾRailsͱJavaScriptΛ൒ʑ͘Β͍ॻ͍͍ͯΔ ▪ LX(ϥΠϒΤΫεϖϦΤϯε)ࣄۀ෦ ɹɾཱྀφΧɾΞΫςΟϏςΟɺཱྀߦɺΠϯό΢ϯυͳͲ ɹɾϦΞϧͳମݧͷػձΛఏڙ͢ΔαʔϏε౳Λ޿ؚ͘Ή ࢲ͸୭
  2.  ▪ Presentation Server ɹɾNode.js (Express) Ͱಈ͍͍ͯΔ ɹɾΫϥΠΞϯτ͸·ͣͪ͜ΒʹΞΫηεͯ͘͠Δ ɹɾαʔόαΠυϨϯμϦϯάͨ͠HTMLΛฦ͢ ɹɾDBΞΫηε͸ͤͣ

    σʔλऔಘ͸API Server΁ͷϦΫΤετ ɹɾιʔείʔυ͸ΫϥΠΞϯταΠυͰಈ͘JSͱڞ௨ ▪ API Server ɹɾRailsͰಈ͍͍ͯΔ ɹɾRestͳAPIΛఏڙɺJSONͰϨεϙϯε ɹɾView͸ఏڙ͠ͳ͍ ΞʔΩςΫνϟ
  3.  ▪ ղܾͷํ޲ੑͱͯ͠͸… ɹɾJavaScriptʹدͤΔ (ࣗ෼ͨͪͷνʔϜͷΞϓϩʔν) ɹɹɾSSR΋JavaScriptͰॻ͚ΔΑ͏ʹ͢ΔͨΊʹNode.jsΛ࢖͏ ɹɹɾAPIαʔό͸ผ్༻ҙ͢Δ (API΋Node.jsͰOKͳΒ͹ෆཁ) ɹɾRailsʹدͤΔ ɹɹɾ@r7kamura͞Μͷ

    ”Ruby on Rails on React on SSR on SPA” ͕ۃ·͍ͬͯ Δ (http://r7kamura.hatenablog.com/entry/2016/10/10/173610) ɹɹɾಉ͡ΤϯυϙΠϯτ͕ॳճϦΫΤετͰ͸HTMLΛฦͯ͠ɺϖʔδભҠͷͱ͖ ʹ͸JSONΛฦ͢ ɹɹ ɹɹɾϨεϙϯεܗ͕ࣜมΘΔ͚ͩͰσʔλऔಘϩδοΫ͸ڞ௨ԽͰ͖Δ ɹɹɾRails͔Β౉͢props಺ͷύϥϝʔλͰReactίϯϙʔωϯτΛࢦఆ -> Viewς ϯϓϨʔτͷΑ͏ʹѻ͑Δ ΞʔΩςΫνϟ
  4.  ▪ ࣮ࡍతʹJavaScriptʹدͤΔઃܭͬͯͲ͏ͳΔ? ɹɾref: erikras/react-redux-universal-hot-example ɹɹɾA starter boilerplate for a

    universal webapp using express, react, redux, webpack, and react-transform ɹɹɾඞཁͦ͏ͳ΋ͷ͕Ұ௨ΓೖͬͯΔ! (όʔδϣϯݹ͍͚Ͳ…) ɹɹɾαʔόαΠυͱΫϥΠΞϯταΠυͷڞ༗ͳͷͰͲͪΒ͔ͱ͍͏ͱ Isomorphic *TPNPSQIJD+BWB4DSJQU
  5.  ▪ Ұ൪ͷ伴͸ redux-async-connect ( -> redux-connect ) ɹɾIs redux-async-connect

    dead? #81 https://github.com/Rezonans/redux-async-connect/issues/81 ɹ ɹɾϝϯς͞Εͳ͘ͳͬͯredux-connectʹͳͬͨ ɹɾdecoratorͱͯ͠ఏڙ͞Ε͍ͯΔ ɹɾ͋ΔඇಉظAction͕׬ྃ͢Δ·ͰɺContainerͷඳըΛ஗Ԇͤͯ͘͞ΕΔ *TPNPSQIJD+BWB4DSJQU