HNHacker News
TopNewBestAskShowJobs

DanRosenwasser

4,032 karma · joined January 16, 2015

Program Manager on the TypeScript team.

@drosenwasser on Twitter.

DanielRosenwasser on GitHub.

submissionscomments
DanRosenwasser··on The Great CoffeeScript to Typescript Migration of 2017
This gets brought up a lot - but I work on both TypeScript and within TC39. Adding a type system needs consensus from the committee, and ideally we would never leave the existing community behind (because that'd be a standardization failure) and at some point someone will need to implement the static type checking portion.

Who would do that apart from existing type-checkers? A team like TypeScript, that's who. :)

DanRosenwasser··on Porting a React Front End to TypeScript
In total there's roughly 20 people, more or less split between core compiler/language service and VS editing scenarios for JS & TS. We also work pretty closely with the VS Code team on their integration.

> Noticing the time when you posted your comment

Uh, I am just kind of a night owl. Most of our team members work out of Redmond, WA, and our distributed members are either on the East or West coast of the US.

DanRosenwasser··on Porting a React Front End to TypeScript
VS Code's JS support is actually still powered by TypeScript. I'm not 100% sure exactly what you were experiencing, but it's intentional that VS and VS Code automatically download types when powering JavaScript contexts because we try to make things "just work" for JS users.
DanRosenwasser··on Porting a React Front End to TypeScript
Hey all, I work on the TypeScript team. I've been super happy to read some of the posts about the migration on Execute Program. If anyone has any feedback or questions on TS, I can also try to answer them.
DanRosenwasser··on Porting a React Front End to TypeScript
Anything specific about ts-node that doesn't work or that stuck out as janky?
DanRosenwasser··on Vue 3 Beta
Any specific examples where you feel the surrounding tooling is falling short?
DanRosenwasser··on Vue 3 Beta
I think it's worth clarifying that Vue 3.0 won't require you to use TypeScript. I think the way to think about this is that tooling will ideally improve for a lot of JS devs regardless of whether they decide to use types or not.
DanRosenwasser··on Elm 0.19.1
> I make heavy use of types in TypeScript, but the error messages when something is out of order (ever so slightly) is just so brutal at times, with error messages being 20+ lines long, where only the last line might be relevant. I, for one, welcome our helpful error message overlords.

If you've got examples of cases where we can do better, feel free to file an issue! We want to do better.

DanRosenwasser··on TypeScript 3.5
Typically, TypeScript type-checks `lib.d.ts` every single compilation which can add at least half a second of build time. It will also do a full check of `.d.ts` files in your dependencies, which can also be pretty heavy.

We're considering ways we can avoid a full type check: https://github.com/microsoft/TypeScript/issues/31417

In the meantime, you can try out turning on the `skipLibCheck` compiler option to see if that helps at all, but be warned that it might not catch conflicts across multiple files.

DanRosenwasser··on Announcing TypeScript 3.2
Add a `tsconfig.json` and turn on `allowJs` for starters. If you're already using Babel, you can check out the Babel/TypeScript Starter for some guidance on quick and easy integration [1].

Then create a `types.ts` file for types that are used throughout your project, and as you see common data structures being used in your program, declare `interface`s and `type` aliases there. Then you can switch your `.js` files to `.ts`/`.tsx` files one-by-one and add types (or even add types via JSDoc and then convert those to `.ts` files when you're ready).

Eventually for the best experience, you can start switching on strictness modes. `strictNullChecks` is a pretty great one to use early on. Then `noImplicitAny` and `noImplicitThis` when you have pretty good type coverage. Finally you can turn on the full `strict` flag which will turn the others on, which are pretty easy to integrate into your codebase (and which you can turn off individually).

[1]: https://github.com/Microsoft/TypeScript-Babel-Starter

DanRosenwasser··on Announcing TypeScript 2.7
As a PM on the team, I actually _share_ your concern! ;)

In fact, we're very mindful about the cognitive overhead of new features, but we're also motivated by pragmatism. These features have been highly demanded to help them write real-world code. My coworker Ryan has written up a pretty good explanation of why we tackled the feature set that we did: https://news.ycombinator.com/item?id=16277367

Keep in mind that TypeScript strives to model JavaScript as it's written broadly. While we could always take the stance that you have to rethink the way you write JavaScript, that would be unnecessarily stubborn. Hope that gives some insight!

DanRosenwasser··on Convert React JavaScript Code to TypeScript with Proper Typing
Nerv is a React alternative that's been built with TypeScript. Check it out: https://github.com/NervJS/nerv
DanRosenwasser··on Announcing TypeScript 2.6
Luckily we try to have a regular release cadence (~2 months or so), and you can set your expectations with the Roadmap[1]. Hope you enjoy the release!

[1] https://github.com/Microsoft/TypeScript/wiki/Roadmap

DanRosenwasser··on Diminishing returns of static typing
Our team (TypeScript) powers this experience.
DanRosenwasser··on Decaffeinating a Large CoffeeScript Codebase Without Losing Sleep
We definitely want to implement it! But many parts of that specification are still in flux, so like you said, we'd like to see the proposal stabilize first to avoid problems.
DanRosenwasser··on Why We Chose Typescript
Or to go all-in - we have a `--strict` flag that gives you `noImplicitAny`, `strictNullChecks`, `noImplicitThis`, and a mode that always puts you in `"use strict"` mode.
DanRosenwasser··on TypeScript 2.3
Hi Alex (I have an email from you that I have to respond to)! TS guy here. We've had discussions around this and the reason we use our own AST format is for compilation speed and editing scenarios, both of which our team really focuses on.

I'll also note that incredible folks like James Henry have already written tools to convert TypeScript ASTs to the ESTree format[1]. I've heard it's been working well for using ESLint on TypeScript code.

[1]: https://github.com/eslint/typescript-eslint-parser

DanRosenwasser··on TypeScript 2.3
There's already a way to consume TypeScript through its API and inject a custom transform today, so a lot of the machinery is already in place.
DanRosenwasser··on Announcing TypeScript 2.2
TypeScript's full error message on that last one is actually

  Type 'Boolean' is not assignable to type 'boolean'.
    'boolean' is a primitive, but 'Boolean' is a wrapper object. Prefer using 'boolean' when possible.
DanRosenwasser··on Announcing TypeScript 2.2
Thanks for catching - I've updated the blog post. I tend to just use `strictNullChecks` by default, as it's typically the best option for any new code. :)
DanRosenwasser··on Announcing TypeScript 2.1
For the record, you're not forced into it at all. I'll mention that in the TypeScript compiler, we use very few classes at all - it's mostly written in a function-oriented style.

