TypeScript 2.9 is now available
typescriptlang.org
typescriptlang.org
You basically can't implement iterators while using `strictNullChecks`, and it's been broken since at least October 2016 (!)
Every time I go to use TS for a personal project I check to see if this is fixed, and for almost two years the answer is no. I am dying here. Should I not be implementing iterators? Does no one use `strictNullChecks`?
Looks like whenever 3.0 is released.
We expect contributions from everyone thats the motive behind OpenSource And not just being transparent of code
I've always considered the reminder that open source loves contributions to be a gentle reminder that:
* Most FOSS isn't sponsored.
* Most FOSS developers/maintainers aren't treated with much courtesy when things go wrong. "you broke my build!" etc.
* Without FOSS, a vibrant, interesting world would not exist within our computers, and even though its easy to forget, that world requires a rather significant amount of work for it to turn.
Ofc not everyone is a compiler expert. But everybody can help, and certainly everybody can TRY to help. Framing an issue like this with "hey, I'm not a compiler expert but there's this bug and I would love for it to be fixed, I wouldn't even know where to start... It's an older bug, what's the plan?" is much more courteous of the maintainers than "this shit is broke why don't u fix it?!"
I'm exaggerating just to illustrate the spectrum. Better and worse examples can be found all across the fossverse. Hell in just the Linux kernel alone there's a whole village of different personalities.
My point to all this: it's a very common remark, goes back ages, and I think it's a fantastic denominator to remind people the logistics of foss and human beings.
Sorry to hijack your comment!
Also I already have a job, and TypeScript is a Microsoft product with many Microsoft engineers working on it every day. Let's not portray it as entirely the altruism of some saintly engineers donating their time. We're not talking about OpenBSD here.
If there is a bug or feature that really matters to you and that you feel is not being prioritized:
- Contribute a fix
- Convince someone to contribute a fix
- Complain enough that someone contributes a fix (which shouldn’t work but sadly often does)
Otherwise it will be fixed when it is fixed.
(I am biased because I work with the TS team. However this is just general open source stuff, I’m not speaking professionally)
Also I didn't realize lazy loading was a common need. Does that mean that awkward syntax is going to be everywhere? Surely there's a better way to get that, like with an import lazy keyword. Really anything would be better.
This is not a very common remark however.
Has anyone had a truly pleasant experience with Typescript in a medium to large project?
Tried twice to wrap my head around what you are even talking about.
TypeScript is totally wonderful. It's also optionally typed.
I use it on a non trivial project with multiple teams.
Was introduced to it last year and it's fantastic compared to plain js.
This was generated by one line of code, simply applying the hoist-non-react-statics library as recommended by the official React docs https://reactjs.org/docs/higher-order-components.html#static...
JavaScript in many cases can be too dynamic to be properly typed. I'd rather have it than not - it has saved my ass a good number of times - but let's not pretend TS/Flow is totally wonderful.
At some point I hope to sit down and start filing bugs/sending PRs to fix many of the React Typescript types I find, but in the meantime there are several React modules I've replaced the with just `declare module 'react-thing'` to jus any-type it and move on.
It's about the one thing I can really ding intellij for at the moment.
It's bringing OOP back from having almost been forgotten, and with it, a reminder of proper library design and data types.
On the other hand, when writing server code targeting Node, with lots of dependencies on micro-libs, I've definitely had the experience of struggling with outdated or incorrect type definitions.
However, nowadays TypeScript has much better interoperability with untyped JS code. You can generally import an untyped JS module with the minimum of ceremony and have it Just Work (the type will be "any", so you don't get intellisense).
I find the best approach is to import types for the big libs you are using, like Express, and leave the micro-libs untyped. That way you get the benefit of types on your own code and your interactions with the framework, but can still leverage other code when you need to without giving yourself a headache.
Using yarn.lock means it never breaks unless we specifically choose to upgrade though, so it's still worth the increased productivity and safeness from TypeScript, which is awesome as a language especially combined with VS Code.
DT packages almost need _two_ version numbers that npm checks for semver breaks, but how to make that work is an open question and an interesting edge case in package management.
(I got some hate for one of my refactors, that I needed to get my own code to type correctly, that touched quite a few DT packages in the "middle" of an upstream major version, so I know this pain quite directly from both sides.)
It's not perfect, but we have found the types to be very nice when working on a large code base with lots of people. Dev development cycle remains quite fast.
In the worst case scenario, revert to local (checked-in) type definitions and fix it.
It never was a problem for me after more than 5 big TS projects.
For good measure I recently wrote a blog post on writing your first TypeScript+React application: https://charmeleon.github.io/post/react-typescript-tic-tac-t...
I'm so grateful for TypeScript, it's the hero JavaScript desperately needed.
They have added a ton of language features and keep adding more with each release, lets hope it doesn't get bloated as scala.
For me it feels not as bloated as other languages which added features without thinking about how they fit to the existing ones. But I work a lot on Scala, so I'm probably biased since I know the language better than i.e. Typescript :)
While it can be very empowering to have a "sandbox" language, when it comes to shipping features and working in a team setting, it can require a lot of discipline to keep the codebase approachable for others. Languages like Go or even Python seem to help a lot in there by having strong conventions and an "obvious" way to do things.
type TemplateTypedSelect = new () => Select<Template>;
const TemplateTypedSelect = Select as TemplateTypedSelect;
return <TemplateTypedSelect {...props} />;
Our codebase was sprinkled with these, which was both silly and error-prone. This will be a huge quality-of-life improvement, and encourage people to create type-safe React components that ensure a match between their inputs and callbacks, rather than just having them put a union of all the types they can handle in both.a) The lack of a proper 'is' keyword. The current behaviour around this is mental.
b) The unneeded complexity that the recent releases have brought to the typing system.
const something: Animal = ...
if (isDuck(something)) {
someThing.quack(); // TS can OK this
}That post outlines a few use cases which are admittedly outside of everyday JS/TS usage but I can see them as quite powerful when, for example, building frameworks and libraries that expose an API. I'd offer real-world examples of my own but I'm still working it out for myself .)
A lot of this matters in "metaprogramming" like Readonly<T> and Partial<T> which use all of the existing keys in a type to produce a "new" result (none of the key can be set, and all of the keys are optional, respectively), and making sure it doesn't miss intentional keys like symbols and numbers.
Also it clearly states: "use --keyofStringsOnly compiler option to disable the new behavior"