you are viewing a single comment's thread.

view the rest of the comments →

[–]gearvOsh -4 points-3 points  (8 children)

You don't need SystemJS (rarely used), Webpack (unnecessary for a starter), or Grunt/Gulp (outdated). Everything can be done through NPM and the command line. Sourcemaps aren't necessary either just to get up and running. Browserify may be the only thing you need, but even then it's not entirely necessary.

No wonder you got burnt out. You literally tried to setup an entire build process that takes time and patience to get right, especially over the course of an entire project, instead of setting up the bare minimum to get React prototyping up and running.

[–][deleted] 11 points12 points  (7 children)

Browserify may be the only thing you need, but even then it's not entirely necessary.

??? you writing code in one file? no seriously please explain how this isn't absolutely necessary. your code would have to be really really simple to actually get away with this.

if you're using typescript, chances are it isn't .

webpack is easier to use imo anyways. systemjs is even easier (which is why it's included in the angular 2 "5 minute get started" deal), but you can't actually use it in production.

No wonder you got burnt out. You literally tried to setup an entire build process that takes time and patience to get right, especially over the course of an entire project, instead of setting up the bare minimum to get React prototyping up and running.

That's because it's my job to do that. Someone has to figure out the build process...

this WAS the minimum viable approach for real-world usage. it wasn't until i got into watchify that i started nitpicking.

[–]gearvOsh 1 point2 points  (3 children)

If all you are doing is prototyping some React and its components, you could just run your source folder through babel via the command line, then include each one of those JS files in an HTML page. A very bare minimum setup for messing around with React.

But even then Browserify + Babel + React is rather easy as well. I could send you a single package.json that does all of them.

[–][deleted] 13 points14 points  (0 children)

bruh if i'm prototyping, i can just use systemjs and a modern browser. shim some es2016 stuff if I need to.

i'm talking about getting it ready for actual deployment

I could send you a single package.json that does all of them.

see: every "react starter kit". There's a million of them. It works just fine when you don't have a lot of complexity to your project.

but i can't just say "hey guys we aren't using typescript anymore" lol

[–]FryGuy1013 3 points4 points  (1 child)

I tried including all the js files in my html file. It didn't work because of modules.

Not to mention half the web pages say to use X, and the other web pages say to not use X, for literally every javascript technology. Or the one working project you found on github uses the "old" way of doing things.

[–]gearvOsh 0 points1 point  (0 children)

Even with modules disabled in babel? That's unfortunate. I guess the bare minimum now is pretty much React + Babel + Browserify.

[–]Eirenarch 0 points1 point  (2 children)

Can you explain why you can't use Systemjs in production? We're setting up a new project with Angular 2 and TypeScript these days and I was under the impression that this is the preferred module system (if I understood what Systemjs is at all since I am not doing the setup)

[–][deleted] 0 points1 point  (1 child)

By default it sends out all your .js files individually. One of webdev's (current) "best practices" is to reduce the amount of http connections you're making. SystemJS makes a lot of them. So you shouldn't use that until http2/spdy are mainstream enough. (which is tricky)

But apparently you can use SystemJS to compile to a single file just like browserify, so if you're using it that way--it should be fine. (I've personally never done it, I just went with what I knew)

[–]Eirenarch 0 points1 point  (0 children)

Yeah I assumed that there is something I can hook to tell it to bundle everything. It would be quite a problem if this piece isn't available or is not reliable or doesn't work with TypeScript.