2ality – JavaScript and more
Tutorial: publishing ESM-based npm packages with TypeScript
Tutorial: publishing ESM-based npm packages with TypeScript
2Ality
Tutorial: publishing ESM-based npm packages with TypeScript
During the last two years, ESM support in TypeScript, Node.js and browsers has made a lot of progress. In this blog post, I explain my modern setup that is relatively simple – compared to what we had to do in the past:
👍1🤬1
螺莉莉数据中心
教育的下一步
教育的下一步
螺莉莉的数据中心
教育的下一步 | 螺莉莉的数据中心
随着 Deepseek R1 模型的出现,之前我对大语言模型的诸多论断全都被推翻了。比如先前我在「当患有 ADHD 的工程师坐上了名为人工智能的四驱赛博轮椅」这篇文章提到的开发范式,已经出现了大幅的松动。
原本我在向大语言模型提出开发需求时还需要剪裁自己手里的代码,把问题的核心全都一一挖出来陈列好,交给模型处理。可是现在只需要把所有跟业务逻辑有关的几页代码全都粘在一起,模型就能自己参考有关的实现,完成必要的开发工作。在使用 Rust 这类相对复杂的语言时,模型也能做到基本不出错,出错只需要简单修正一两次,就可以产出高度可用的成果。…
原本我在向大语言模型提出开发需求时还需要剪裁自己手里的代码,把问题的核心全都一一挖出来陈列好,交给模型处理。可是现在只需要把所有跟业务逻辑有关的几页代码全都粘在一起,模型就能自己参考有关的实现,完成必要的开发工作。在使用 Rust 这类相对复杂的语言时,模型也能做到基本不出错,出错只需要简单修正一两次,就可以产出高度可用的成果。…
👍2🤬1
2ality – JavaScript and more
TypeScript: extracting parts of composite types via <code>infer</code>
TypeScript: extracting parts of composite types via <code>infer</code>
2Ality
TypeScript: extracting parts of compound types via `infer`
In this blog post, we explore how we can extract parts of compound types via the infer keyword. It helps if you are loosely familiar with conditional types. You can check out chapter “Conditional types” in “Exploring TypeScript” to read up on them.
🤬1
TypeScript
Announcing TypeScript 5.8 RC
Announcing TypeScript 5.8 RC
Microsoft News
Announcing TypeScript 5.8 RC
Today we are excited to announce the Release Candidate (RC) of TypeScript 5.8! To get started using the Release Candidate, you can get it through npm with the following command: npm install -D typescript@rc Let’s take a look at what’s new in TypeScript 5.8!…
👍1🤬1
2ality – JavaScript and more
Mapped types in TypeScript
Mapped types in TypeScript
2Ality
Mapped types in TypeScript
A mapped type is a loop over keys that produces an object or tuple type and looks as follows: {[PropKey in PropKeyUnion]: PropValue} In this blog post, we examine how mapped types work and see examples of using them. Their most importing use cases are transforming…
👎1🤬1
2ality – JavaScript and more
Conditional types in TypeScript
Conditional types in TypeScript
2Ality
Conditional types in TypeScript
A conditional type in TypeScript is an if-then-else expression: Its result is either one of two branches – which one depends on a condition. That is especially useful in generic types. Conditional types are also an essential tool for working with union types…
👎1🤬1
2ality – JavaScript and more
Array type notation: <code>T[]</code> vs. <code>Array<T></code> in TypeScript
Array type notation: <code>T[]</code> vs. <code>Array<T></code> in TypeScript
2Ality
Array type notations: `T[]` vs. `Array<T>` in TypeScript
In this blog post, we explore two equivalent notations for Arrays in TypeScript: T[] and Array<T>. I prefer the latter and will explain why.
👎1🤬1
2ality – JavaScript and more
The bottom type <code>never</code> in TypeScript
The bottom type <code>never</code> in TypeScript
2Ality
The bottom type `never` in TypeScript
In this blog post, we look at the special TypeScript type never which, roughly, is the type of things that never happen. As we’ll see, it has a surprising number of applications.
👎1🤬1