Readit News logoReadit News
jakebailey commented on A 10x Faster TypeScript   devblogs.microsoft.com/ty... · Posted by u/DanRosenwasser
haxiomic · 6 months ago
Sounds like they're automatically generating Go code from ts in some amount [0]. I wonder if they will open the transpilation effort, in this way you'd create a path for other TypeScript projects to generate fast native binaries

Opened discussion [1]

- [0] https://github.com/microsoft/typescript-go/discussions/410

- [1] https://github.com/microsoft/typescript-go/discussions/467

jakebailey · 6 months ago
The automatic generation was mainly a step to help with manual porting, since it requires so much vetting and updating for differences in data layout; effectively all of the checker code Anders ported himself!
jakebailey commented on A 10x Faster TypeScript   devblogs.microsoft.com/ty... · Posted by u/DanRosenwasser
alberth · 6 months ago
Dumb question: is this a 10x speed up in the run-time of TypeScript ... or just the build tooling?

And if it's run-time, can we expect browsers to replace V8 with this Go library?

(I realize this is a noob/naive question - apologies)

jakebailey · 6 months ago
This is specifically about the performance of the TypeScript toolchain (compiler, editor experience); the runtime code generated is the same. TypeScript is just JS with types.
jakebailey commented on How Does Bluesky Work?   steveklabnik.com/writing/... · Posted by u/steveklabnik
Diti · 2 years ago
Until trademark laws come into play, and you find yourself obligated by law to give up your domain username to a big corporation. (A famous example in France is “Milka vs. Kraft Foods”, the court favored the big corporation’s registered trademark over Mrs Milka’s name.)

Granted, my comment doesn’t add much to the discussion, since this domain ownership issue would have been a problem in ActivityPub too.

jakebailey · 2 years ago
> Until trademark laws come into play, and you find yourself obligated by law to give up your domain username to a big corporation.

This wouldn't be a big deal in practice (besides losing the domain). Domain usernames are just the combo of you telling Bluesky "I intend to use this domain name" and then you placing a TXT record on the domain to prove you own it. If you want to change domains (or, are forced to), you just give them the new domain name and you set another TXT record (just like if you had set up a domain name as a username for the first time). The underlying DID is still yours.

jakebailey commented on A Node, TypeScript, TS-Node and ESM experience that works   gist.github.com/khalidx/1... · Posted by u/khalidx
btown · 2 years ago
https://documentation.divio.com/ is a good overview of the "four types of documentation" paradigm: tutorials, how-to guides, explanations, and reference have to all exist.

One of my major gripes with the JS/TS ecosystem is that "explanations" are sorely lacking. See https://www.typescriptlang.org/tsconfig for the relevant documentation for tsconfig files. Tutorials are on the page, how-to guides abound on the wider internet (like the OP), and the linked TSConfig Reference and JSON Schema (used in code completion in IDEs) are together absolutely massive.

But an explanation is missing! There is no official documentation about how different options interact to say: as I'm walking a file tree as the Typescript compiler, this is how I will interpret a certain file I encounter, what will be outputted, and how that will be interpreted by bundlers and browsers, especially in an ESM world.

https://medium.com/extra-credit-by-guild/tsconfig-json-demys... is in the right direction, but outdated as ESM has become much more popular in the past 3 years, and still organized by option (so it's already somewhat in the "reference" world).

IMO even independent of documentation, the industry's move to ESM is problematic: https://gist.github.com/joepie91/bca2fda868c1e8b2c2caf76af7d... describes many of the issues. But they're certainly exacerbated by good explanation-style documentation that helps people understand how ESM works under the hood!

jakebailey · 2 years ago
> One of my major gripes with the JS/TS ecosystem is that "explanations" are sorely lacking. See https://www.typescriptlang.org/tsconfig for the relevant documentation for tsconfig files. Tutorials are on the page, how-to guides abound on the wider internet (like the OP), and the linked TSConfig Reference and JSON Schema (used in code completion in IDEs) are together absolutely massive.

> But an explanation is missing! There is no official documentation about how different options interact to say: as I'm walking a file tree as the Typescript compiler, this is how I will interpret a certain file I encounter, what will be outputted, and how that will be interpreted by bundlers and browsers, especially in an ESM world.

Perhaps you missed it, but Andrew (from the TS team) recently finished a massive overhaul of our module docs: https://www.typescriptlang.org/docs/handbook/modules/introdu...

