News for hackers. Stuff that matters.
Re:Angular 2 Fundamentals Course by kimshibal on Friday July 29, 2016 @12:14PM (#12187827)
You don't need all that to create SPA app. it's bloated framework.
Re:Angular 2 Fundamentals Course by andys627 on Friday July 29, 2016 @02:04PM (#12188641)
I wonder where the happy medium is. Setting up React/Redux/React-redux/react-router/react-redux-router/react-redux-router-thunk/webpack-hot-module-oh-my-god-what-am-i-doing takes forever.
Re:Angular 2 Fundamentals Course by yogthos on Friday July 29, 2016 @04:20PM (#12189673)
Honestly, the fact that people put up with this in Js ecosystem amazes me to no end. I've been working with ClojureScript on the front-end for the past year, and it's just night and day.

There's a single build tool (http://leiningen.org/), and it manages dependencies, tests, builds, etc. Things just work.

Setting up a new project is as simple as:

lein new reagent-frontend myapp

I can go and start developing it by running

lein figwheel

After it starts I can open the browser at localhost:3449 and any changes I make in the source will be immediately reflected. Once I want to package for release I just do:

lein clean lein release

That's it, I now have minified and pruned Js file that's ready for production.

Re:Angular 2 Fundamentals Course by danabramov on Wednesday August 03, 2016 @07:19AM (#12217157)
This is pretty much what we’re doing with Create React App.

    npm i -g create-react-app
    create-react-app my-app
    cd my-app
    npm start # start devserver
    npm run build # build for production
Re:Angular 2 Fundamentals Course by yogthos on Friday August 05, 2016 @04:01PM (#12235357)
Sure, but how do you go about doing things like managing dependencies, doing hot code loading, running tests, and so on?
Re:Angular 2 Fundamentals Course by cheez on Saturday July 30, 2016 @10:38PM (#12195489)
CLJS is just a language.
Re:Angular 2 Fundamentals Course by yogthos on Friday August 05, 2016 @04:00PM (#12235347)
It's really much more than that. There's an ecosystem around ClojureScript that's completely separate from Js, and I find the CLJS ecosystem to be far better in many respects.
Re:Angular 2 Fundamentals Course by ng12 on Friday July 29, 2016 @03:08PM (#12189161)
You don't need all of that from scratch. You can just build React components, and when it comes time to add a store or a router the only thing you need to change are the glue components that bind things together. I think it works out nicely -- the dev process is as composable as the app itself.
Re:Angular 2 Fundamentals Course by nightski on Friday July 29, 2016 @03:30PM (#12189322)
Yea I've noticed that. The react community likes to focus on examples involving a sign up form with 3 fields where you "really don't need all of that". Except that is not what most of us SPA devs are building. We need most of that.
Re:Angular 2 Fundamentals Course by shados on Saturday July 30, 2016 @12:25AM (#12191637)
Either you need all of that, and the time to set it up is absolutely insignificant compared to the lifetime of the project.

Or you don't need all of that.

It's very, very rarely a different situation.

Re:Angular 2 Fundamentals Course by msane on Friday July 29, 2016 @04:10PM (#12189600)
Is that really an argument? that you don't need to write it at the beginning? you still have to do it...
Re:Angular 2 Fundamentals Course by ng12 on Friday July 29, 2016 @06:01PM (#12190365)
My argument is that it's a net benefit. Composable architectures are not boilerplate. Remember that there was a time when almost all React apps where written with Flux -- this model is what allowed Redux gain traction.
Re:Angular 2 Fundamentals Course by thereact on Friday July 29, 2016 @02:42PM (#12188953)
create-react-app is their official attempt at a happy medium that basically does bare minimum basic configuration to start building React apps with the latest tools: https://facebook.github.io/react/blog/2016/07/22/create-apps...

HN Discussion link: https://news.ycombinator.com/item?id=12144371

Re:Angular 2 Fundamentals Course by grkg8tr on Friday July 29, 2016 @03:39PM (#12189396)
Maybe something like http://aurelia.io ?
Re:Angular 2 Fundamentals Course by desireco42 on Friday July 29, 2016 @03:54PM (#12189482)
Wow, really nice!
Re:Angular 2 Fundamentals Course by hugozap on Friday July 29, 2016 @04:48PM (#12189865)
Here's how to have a great starting point in less than 10 seconds:

npm install -g create-react-app && create-react-app hello-world

Re:Angular 2 Fundamentals Course by ergo14 on Friday July 29, 2016 @03:15PM (#12189216)
A good way to start is to use polymer components :-)
Re:Angular 2 Fundamentals Course by rubber_duck on Friday July 29, 2016 @01:31PM (#12188383)
You don't need to use all of that just because it's there and having it there is more reliable than having to cobble together your own, at least in a corporate setting.

I actually find it surprising that this is a Google project, if you just gave me the code/docs and didn't tell me what project it is I would have guessed this came from Microsoft (feels much more WPF/Silverlight like than GWT/Closure, hell it even uses Rx which came out of MS)

Re:Angular 2 Fundamentals Course by epimetheus on Friday July 29, 2016 @02:02PM (#12188629)
Angular 2 uses Typscript which did come out of Microsoft.
Re:Angular 2 Fundamentals Course by gdi2290 on Friday July 29, 2016 @12:16PM (#12187850)
having the option to precompile your framework to 20kb file size which is smaller than some libraries feels like a great feature
Re:Angular 2 Fundamentals Course by Bahamut on Friday July 29, 2016 @01:06PM (#12188188)
Just a note, that 20kb also includes the dependencies, such as the reflect metadata polyfill, zone.js polyfill, and an ES6 shim such as core.js. Once static template compilation lands (think of it like the JSX compiler), it will get even smaller.

Angular 2 is shaping up to be a framework like no other out there in its capabilities.

Re:Angular 2 Fundamentals Course by _alexander_ on Friday July 29, 2016 @01:46PM (#12188490)
20kb? Really? On last week I built NG2 application(rc.4) with one component and size was over 500kb, with all dependencies which needed to run it. Maybe @angular/core weight 20kb, but in order to run real world application need add many dependencies. rxjs, zoom.js, shims, and so on..
Re:Angular 2 Fundamentals Course by lloyd-christmas on Saturday July 30, 2016 @12:54AM (#12191696)
We have 75-100 components along with all the angular pieces, polyfills, and ngrx/rxjs. It's 250kb with a minimal build process. I haven't even started digging into any optimization/build tools. I think you're doing something wrong.
Re:Angular 2 Fundamentals Course by Bahamut on Friday July 29, 2016 @01:48PM (#12188502)
It's possible using smart techniques (standard minification/gzipping, Google Closure/Rollup, etc.).
Re:Angular 2 Fundamentals Course by vladimir-y on Friday July 29, 2016 @01:55PM (#12188574)
I heard they are going to reduce final app size by doing smart analyzing of used features and getting not used stuff out of the final build. But I might be wrong.
Re:Angular 2 Fundamentals Course by vladimir-y on Friday July 29, 2016 @02:27PM (#12188849)
Even if you don't need it for a one app you might get a need for the another app and it's fine that all that stuff is coming as an entire framework from the one team, which means that all listed features will work smoothly being put in a single app. So no need to find and integrate scattered over the interned 3-rd party libraries. I agree that Angular is more for the large (you can say enterprise) projects.
Re:Angular 2 Fundamentals Course by pbreit on Friday July 29, 2016 @01:58PM (#12188591)
Can you suggest an alternative?
Re:Angular 2 Fundamentals Course by skolos on Friday July 29, 2016 @02:22PM (#12188800)
vue.js

https://vuejs.org/

Edit: I used NG1 a lot and liked it. But after trying NG2 I felt it to be really too complex for small to medium projects. Vue.js is what I hoped NG2 to become.

Re:Angular 2 Fundamentals Course by talmand on Friday July 29, 2016 @02:23PM (#12188807)
If an alternative is not named, does that change the value of the opinion in any way?
Re:Angular 2 Fundamentals Course by pbreit on Friday July 29, 2016 @02:59PM (#12189082)
I was just wondering what the author had in mind. But now that you ask, yes I think it does. Without a suggestion the opinion is pretty much worthless.
Re:Angular 2 Fundamentals Course by RussianCow on Friday July 29, 2016 @05:17PM (#12190086)
You really think we shouldn't criticize things if better alternatives don't currently exist? The fact that someone hasn't come up with a better approach doesn't imply that the status quo is the best possible solution.
Re:Angular 2 Fundamentals Course by ghurtado on Friday July 29, 2016 @03:40PM (#12189400)
Absolutely.

Here's an example: Human mortality sucks. However, since there is no alternative, complaining about it is an exercise in futility.

Re:Angular 2 Fundamentals Course by ergo14 on Friday July 29, 2016 @03:16PM (#12189224)
polymerjs is a great alternative.
Re:Angular 2 Fundamentals Course by komali2 on Friday July 29, 2016 @02:41PM (#12188936)
Javascript?
Re:Angular 2 Fundamentals Course by RobertKerans on Friday July 29, 2016 @07:52PM (#12190891)
ie for any mildly complex app, [re]implement a framework rather than using an existing framework that is battle-tested to a far higher degree than is possible if you roll it yourself?
Re:Angular 2 Fundamentals Course by ghurtado on Friday July 29, 2016 @03:47PM (#12189444)
So Angular is not made with Javascript then? Do you not write Javascript when you use it?

That's a bit like saying that the alternative to a roof is shingles.

Re:Angular 2 Fundamentals Course by msane on Friday July 29, 2016 @04:03PM (#12189545)
What exactly do you not need?

What does "single page app" mean to you? The term is not a description of the amount of features.