Better HN
topnewbestaskshowjobs
Log inSign up

robwormald

253 karma · joined May 30, 2014 (12y ago) · 96 submissions

Texas transplant, currently live and work in the Bay Area. Javascripter, hacker, and aspiring IoT tinkerer.
Submissions

comment 10y ago · link · parent

Angular core team member here, let me see if I can clarify some of our decisions here:

It's not a secret that we promote Typescript as the first choice for Angular2 - this is a conscious decision based on both technical reasoning as well as feedback from our developer community.

I can count on one hand the number of teams I've spoken to who really want to use ES6 - the vast majority are happy using Typescript.

Typescript also allows us to do the kind of static analysis we use to do ahead-of-time template compilation, something that is significantly more difficult with ES5/6 - we've discussed making this work in the future, but for now it's a lot of engineering investment for something there just isn't the demand for.

A couple of other things I want to mention - "enterprise" gets thrown around on HN sometimes as a bit of a dirty word. We don't see it like that at all - the vast majority of Angular 1 users are exactly enterprise, and we're solving for the problems that large teams like them run into.

Now we're released and stable, I think it's a reasonable ask to add some specific docs on ES6 usage (or at least where it differs from TS), I'll bring it up at the next docs meeting.

Anecdotally, my experience talking to outside teams tells me that TS is not the complexity problem people have - the vast majority of devs coming from ES5-land have trouble with ES modules and bundling, rather than the specifics of ES/TS itself - this is part of the reason we're working hard on the angular-CLI.

As far as Google/Angular's commitment to the outside world - we have a Developer Relations team (of which I'm at member) - our only job is making non-Google developers successful with Angular. Feel free to reach out to me (@robwormald) or @stephenfluin if you've got questions or concerns. We both come from "enterprise" webdev and a big part of our job is making sure outside developers are represented in eng-team decision making.

Also reach out if this is something you care about deeply and want to contribute to the documentation - we'd love your help and I'll put you in touch with the right people.

comment 10y ago · link · parent

we can do both. In JIT mode, we XHR for them and compile them on the fly. In AOT mode, we do that at build time and turn the templates into TS code, which we can then typecheck (thus giving you typechecking against templates) - the benefit of this is you don't have to ship the compiler code to the browser, don't pay the cost of runtime compilation, and the generated code is monomorphic and thus highly optimizable in browser VMs.

comment 10y ago · link · parent

Should be noted that UI-router supports ng2 as well (and React!)

comment 10y ago · link · parent

Because of projects like https://www.nativescript.org/nativescript-is-how-you-build-n...

We also have a (community) react-native bridge, and of course all the awesome html5 stuff from Ionic.

comment 10y ago · link · parent

We're all going to get a couple of nights sleep, but that project is in progress and should be out soon. We're making sure it shows off the best of ng2.

comment 10y ago · link · parent

This was great. I'm an Ask, and my girlfriend is a Guess, and darn it drives me crazy sometimes, but i've never been able to quite pinpoint what it was... this puts it into words nicely. Cheers!

comment 10y ago · link · parent

Typescript doesn't directly, but Angular2 does (or will, this is just coming online) - our offline compiler converts your html templates into TS, and then regular TS typechecking can take over.

See https://github.com/microsoft/typescript/issues/6508 (and the GIF!)

comment 10y ago · link · parent

Honestly? Yes. We support ES5 but strongly recommend using Typescript with Angular2. Do you use ES6? If so, you already know how to use Typescript.

comment 10y ago · link · parent

Posted today https://blogs.msdn.microsoft.com/typescript/2016/06/15/the-f...

comment 10y ago · link · parent

yep, this method works great for libraries authored in typescript (and/or those that take the time to provide external module-style typedef files), but the @typings would be for what tsd/typings does today (mostly ambient)

comment 10y ago · link · parent

see https://github.com/Microsoft/TypeScript/issues/8275

comment 10y ago · link · parent

The great irony of this (and fwiw, I completely agree, and I work on the angular core team...) is that by embracing platform features in ng2 we've opened up a mess of other issues to learn.