TypeScript tries not to impose any sort of restrictions on coding style.

DanRosenwasser··on Announcing TypeScript 2.1
TypeScript PM here - the reason for that is that when we implement a feature in TypeScript, we take lengths to ensure that it is typed appropriately and that its performance characteristics are reasonable.

That means that when using object rest/spread, we didn't want to just ship an experience where type type is effectively `any`, leading users to be frustrated if they make an error.

With async/await, we had to rewrite our emit pipeline, which meant that we needed to keep parity in both output as well as time to emit. The investment has shown, and TypeScript is still extremely fast.

We're always willing to think about different approaches, but those are some of the rationales here.

DanRosenwasser··on TypeScript 2.1 RC: Better Inference, Async Functions, and More
Hey, I'm the PM on the TypeScript team and I'm curious to hear about the issues you ran into. async/await already works in TS 2.0 when targeting ES6, so you should have had a good experience in that respect. Feel free to DM me on Twitter at @drosenwasser.
DanRosenwasser··on Static types in Python
Why exactly is TypeScript inconvenient on the server-side?
DanRosenwasser··on Announcing TypeScript 2.0
Hey, I don't see TypeScript as being behind on control flow analysis or anything like that.

If you're referring to differences in the way TypeScript narrow types based on control flow analysis, we don't see one as being "better" than the other, but TypeScript takes a more optimistic approach to avoid putting users in frustrating scenarios where the analysis is too limited. Most users tend to prefer this to the slightly more rigid approach used in Flow, so we felt we made an ideal choice there.

If you have any specific thoughts or ideas, feel free to leave us feedback on our issue tracker.

DanRosenwasser··on Announcing TypeScript 2.0
We've got some of the documentation out now. You can see more at https://www.typescriptlang.org/docs/handbook/declaration-fil.... When submitting PRs, new files will need to be written for the `types-2.0` branch on DefinitelyTyped.
DanRosenwasser··on Love for TypeScript
Yes, you can just target ES6/ES2015 in your emit and TypeScript will use generators to enable `async` & `await`. You can then use Babel as the next step. We have a tutorial on Gulp & TypeScript that hooks up Babel and Browserify: https://www.typescriptlang.org/docs/handbook/gulp.html
DanRosenwasser··on Announcing TypeScript 2.0 Beta
`.d.ts` packages should align on major.minor version numbers, so you'll be able to snap to a version and update appropriately.
DanRosenwasser··on The Future of TypeScript Declaration Files
Assuming it was published, `npm install @types/lodash@2.0.1`.
DanRosenwasser··on The Future of TypeScript Declaration Files
I agree, ADTs would be nice. In fact, we have a pull request out for it right now. [1] :)

[1]: https://github.com/Microsoft/TypeScript/pull/9163

← PreviousPage 2 of 3Next →