タグ

ブックマーク / joyeecheung.github.io (3)

  • require(esm) in Node.js

    Recently I landed experimental support for require()-ing synchronous ES modules in Node.js, a feature that has been long overdue. In the pull request, I commented with my understanding about why it did not happen sooner before this pull request in 2024. This post expands on that comment a bit more. The opinions in this post are my own and reflect my perception of the ESM development in Node.js as

    yosuke_furukawa
    yosuke_furukawa 2024/03/19
    この話はむちゃくちゃ面白かった。俺達は長らくESMは非同期だからrequireでは解決できないと思い込みすぎてた。それが何故なのかが書いてある。ワーキンググループ内で全員がそう思い込むとその外側から介入ができない
  • Memory leak regression testing with V8/Node.js, part 1 - memory usage-based testing

    Memory leak regression testing with V8/Node.js, part 1 - memory usage-based testing Like many other relatively big piece of software, Node.js is no stranger to memory leaks, and with them, fixes and regression tests. Testing against memory leak regressions, however, can be particularly tricky in a runtime with a garbage-collected heap, and quite a few of these tests became source of flakes in the

    yosuke_furukawa
    yosuke_furukawa 2024/03/18
    へーおもろい。一旦ものすごく小さいサイズでmax-old-space-size設定しておいて、shadow realm 経由でその特定のコードだけ呼び出して、小さいサイズを超えたらクラッシュさせることで検知するのか。
  • How does Node.js load its built-in/native modules?

    This post stems from a recent Twitter conversation and a bug I was trying to fix. I’ve also seen some questions asked in the issue tracker about this from time to time. A lot of people are already aware that a substantial part of Node.js is implemented in JavaScript, and many naturally think that Node.js loads its builtins from separate JS files on disk when the process is launched (which is very

  • 1