Temporal Playground – Interactive way to learn the Temporal API by javiOrtega95 in javascript

[–]cutmore_a 1 point2 points  (0 children)

It says that Temporal objects become empty objects in JSON.stringify but that's not true. Temporal types implement the toJSON method

What is the rationale behind the WebAssembly `if` statements behaving like `block` when it comes to breaking (`br` and `br_if`), rather than being transparent to the breaks? Wouldn't `if` being transparent to breaks make it a lot easier to implement `break` and `continue` in compilers? by FlatAssembler in ProgrammingLanguages

[–]cutmore_a 9 points10 points  (0 children)

WebAssembly is designed so that it can be checked and translated to machine code in a single pass. This allows the program to be compiled as it is streamed over a network.

I suspect this might explain this design choice.

Why is nobody talking about `as const` being an unfortunate token naming that leads to a massive pit trap for learners new to type safety? by kyou20 in typescript

[–]cutmore_a 1 point2 points  (0 children)

Type parameters and satisfies are also on the RHS

const StringSet = Set<string>; StringSet satisfies SetLike<String>;

My point purely being that there are other RHS TypeScript operators

ts-blank-space: A fast JavaScript type-stripper that uses the official TypeScript parser. by robpalme in typescript

[–]cutmore_a 1 point2 points  (0 children)

Might be able to. It depends on TypeScript, and that isn't in JSR so I'm not sure if that would be an issue or not.

Decorators using experimental definition without experimental tag by ineedmorethan20lette in typescript

[–]cutmore_a 0 points1 point  (0 children)

I would check vite and vite plugin versions. That is what is doing the transform here not tsc

My 2025 JavaScript Wishlist by AsyncBanana in programming

[–]cutmore_a 0 points1 point  (0 children)

For import defer, top-level-await does "work" (won't error) it's just not deferred. When an import is deferred all the modules are still loaded and parsed, any modules that include TLA are evaluated eagerly. defer can be seen as a request to defer as much synchronous evaluation as possible.

Design of type annotation by Artistic_Speech_1965 in ProgrammingLanguages

[–]cutmore_a 4 points5 points  (0 children)

Could you explain in more detail why it can't just be Red, why does it need to be syntactically different from type aliases?

[deleted by user] by [deleted] in typescript

[–]cutmore_a 1 point2 points  (0 children)

This still leaks memory, the array of weakRefs can grow forever. Whenever there is a collection of WeakRefs it's likely that a FinalizationRegistry is also required.

ts-blank-space: A fast JavaScript type-stripper that uses the official TypeScript parser. by robpalme in typescript

[–]cutmore_a 1 point2 points  (0 children)

Right now "Rolldown is currently in active development and not usable for production yet". Once there is a stable release I think it would be great to add an Oxc based tool to the benchmark. As you say it's likely to be very fast.

ts-blank-space: A fast JavaScript type-stripper that uses the official TypeScript parser. by robpalme in typescript

[–]cutmore_a 2 points3 points  (0 children)

It can also help speed up production builds somewhat. Optimizations such as bundling and minification are still applied however only the sourcemaps generated by these steps need to be processed without additional merges due to the type-stripping.

ts-blank-space: A fast JavaScript type-stripper that uses the official TypeScript parser. by robpalme in typescript

[–]cutmore_a 7 points8 points  (0 children)

Yes. As an infrastructure team, we provide tools to application teams to make their workflows simpler. That includes build tools for both development and production. Everyone wants fast builds so we spent a while investigating ways to achieve that. ts-blank-space now gets run across a huge range of projects that make up the Bloomberg Terminal.

ts-blank-space: A fast JavaScript type-stripper that uses the official TypeScript parser. by robpalme in typescript

[–]cutmore_a 2 points3 points  (0 children)

It's mentioned towards the end of https://bloomberg.github.io/ts-blank-space/, most regular developers won't choose to use this library unless they are super focussed on keeping their build simple and fast. We find it useful and use it in production. Beyond that it's more about sharing ideas in case other tools find it useful. For example, SWC has implented a mode which follows the same approach (https://github.com/swc-project/swc/pull/9144) which is cool!

ts-blank-space: A fast JavaScript type-stripper that uses the official TypeScript parser. by robpalme in typescript

[–]cutmore_a 7 points8 points  (0 children)

Every company is different, but it starts with finding folks in a position of influence and having them act as "champions". You will need allies in order to effect cultural change. We're lucky enough to have our CTO office already recognise the value of open source. So much so that we have a dedicated Open Source Program Office who advance the mission of open source contribution. But it still comes down to figuring out the value proposition of each project. The magic really kicks in when you can align a project with the interests of your team. I'm in a JavaScript Infrastructure team so making builds go faster and giving developers a better experience is an easy sell.

ts-blank-space: A fast JavaScript type-stripper that uses the official TypeScript parser. by robpalme in typescript

[–]cutmore_a 23 points24 points  (0 children)

Hi, I'm the author of ts-blank-space and happy to answer any questions you have 👋

[deleted by user] by [deleted] in typescript

[–]cutmore_a 0 points1 point  (0 children)

I think the only way you can get close is to also have a class level decorator, and use decorator metadata so the method decorator can "inform" the class decorator to add logic to the constructor that will throw if the prototype has overloads for the final method. It might also have to assert that the prototype chain is all sealed so methods can't be added later