tsc-esm-fix
proposal-type-annotations
tsc-esm-fix | proposal-type-annotations | |
---|---|---|
2 | 110 | |
75 | 4,294 | |
- | 0.4% | |
7.8 | 3.3 | |
24 days ago | 3 months ago | |
TypeScript | JavaScript | |
MIT License | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
tsc-esm-fix
-
TypeScript is now officially 10 years old
Probably because it compiles them to a pre-standard ES5-compatible implementation based on good ol' `Foo.prototype`. And since they've already handled them one way, they can't become spec-compliant without breaking backwards compatibility.
The other place where this shines through particularly egregiously is the support of ESM static import/export. Everybody's build tools been compiling that back down to CJS so hard that Node.js 16+ introduced intentional incompatibilities between CJS and ESM modes just to get people to finally switch to the standards-compliant module system. So you end up in a situation where the library is written in TypeScript with ESM syntax but the only available browser build is a CJS blob which completely defeats the main touted benefit of static imports/exports, namely dead code elimination...
So you decide what the hell, let's switch TSC to ESM and moduleResolution node16, and end up having to use something like https://github.com/antongolub/tsc-esm-fix because the only allowed fix for TSC doing the wrong thing is at the completely wrong level - https://www.typescriptlang.org/docs/handbook/esm-node.html - if you don't see what's wrong with that, you're one of today's lucky 10000...
- TS and ts-jest meet “type”: “module”
proposal-type-annotations
-
TypeScript enums: use cases and alternatives
After almost a decade of TypeScript my recommendation is to not use TypeScript enums.
Enums is going to make your TypeScript code not work in a future where TypeScript code can be run with Node.js or in browser when typings are added to JavaScript[1]
Enums results in runtime code and in most cases you really want type enums. Use `type State = "Active" | "Inactive"` and so on instead. And if you really want an closed-ended object use `const State = { Active: 1, Inactive: 0 } as const`
[1] https://github.com/tc39/proposal-type-annotations
-
PyScript: An open source platform for Python in the browser
Maybe as part of the Flutter/Dart sales story?
Here is the current status of the standard proposal.
https://tc39.es/proposal-type-annotations/
-
Node Will Finally suport Typescript???
So read the Github of TC39: https://github.com/tc39/proposal-type-annotations
-
Node.js adds experimental support for TypeScript
Yes. That is noted in the PR:
> There is a TC39 proposal for type annotations
Which links to https://github.com/tc39/proposal-type-annotations
It is a long ways off though.
-
5 years in, JavaScript Modules are still painful
IMO the game changer in your scenario is when type annotations are added as a standard JS feature:
https://github.com/tc39/proposal-type-annotations
At that point you'd be able to run your TS code directly without any transpiration necessary. I'd love to remove all the build process junk from my projects and have them run quicker.
-
Bun 1.1
That proposal is not fully compatible with Typescript: https://github.com/tc39/proposal-type-annotations?tab=readme...
-
Go 1.22 Release Notes
They held a meeting a few months ago so it's alive but probably still years away.
https://github.com/tc39/proposal-type-annotations/issues/184
-
[AskJS] Kicking a dead horse - TS vs JS
I particularly like this thread in the TC39 types proposal. TypeScript IS a development trojan horse and locks you into the Microsoft Way of being a JS developer.
- Strong static typing, a hill I'm willing to die on...
-
HTML First – Six principles for building simple, maintainable, web software
Edit: There is a proposal to extend JavaScript with type annotations, which would allow ("a reasonably large subset") of TypeScript to run directly in the browser. Yay!
https://github.com/tc39/proposal-type-annotations
What are some alternatives?
ts-jest - A Jest transformer with source map support that lets you use Jest to test projects written in TypeScript.
captureSystemAudio - Capture system audio ("What-U-Hear")
tsx - ⚡️ TypeScript Execute | The easiest way to run TypeScript in Node.js
d2-playground - An online runner to play, learn, and create with D2, the modern diagram scripting language that turns text to diagrams.
ts2esm - Transforms CommonJS projects into ESM.
astexplorer - A web tool to explore the ASTs generated by various parsers.
node-win32-api - win32 api
proposal-record-tuple - ECMAScript proposal for the Record and Tuple value types. | Stage 2: it will change!
react-pair - 🖇️ Util to help with the paired hook pattern
rescript - ReScript is a robustly typed language that compiles to efficient and human-readable JavaScript.
TypeScript - TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
proposal-regexp-v-flag - UTS18 set notation in regular expressions