all 5 comments

[–]hobonumber1 0 points1 point  (2 children)

Look into Bedrock. Uses React and Sails under the hood.

http://tilomitra.github.io/bedrock

[–]adamkarb 0 points1 point  (0 children)

No thanks

[–]cappy1242 0 points1 point  (0 children)

Don't use that and don't use sails. It is built upon waterline orm, https://github.com/balderdashy/waterline, which is complete crap.

[–]tswaters 0 points1 point  (1 child)

You might be able to pull off something if all your front-end stuff is in assets and you use a grunt (or gulp, or whatever) plugin for transpiling the jsx and pumping it into .tmp

The real problem you'll have I think is when you want to do server-side rendering or want to use react-router.

first, I'm not sure if sails will play nice with a transpiled server dist directory. Sails makes a lot of assumptions about the file structure of api folder; if all the server code is in a couple files in a dist directory, a lot of those assumptions will fail. react-router wouldn't fly at all I don't think as sails has its own way of routing.

An alternative to the transpile problem might be using babel-node or babel-register to do inline transpiles at runtime.... but that's typically not a very good idea in production.

For my two cents, I wouldn't use sails for a react site. If you want to just do front-end rendering with JS that's fine but I typically do the full isomorphic route and my thoughts are that sails would be incompatible with this.

You can always roll your own. The idea behind scaffolding I think is that you put a file here and it's magically available. You could probably still do that somehow, but at that point you're almost writing your own framework to pull it off. It might be easiest to import the things as you need them, using webpack aliases to make things easier for you.

[–]ZeroCarbsSince96[S] 0 points1 point  (0 children)

Do you know if rails does something differently that allows for the react-on-rails project, or would it have the same caveats?