Cover photo care of flickr user souravsarkar2013
I wrote an introductory post on TypeScript last October.
...
For further actions, you may consider blocking this person and/or reporting abuse
I converted a project to typescript recently. It was my first experience transpiling with babel and updated to webpack 4 in the process. Types existed for the majority of external libraries and adjusting interfaces was smooth. Good experience overall. Not too many issues in the code, just a lot of .toString(). I like to think of it as eslint++, where .eslintrc is the equivalent of globals.d.ts.
One issue I had was that the migration guides I found were all out of date. Lots of webpack 1 examples, some unnecessary steps.
Visual studio tooling (roslyn) was questionable where webpack watch was much better.
I'm curious why you had to do a lot of
toString()
. Also, for the documentation, that sounds like since you went through it with webpack 4, maybe consider throwing up a PR for webpack 4 in the docs or create an issue so that others don't stumble. 😉In the jQuery type, they have .val() returning string | number | string[], and the code I was working with assumed it would always be a string. Impacted field validation code quite a bit.
Maybe I'll write an article on dev.to about the migration.
Do you know about the progress of TS-WASM compilation?
My experience with WASM is just some articles I've read and podcasts I've listened to. No experience myself with it, but I'm assuming you're referring to this project, github.com/AssemblyScript/assembly... ?
Yes, wow they have made some amazing progress since I last checked them out! I was also looking at Microsoft/TypeScript#9202 though it seems that they wouldn't re-visit the idea until WASM implements garbage collection
Have you done any work with WASM @nektro ?
I haven't made anything particularly useful, but conceptually I really love WASM and think it has a very bright potential. I don't think the tooling is quite there yet, but it's still a new tech and for being as new as it is, browser adoption is fantastic.
As someone very interested in programming language design, the recent #discuss topic Hating on languages you don't use piqued my interest. I have my opinions about some of the languages out there but I was glad to see in the comments one of my favorite observations about the various programming languages out there.
When performance is the same, the only thing worth arguing about in language design is the grammar. And while I personally love JavaScript many out there would love to see JS's monopoly on the Web come to an end. And they are totally valid in having that opinion. WASM to me, is the answer to that. A common compilation target that any new or old language could come in and target and experience the same performance that browsers have been working on for so long.
To wrap back, I really like a lot about TypeScript and would love a way for it to be interpreted in a more "native-like" way on the Web (instead of just back compilation)
Sounds like you should write a post about WASM ;)
Why the type definitions are on the right after a : instead of on the left where final, let, var are used? What was the reasoning behind that.
TypeScript is a superset of JavaScript, i.e. any valid plain JavaScript is also TypeScript and the types can be optional depending on how strict you make TypeScript in your project, so my guess would be that since they're optional, it's probably easier to parse the Abstract Syntax Tree (AST) when it's
var
/let
/const
variableName
:
SomeType
vs.var
/let
/const
SomeType
:
variableName
. I know that @nektro is big into programming language design and is a fan of TS as well, so she might have some more insight into this as well.Some feel it helps readability but Nick is right in that it also lies in that the type indicators for languages that put the type on the right are optional because the language has type inference.
You can read more about it here in a discussion I had a little while back
What ever happened to putting the object type on the left?
Meghan 🎩
Distributive conditional types that would be nice
a good decorator explanation and how typescript is a good enhancer of this would be nice