The "theory" page describes TypeScript's perspective on modules. The "reference" page documents things from the "as I'm walking a file tree" perspective (among many other details). The "guides" page also provides recommendations for certain kinds of projects.

jakebailey commented on TypeScript 5.0   devblogs.microsoft.com/ty... · Posted by u/dimitropoulos
brundolf · 2 years ago
From the PR (https://github.com/microsoft/TypeScript/pull/51669):

> New compiler options

> - allowImportingTsExtensions: Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set.

To be clear, I'm not using tsc to build code for Deno. I've got module X which imports module Y, neither of which have any platform-specific dependencies. Right now if module X imports Y with the .ts extension, Deno can import X but tsc can't. If module X imports Y without the .ts extension, tsc can import X but Deno can't. With this compiler option, I should be able to include the .ts extension and allow both to (independently) import the same code

jakebailey · 2 years ago
Ah, sorry; I brainfarted and missed the ".ts" part. I was thinking of the ".js" extensions, which are required in newer resolution modes (but are supported in older ones, and therefore using the strictest mode produces the most compatible code).
jakebailey commented on TypeScript 5.0   devblogs.microsoft.com/ty... · Posted by u/dimitropoulos
zdragnar · 2 years ago
I think "major" was used in the semver sense, which is not how the TS team chooses version numbers.
jakebailey · 2 years ago
Sure, we don't bump according to semver, but it's hard to say that 5.0 _isn't_ a major release given how we used it as a way to get a bunch of breaking changes and cleanups in. It's a very opportune time as people will be forced to manually upgrade and acknowledge that something is changing.
jakebailey commented on TypeScript 5.0   devblogs.microsoft.com/ty... · Posted by u/dimitropoulos
brundolf · 2 years ago
It's easy to miss, but I'm most excited for "--moduleResolution bundler" (https://devblogs.microsoft.com/typescript/announcing-typescr...)

My understanding is it should allow you to finally have TypeScript files that import other TypeScript files and include the file extension. This is important because, for one, it means Deno TypeScript modules and non-Deno TypeScript modules are now compatible (can import each other)! As long as no unavailable system APIs are used, of course

This has been a problem in a project I've been working on where a Deno back-end service wants to share some code with a Next.js front-end service. Currently, the shared modules are not able to import anything else, because Deno requires file extensions in import paths and non-Deno TS requires no file extensions in import paths

jakebailey · 2 years ago
"bundler" is definitely not going to be the right resolution mode for using Deno; you may be better served by using ESNext or Node16/NodeNext (the "strictest" mode, really). The "who should use this mode" section here I believe is still accurate: https://github.com/microsoft/TypeScript/pull/51669
jakebailey commented on TypeScript 5.0   devblogs.microsoft.com/ty... · Posted by u/dimitropoulos
dcre · 2 years ago
It's not a major release.
jakebailey · 2 years ago
There's a full page of API breaks: https://github.com/microsoft/TypeScript/wiki/API-Breaking-Ch...

Then, a new error about the deprecations of ancient options to be removed in 5.5: https://github.com/microsoft/TypeScript/issues/51909

jakebailey commented on PR that converts the TypeScript repo from namespaces to modules   github.com/microsoft/Type... · Posted by u/Kyza
idontwantthis · 3 years ago
Thanks for the reply!

So when your team is compiling locally they don’t type check? It only runs in the IDE and during tests?

jakebailey · 3 years ago
It's not perfectly cut and dry, but mostly. We still need to emit d.ts files for our public API, and the only thing that can do that is tsc, which will type check.

But I tried my best to make the build have fast paths to minimize the development loop as much as possible.

jakebailey commented on PR that converts the TypeScript repo from namespaces to modules   github.com/microsoft/Type... · Posted by u/Kyza
idontwantthis · 3 years ago
Does that mean they are not using type checking? That’s the really really slow part of writing TS and es build doesn’t include it, which is why I’ve never seen the point of using esbuild as a compiler.
jakebailey · 3 years ago
We are still type checking, it's just not needed as a dependency for our JS outputs. Type checking still happens in tests, and I have CI tasks and VS Code watch tasks which will make sure we are still type checking.

u/jakebailey

KarmaCake day110November 2, 2022
About
[ my public key: https://keybase.io/jakebailey; my proof: https://keybase.io/jakebailey/sigs/CF2PFxpUflWXTNBGfraOsTOTbcP2iI8duvVRGmBoPNg ]
View Original