ORM 便利ですよね。最近の JavaScript 界隈では Prisma の勢いが日々強まっているのではないでしょうか。 今回は既存のシステムのある機能を Drizzle ORM で書き直した時に遭遇した落とし穴について紹介します。 Drizzle ORM Drizzle ORM は外部の DB クライアントを呼び出すことで環境差異を吸収しています。 MySQL クライアントには node-mysql2 が推奨されており、Getting Started に沿って設定するだけで導入できました。 orm.drizzle.team 既存のシステムでは内部の ID として BIGINT 型を使用しています。 Drizzle ORM - MySQL column types もちろん Drizzle ORM でもサポートしているので、これをマッピングします。 IDたちは丸められた さて、Getti
April 3, 2025VoidZero and NuxtLabs join forces on Vite Devtools TL;DR: Through our partnership with NuxtLabs, Anthony Fu will work on creating Vite DevTools, a tool that will offer deeper and more insightful debugging and analysis for all projects and frameworks built on top of Vite. At VoidZero, we place a strong emphasis on developer experience. While Vite and Rolldown already deliver outstandin
Back at the start of 2024, Biome added an ambitious goal to its roadmap: integrate a subset of the TypeScript type system directly into Biome so that type-informed lint rules can work out of the box. In order to make this feasible, we first needed better infrastructure. The main blocker for this was multi-file analysis, which is coming with Biome 2.0. Today, we finally have the technical means to
近年では、作文した文章をいきなり人に見せず、まずチャットに見てもらって、つっこみどころがないことを確認してから公開する、という習慣ができている。 ブログを書くときには、ブログの編集画面で書いてから、ChatGPTにコピペしていたけど、その場で見てもらえたら早いと思い、以下のようなことをやってくれる拡張機能を作った。 ブログの編集画面で動いて、本文を監視する 本文に変化があれば、「日記を批評して:(以下本文)」というプロンプトでChat GPTのAPIに送る 得られた批評は、編集画面内に現れたイルカのセリフとして表示する Chrome拡張で作ったらいいかと思ったけど、この拡張時代の実装もAIにやってもらいたい、と考えると、1ファイルで完結したほうが楽だ、と思って、Tampermonkeyで動くuser.jsとして作った。 APIキーはGM_setValueして格納している。これは他のuser
Web Push notifications are a powerful and important part of the web platform. As someone’s very famous uncle once said, with great power comes great responsibility. When we added Web Push to WebKit we knew it was imperative to maintain people’s expectations of power efficiency and privacy. We took a deliberate approach to maintain those expectations when implementing Web Push for Safari on macOS,
Highlights TypeScript Syntax Support in Core Rules ESLint v9.23.0 introduces full TypeScript syntax support for three core rules. These rules are: class-methods-use-this default-param-last no-useless-constructor These rules can now be used to lint TypeScript files as well as regular JavaScript. To lint TypeScript code, be sure to use @typescript-eslint/parser, or another compatible parser. You can
After hard work from our team, Biome’s long-awaited 2.0 release is nearing completion. It will be packed with many large features, so we would like your help testing it with a public beta! If you would like to try it out, you can update Biome and migrate your configuration using the following commands: Terminal windownpm install --save-dev --save-exact @biomejs/biome@betanpx @biomejs/biome@beta mi
Browsers nowadays have built-in form validation (or “constraint validation”) features that are super helpful for highlighting when the entered data satisfies the necessary criteria. Some of us have relied on JavaScript-only solutions to handle client-side form validation in the past (/me slowly raises hand…), but as it turns out, most of these built-in features have been around for over a decade!
For more detailed instructions on how to use Oxlint and integrate it with your project or editor, check out the installation guide. Highlight of new features since general availability Significant performance improvements, up to twice as fast compared to the previous releaseIncludes over 500 rules built-in, with no extra installation requiredMany rules from the typescript, unicorn, react, react-p
ASTを眺めてるとよく目にするやつ。 ことの発端はすこし別の角度ではあるが、結局こういうのは根本から調べるに限るので・・・。 Literalノードのrawプロパティ 一番わかりやすいのは文字列リテラルに対応するノード。 BabelではStringLiteralだが、ESTree本家では、数値も真偽値もまとめてLiteralと名乗ってる。 で、このLiteralの定義はこうなってる。 interface Literal <: Expression { type: "Literal"; value: string | boolean | null | number | RegExp; } https://github.com/estree/estree/blob/master/es5.md#literal なんと、rawなんてない。 というわけで、ESTreeで決められてるわけではないらしい。
{ using log = createSampleLog<string>(5); log("a"); log("b"); // スコープを抜けるときに最大5件サンプリングされて表示される } using の使い所 やりたかったこと Cline が勝手にデバッグログを仕込みまくって膨大なログを食ってトークンを使いまくるので、そもそも出力するログに上限を設定したい。 ロガーは初期化したスコープに依存して、抜ける時に吐き出す。 前提知識: using と Symbol.dispose スコープから抜けるときの処理を書ける。 function useXXX() { return { [Symbol.dispose]() { console.log("xxx:disposed") } } } // スコープを作る { using xxx = useXXX(); // スコープから抜ける時に usi
When ESLint v9.0.0 was released in April 2024, we enabled the new configuration system by default. We knew that there would be a period of challenges as the ecosystem switched over. In the ensuing months, we reviewed feedback and released compatibility utilities and the configuration migrator to help ease some of the transitional pain. Slowly, we started to see people migrating to the new configur
私が開発している ts-type-expand という拡張機能では、以前は yarn workspace を使ったモノレポ構成を取っていましたが、今回 pnpm workspace に移行することにしました。 つまりどころが多かったので知見を共有します。 基本的な移行方法 ロックファイルを移行するには以下のコマンドを使います。 これで、yarn.lock の内容を pnpm-lock.yaml に変換できます。 あとは yarn の設定ファイルを削除 pnpm-workspace.yaml を作成し、ワークスペース指定を移す 等すればパッケージの依存管理については移行完了です。 pnpm は他のパッケージマネージャーよりモジュール参照が厳格なので問題が起きるケースもあると思いますが、本エントリの主題とはそれるため他の記事に譲ります。 制約: vsce コマンドでは pnpm がサポートされ
先日WebKitのReviewerになりました。担当はJavaScriptCoreです、WebCoreのことは何も知りません。 I'm officially a WebKit Reviewer! I would like to thank all the JSC Reviewers who reviewed my patches and @Constellation for nominating me. — sosuke (@__sosukesuzuki) February 22, 2025 Reviwerというのは、WebKit開発者の中でもっとも強い権限を持つ人たちです。人のパッチを正式にrejectしたりapproveしたりできます。 去年の8月にWebKit Committerになったときは、やるべきことを投げ出してWebKitに向き合っていた罪悪感があったため、ポジティブな気持ち
Over the past year (2024) there has been a strong movement to rewrite JavaScript tools in Rust to make them faster. Rust is well suited for this as it runs much closer to hardware and doesn't rely on garbage collection. This makes it an ideal candidate for computationally intensive tasks. Linting in its basic form is such a task, as it involves parsing and traversing lots of source code. But there
After taking three steps back about a year ago to rewrite the entire library from scratch, Valibot has come back stronger than ever. In the past 12 months, the project has grown from 300k monthly downloads on npm to now more than 4.5 million. Many of you have been waiting for our first stable release, and with this blog post I am happy to announce that we are very very close. With this announcemen
Promise と Thenable Promise が ECMAScript の言語仕様に追加されたのは ES2015 ですが, Promise ライクなオブジェクトはそれ以前からも広く使われてきました (jQuery の Deferred など). そういった Promise ライクなオブジェクトとの互換性のため, Promise の仕様は本物の Promise と Promise ライクなオブジェクトを混ぜて使えるようになっています. 具体的には, Promise ライクなオブジェクトは一般に Thenable という共通のインターフェースを持つことになっています. オブジェクトが Thenable であるために必要なのは「then() という名前のメソッドを持っている」という一点のみです. もし Promise を解決 (resolve) するときに使われた値が Thenable
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く