r/typescript • • 11h ago

Announcing TypeScript 7.1 RC

https://devblogs.microsoft.com/typescript/announcing-typescript-7-1-rc/?r
172 Upvotes

27 comments sorted by

82

u/Dested 11h ago • Helpful

My agent is going to love this

4

u/maninas 8h ago

I thought the same after skimming it for 10 minutes. Funny.. I used to block out an hour or so each time a new TS RC post came out back in the day to study it all. Today as soon as I reached the grammar parts I was like "lol f that" 😅😢

3

u/fearthelettuce 3h ago

Their mobile layout needs help

2

u/denexapp 1h ago

I just want my nx typechecks and lints to be fast

-20

u/strettist 11h ago

I just wish we could use TypeScript 7.0. No yarn PnP support means we’re stuck on 6.

35

u/EarlMarshal 11h ago

But isn't that a yarn problem?

1

u/strettist 11h ago

To an extent, but the community has been trying to provide a solution to this problem for a while, but the TS maintainers haven’t been hospitable to the efforts.

9

u/EarlMarshal 9h ago

Why does the yarn project try to require changes in another project?

1

u/epukinsk 3h ago

I don’t know if I would say they’ve been inhospitable. They’ve provided feedback on the MRs, and a pretty transparent explanation for why they aren’t ready to do it:  https://github.com/microsoft/TypeScript/pull/63919#issuecomment-5898089808

I love Yarn PnP, but it isn’t a standard yet.

I can understand why the TypeScript folks would drag their feet on this.

It seems like the path forward is package maps, right? It feels like if someone can put together a clean PR for that, there’s a good chance the TS folks would help get it merged.

12

u/coolcosmos 10h ago

Yarn PnP is the worst thing in the JS ecosystem. It's juste the worst hack imaginable.

1

u/epukinsk 4h ago

CI jobs that run in seconds instead of minutes is kind of amazing.

The amount of totally inert bytes in a node_modules folder that have to be loaded and unloaded hundreds of times a day is kind of insane. PnP is the only tech I’m aware of that solves that. Deno too I guess?

21

u/jessepence 11h ago

Why in God's name are you still using Yarn!? How hard could it be to migrate off of it?

3

u/x0wl 11h ago

Because Yarn PnP (and its local cache capability in general) is great in a lot of scenarios, like hermetic builds. I don't like the constant reliance on NPM being up all the time. If you know of a solution where you can commit your package cache to git without any issues, please let me know, as I was unable to find one neither manually nor with AI help.

The best solution for me as of now is to use Yarn with committed cache and pnpm linker setting, and putting the install command in a git hook.

6

u/Baxxterhv 8h ago

pnpm + ci cache

1

u/x0wl 6h ago

Can you distribute this cache (for example, to people who cannot access npm)? The task here is that a collaborator stranded on an island with only a laptop with Linux, Node and your git repo should be able to build, run and develop your project.

I can quite easily do it with Yarn (even without pnp, it's more of a convenience feature).

1

u/Baxxterhv 6h ago

if you really need it, yes, you can totally do that with pnpm too with a couple extra steps, you just dont commit the raw store to git. you run pnpm fetch --store-dir=./.pnpm-store, tar that folder up and send it over as a release artifact or whatever. then on the offline machine they just extract it and run pnpm install --offline --store-dir=./.pnpm-store

it still has the exact same caveats as yarn though (matching os/cpu archs, postinstall scripts downloading binaries, matching pnpm versions etc) except your git history stays clean

that "stranded on an island" thing only works if your project is 100% pure js. in reality your island guy is gonna have a bad time, if you built that cache on mac or windows his linux machine wont have the right native binaries for esbuild, swc, sharp etc (unless you messed with supportedArchitectures beforehand)

plus anything with a postinstall script that pulls binaries from github or s3 like playwright, puppeteer or electron will just fail without internet. and if you have any native c++ addons node-gyp will try to fetch node headers on first run, not to mention needing python, make and g++ installed. also node doesnt even ship yarn anymore so unless you committed the yarn release binary too he cant even run it

honestly stuffing zip caches into git just bloats your repo over time, for actual air-gapped envs people ship pre-built docker images, use nix or run a local verdaccio mirror instead

1

u/x0wl 5h ago edited 5h ago

I get what you're saying (and I really like the docker container idea), but the thing about yarn in particular is that it can pre-pull the native zips for different OS and CPU combinations, obviously at the cost of adding size to your repo

BTW how do you use nix for airgapped?

1

u/epukinsk 4h ago

CI cache still takes like a minute to load, repeated over every single CI job. Hundreds of times a day, maybe thousands for a big team, copying the same 99% unused data onto the filesystem.

PnP is an order of magnitude faster.

2

u/strettist 11h ago

Because Yarn has certain features that don’t exist in things like pnpm, and those features are quite valuable, especially for very large codebases.

1

u/Zeragamba 4h ago edited 4h ago

We're using yarn in our projects as a standardized tool, and migrating off of it to pnpm hasn't been a priority. Also we have some legacy transitive dependencies that rely on node_modules and don't play nice with symlinks or hardlinks

Yarn 4+ still works great for our team

0

u/strettist 11h ago

Sheesh, why the downvotes? There are several open issues related to this as well as a community proposed solution that’s essentially been rejected. There are plenty of codebases that currently experience this as a blocker and plenty more that will once they try to make the jump.

7

u/g0liadkin 11h ago

Because it's not a typescript issue per se

3

u/strettist 11h ago

It’s kind of more complicated than it being just a Yarn problem though. The community has been trying to work with TS maintainers to find a solution for a long time, but there’s essentially been no real effort from the TS maintainer end to help find a path forward. It’s been a TS problem in that so far they’ve been inhospitable to any solution from the community.

3

u/x0wl 11h ago

The solution was rejected because it was not a very good solution. The proposed zipfs + source maps is a much better one.

1

u/Wonderful-Habit-139 10h ago

I assume you mean package maps?

2

u/x0wl 10h ago

Yes

2

u/epukinsk 4h ago

Keep fighting the good fight! Yarn is great and it’s totally reasonable to want TypeScript to work with it.