We just moved our app from Redux and ImmutableJS to mobx and it's been a treat: we now get full typing and it's much less verbose. We don't need to repeat the payload definition at every point, we have a store where we call a method and that's it. Highly recommend checking out mobx if you use TS.
If TypeScript is so great, how come all notable ReactJS projects use Babel?
91–100 of 247 posts
Re: If TypeScript is so great, how come all notable ReactJS projects use Babel?
#92If ___________ is so great, how come all notable ________ projects use __________?
Classic troll magnet :)
Re: If TypeScript is so great, how come all notable ReactJS projects use Babel?
#93Earlier quoted context omitted.
I can't find in the documentation, does the `pub build` tool do code splitting? I can't use a language without this.
Sorry for my ignorance, but does that amount to loading a library on demand? If so, yes, Dart can do this: import 'package:deferred/hello.dart' deferred as hello; // When you need the library, invoke loadLibrary() using the library’s identifier. greet() async { await hello.loadLibrary(); hello.printGreeting(); }
The only problem is that the main output js file is still 107kb, quite large.
Re: If TypeScript is so great, how come all notable ReactJS projects use Babel?
#94Go all in with purescript[0] :D
Simple, elegant, strong typed and compiles to JS.
Re: If TypeScript is so great, how come all notable ReactJS projects use Babel?
#95Why waste your time with half-baked type systems that try to achieve some compromise over JS idiosyncrasies. Go all in with purescript[0] :D Simple, elegant, strong typed and compiles to JS. [0]: http://www.purescript.org/
Re: If TypeScript is so great, how come all notable ReactJS projects use Babel?
#96I was always wondering why HN crowd is ok with TS and so prejudiced against Dart - Dart has NG2, await async in older browsers and good tooling (webstorm, vscode) and much saner package system. When doing lot of small web apps - it's easier to mantain.
TS seemed more willing to interoperate with the rest of the JS ecosystem - gradual typing, external .d.ts files for popular libraries, working with existing build tools and module systems. Whereas Dart felt like more of a gated community where you were expected to do things the Dart way and there wasn't much support for traditional JS.
> working with existing build tools and module systems
I'd say they replaced it with a better tool, pub.
The one good argument you have there is .d.ts files. Dart lacks them, but there are tools to generate js bindings from those same .d.ts files. https://github.com/jirkadanek/definitely_typed
I haven't used it though, so I can't say if it works as advertised.
Re: If TypeScript is so great, how come all notable ReactJS projects use Babel?
#97I was always wondering why HN crowd is ok with TS and so prejudiced against Dart - Dart has NG2, await async in older browsers and good tooling (webstorm, vscode) and much saner package system. When doing lot of small web apps - it's easier to mantain.
Re: If TypeScript is so great, how come all notable ReactJS projects use Babel?
#98I was always wondering why HN crowd is ok with TS and so prejudiced against Dart - Dart has NG2, await async in older browsers and good tooling (webstorm, vscode) and much saner package system. When doing lot of small web apps - it's easier to mantain.
Dart is a different language so it's a different path. It's no different than, say, using C# or Java or C or whatever language that can be transpiled to JavaScript.
Re: If TypeScript is so great, how come all notable ReactJS projects use Babel?
#99The main reason for using Babel was async/await. However, the lastest TypeScript verion (typescript@next) can compile async/await for older browsers, so there is no reason for me to use Babel anymore.
Re: If TypeScript is so great, how come all notable ReactJS projects use Babel?
#100Why waste your time with half-baked type systems that try to achieve some compromise over JS idiosyncrasies. Go all in with purescript[0] :D Simple, elegant, strong typed and compiles to JS. [0]: http://www.purescript.org/
Yeah, why waste your time learning a little bit of new syntax when you can learn a whole lot of new syntax /s
[0] https://github.com/purescript/purescript/wiki/Differences-fr...