A good example of this is modules. Angular 1 had its own module syntax (partly because modules weren't really a thing when it started). You could write scripts, concat them together and go.

In angular2 we embraced ES6 modules, which means a developer has to deal with loading and bundling etc.

One nice side effect here though is we can leverage more tooling from the rest of the JS community (eg, the great work of webpack) rather than having angular-specific solutions.

comment 10y ago · link · parent

The two things coming in 2.0 that most excite me are

- moving types to npm (despite the great work of Blake on typings, managing type definitions is still out of band) - npm install @types/somelib will be great.

- AST transforms, which will open up some interesting options for bundling and optimizations, sort of like babel's plugin ecosystem.

comment 10y ago · link · parent

Your tsconfig file should have that option set (as well as emitDecoratorMetadata).

comment 10y ago · link · parent

As an aside, angular2 is just coming online and there's a big interest from our community on redux, so you might share into that community too. The fact radical is written in TS means it's a great fit :)

comment 10y ago · link · parent

I'd suggest using the --outDir option, so TS writes the .js files to a different directory which you can easily blow away.

comment 10y ago · link · parent

Angular 1.x has been around since 2009 - 7 years - that predates pretty much every framework in use today, before modules (commonJS, let alone ES6) were widely in use, etc. At some point, we had to make a decision to be forward looking towards the future of the language. Support for 1.x won't disappear for some time. Angular 1.5 had a number of big upgrades - a focus will be easing the transition to 2.x over time ( .component(), lifecycle hooks, etc...)

comment 10y ago · link · parent

WebStorm has been pretty amazing in keeping up with us, a fair number of our team use it. Even more exciting is upcoming tooling integrations we'll get from Typescript - there's a cool GIF in this issue tracking the work https://github.com/Microsoft/TypeScript/issues/6508

comment 10y ago · link · parent

The new npm packages have an ES6 directory included and use the jsnext:main pointer in their package.json files to allow rollup-plugin-node-resolve to pick up the ES6 distro as normal. I'll drop a note in that issue later this week after I've gotten some sleep!

comment 10y ago · link · parent

This really comes down to your team - try them out and see what feels good for you. React is a great library, and as an angular1 dev before joining the core team, I learned a TON from playing with React and especially Dan Abramov and Redux - most of the same patterns are immediately portable to angular2.

comment 10y ago · link · parent

This was the case in Angular 1 - in Angular2, not so much. The component-tree structure (much like React) allows far smarter optimization on change detection - both with immutable data structures and observables - entire subtrees of components can be removed from the change detection step until the state notifies it of a change.

Good reading material by a team member - http://victorsavkin.com/post/110170125256/change-detection-i... and http://victorsavkin.com/post/114168430846/two-phases-of-angu...

An early beta comparo - http://www.roblog.io/js-repaint-perfs/angular2/opt.html vs http://www.roblog.io/js-repaint-perfs/react/opt.html - should probably update these with the latest RC.

comment 10y ago · link · parent

i like Max Lynch's (of Ionic framework) take on this http://blog.ionic.io/angular-is-a-design-pattern/

comment 10y ago · link · parent

err... 2.0

comment 10y ago · link · parent

re 1.0, when it's done :D

comment 10y ago · link · parent

couple of reasons. one big one is flexibility. angular2 (er, @angular) runs on client, server, native (react native/nativescript) and we hope many other platforms in the future. this lets us packages for common dependencies for various platforms, as well as enabling us to not ship the template compiler for precompiled apps.

the other is providing a single entry point to each of those packages, which makes it easy to configure for rollup/webpack2 etc when you want to use the ES6 source over the CJS.

comment 10y ago · link · parent

Lots more work to do here, but we're pretty happy with how the core looks! For those worried about size (which has absolutely been a fair concern over the alpha/beta process) - here's a "hello world" built with Rollup and our offline template precompilation. Clocks in at 200kb min/47k gzipped, with a bit more room from optimization over the next couple of weeks... https://ng2-compiler-test2.firebaseapp.com/

comment 10y ago · link · parent

Angular core team member here, happy to answer questions

comment 10y ago · link · parent

Heh, not exactly. We have a finite amount of hours in the day, and maintaining a JSX implementation is something we just aren't really interested in. You're more than welcome to implement such a thing yourself though, and I'd be the first to retweet it if you did.

comment 10y ago · link · parent

That's how RxJS 5 is set up, fwiw.

comment 10y ago · link · parent

seriously, not offended :) you get used to it working on frameworks :D

The longest (heated) discussion ever covers a lot of the reasoning: https://github.com/angular/angular/issues/133

More in depth design stuff here: https://docs.google.com/document/d/1kpuR512G1b0D8egl9245OHaG...

Demo: ng2 + google-youtube polymer element : http://plnkr.co/edit/yh0ACeu6g5n8D7YuhJvg?p=preview

1234