← back to writingFootage of me brainstorming ways to optimize my program

We are happy to announce that Biome v2 is officially out! 🍾 Biome v2—codename: Biotype, the first JavaScript and TypeScript linter that provides type-aware linting rules that doesn’t rely on the TypeScript compiler! This means that you can lint your project without necessarily installing the typescript package. With this release, the Core Contributors of the project want to show to the whole comm
はじめに TypeScriptで開発していると、エラーハンドリングの難しさに直面することがあります。 定番のResult型やEither型などの素晴らしいアプローチもありますが、これらは導入コストが高く、チーム全体に浸透させるのが難しいこともあるでしょう。 本記事では、小さく始められてチームに浸透させやすい、Branded Typeを使って型安全なエラーハンドリングを実現する方法を紹介します。 自己紹介 カミナシ StatHackカンパニーの かわりくです! 普段は食品表示ラベルをAIで検査するプロダクトを開発しています! kaminashi.jp note.kaminashi.jp TypeScriptの例外処理の問題点 1. catchブロックのerrorはunknown型になる const invalidJson = '{"name": "John",}'; try { const
tskaigi で susisu さんの Generator で Promise ランタイムを作る発表をみて、昔作ったやつがもっとやれそうな気がしたので、やってみた話。 やりたいこと TS の言語システムが物足りなくて、ドメインを表現しきれない。とくに副作用を持つ関数に、なんとかして副作用の型を宣言したい。 過去に、 Async Generator でこれができるのを確認した。 function print(): void & Eff<Operation.Console> { console.log("hello"); } async function* main() { yield print(); } for await (const _eff of main()) { } // この型が最終的に発生した副作用の合計を表現する export type MainOps = GetEffe
To address ever increasing scaling demands, the TypeScript team has embarked on a port of the TypeScript compiler to native code. This port brings a 10x speed-up in compile time, project load, and other operations on most codebases! Our talk will cover the journey of how our team committed to a native port, why we chose Go, how the port will improve your workflow, and what the path to completion l
This past March we unveiled our efforts to port the TypeScript compiler and toolset to native code. This port has achieved a 10x speed-up on most projects – not just by using a natively-compiled language (Go), but also through using shared memory parallelism and concurrency where we can benefit. Since then, we have made several strides towards running on large complex real-world projects. Today, w
After a year of active development: Zod 4 is now stable! It's faster, slimmer, more tsc-efficient, and implements some long-requested features. Huge thanks to Clerk, who supported my work on Zod 4 through their extremely generous OSS Fellowship. They were an amazing partner throughout the (much longer than anticipated!) development process. Versioning To simplify the migration process both for use
気合の脱 create-react-app からの、AIによるフロントエンド改修の自動化 (株式会社イルシル様) 株式会社イルシル様の依頼で、フロントエンドの近代化とパフォーマンス分析を行った事例を紹介します。 「イルシル」は、生成AIでスライド資料作成を自動化し、誰でも簡単にスライドやパワポが作れるサービスで、スライドのデザインは1,000種類以上あり、入力したテキストからスライドを自動生成できるだけでなく、オリジナルで作成することも可能です。 いわゆる、複雑フロントエンドの事例です。ブラウザ上でAI経由でスライドを生成して、それをUIから編集でき、最終的には PDF や パワーポイントとしてエクスポートします。 LCP や CLS ではなく、 TBT やメモリリークの調査がメインになります。 長くなったので最初に要約します。以下の内容を含みます。 泥臭い CRA => Vite 移行
はじめに TypeScript の型は世界一自由度の高い設計になっていると思います。 その根拠として、型を関数型のように書けるというのが大きいと思います。 type Trim<S extends string> = S extends ` ${infer R}` | `${infer R} ` ? Trim<R> : S; 例えば、これは文字列の両端から空白を取り除く、str.trim() 相当のジェネリクスを含んだ型です。 (ジェネリクスは、型で用いられる引数のような存在だと思って貰えれば大丈夫です。) 実際に見てみましょう。 TypeScript Playground (この記事では、TypeScript v5.8 を使用します。) しっかり、str.trim() 相当の処理が型のみで推論できていることが分かります。 こんな事をここまで簡単に出来る言語は、TypeScript ぐらいで
tsconfig.json を使うと、型チェックを緩く/強くしたり、また出力する JS の形式を変えたりできる。しかしいくつかの事情から、正しく書くのが難しい。 オプションの数が非常に多い その数なんと 133 個 *1 オプションの意味や役割が理解しにくい 公式ドキュメントは丁寧にかかれているが... JavaScript や TypeScript の仕様、型の知識、歴史的経緯などを知らないと理解しづらい 推奨されるオプションが変わっていく 言語やエコシステムの進化/変化によって変わる 最近だと Node.js の TypeScript サポートで変わった 「オプションの細かい意味とかは一旦いいから、モダンで最小限の tsconfig.json がすぐに欲しい!!!」。そうした声に応えて、id:mizdra がオススメする「4 ステップでモダンな tsconfig.json を作る方法」
If you can write TypeScript, you can understand Japanese! Typed Japanese is a TypeScript type-level library that enables the expression of complete Japanese sentences through the type system. It creates a domain-specific language (DSL) based on Japanese grammar rules, allowing a subset of grammatically correct natural language to be written and verified using TypeScript's compiler. This project al
While we’re not yet feature-complete, these numbers are representative of the order of magnitude performance improvement you’ll see checking most codebases. We’re incredibly excited about the opportunities that this massive speed boost creates. Features that once seemed out of reach are now within grasp. This native port will be able to provide instant, comprehensive error listings across an entir
PikkuFunction API FrameworkTypeScript functions with minimal boilerplate. Support multiple transports and deploy to any javascript runtime, serverless or server.
Language choice is always a hot topic! We extensively evaluated many language options, both recently and in prior investigations. We also considered hybrid approaches where certain components could be written in a native language, while keeping core typechecking algorithms in JavaScript. We wrote multiple prototypes experimenting with different data representations in different languages, and did
はじめに TypeScript は静的型付け言語として、コードの品質を向上させ、多くのバグを未然に防ぐ強力な型システムを提供しています。しかし、その構造的型システム(structural typing)には限界があります。似た構造を持つ型が互いに互換性を持ってしまうことで、意図しない代入や関数呼び出しが可能になり、論理的なエラーを引き起こす可能性があるのです。 このような問題に対処するために「Branded Types(ブランド型)」という手法が使われます。これは、TypeScript の型システムを拡張して名前的型システム(nominal typing)の特性を模倣し、似た構造でも異なる役割を持つ型を区別できるようにする手法です。 本記事では、Branded Types の基本概念から実装方法、実践的な活用例まで、段階的に解説していきます。 構造的型システムとその課題 TypeScrip
そろそろTypeScriptの型をまじめに勉強しなきゃな...ということで、自分の勉強も兼ねて「一歩先の型活用」をまとめてみました。そのためユニオン[1]、インターセクション[2]、ユーティリティ型[3]といった基本的な部分は触れていません。 この投稿では: できる限りTypeScript特有の用語には脚注でハンドブックのリンクを示しています 実際のコードを示すことで「実際に動かして学べるように」しています 可能な限り極端な例を出して分かりやすくなるようにしています ここで示すコードが実務には適さない場合もあります 順序立ててなるべく分かりやすいように説明しています(自分も忘れてしまうので) この投稿を通じてワンランク上の型スキル獲得に結びつけば幸いです。 分岐の網羅性を保証する 値のパターンによって処理を分岐したいとき、そのパターンがユニオン(Union Types)[1:1]によって全
Today we’re excited to announce the release of TypeScript 5.8! If you’re not familiar with TypeScript, it’s a language that builds on top of JavaScript by adding syntax for types. Writing types in our code allows us to explain intent and have other tools check our code to catch mistakes like typos, issues with null and undefined, and more. Types also power TypeScript’s editor tooling like the auto
In this blog post, we explore how we can test that complicated TypeScript types work as expected. To do that, we need assertions at the type level and other tools. Asserting at the type level # Writing more complicated types is like programming at a different level: At the program level, we use JavaScript – e.g.: Values Functions with parameters At the type level, we use (non-JavaScript) TypeScri
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く