Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 762 Bytes

File metadata and controls

21 lines (16 loc) · 762 Bytes

Server Rendering with ReactJs, Webpack, and Rails

SPIKE with Samnang and Justin on making React server render with Webpack!

Setup:

  1. bundle
  2. cd client && npm i
  3. $(npm bin)/webpack -w
  4. open another terminal and start rails

Notes:

  1. You can mark the globals to export in one of 2 ways: a. Use global.Something = Something (see Global.js) b. Declare in webpack config file
  2. models/execjs_renderer changes often require a server restart. However, changing the contents of the javascript file don't seem matter, so long as webpack recompiles it.

References

  1. Charlie Marsh's article "Rendering React Components on the Server"
  2. Node globals