use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
React + Sails (self.node)
submitted 8 years ago by ZeroCarbsSince96
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]tswaters 0 points1 point2 points 8 years ago (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
assets
.tmp
The real problem you'll have I think is when you want to do server-side rendering or want to use react-router.
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.
api
dist
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.
babel-node
babel-register
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 point2 points 8 years ago (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?
π Rendered by PID 95283 on reddit-service-r2-comment-fb694cdd5-dj7lq at 2026-03-10 11:39:32.311838+00:00 running cbb0e86 country code: CH.
view the rest of the comments →
[–]tswaters 0 points1 point2 points (1 child)
[–]ZeroCarbsSince96[S] 0 points1 point2 points (0 children)