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
If the module being require()'d contains top-level await, or the module graph it imports contains top-level await, ERR_REQUIRE_ASYNC_MODULE will be thrown. In this case, users should load the asynchronous module using import(). If --experimental-print-required-tla is enabled, instead of throwing ERR_REQUIRE_ASYNC_MODULE before evaluation, Node.js will evaluate the module, try to locate the top-lev
Highlights This release backports from v9.x to v8.x two new features and several bug fixes related to the flat config system to help plugins, integrations and users migrate to flat config ahead of the final v9.0.0 release. Support for eslint.config.mjs and eslint.config.cjs This release introduces support for eslint.config.mjs and eslint.config.cjs configuration files to v8.x in addition to eslint
#54546 explored one approach of enabling dual ESM/CJS emit for packages with tsc alone. The idea was that instead of determining the module format of .ts files by looking for package.json files in its ancestor directories, we would look for them starting at the directory where that file’s .js output would be emitted (a subdirectory of outDir). That way, two tsconfig files could point to two differ
Module Harmony とは 現在 TC39 で多くのモジュール機能を追加する提案が進行しています。かつてはそれぞれの提案が無秩序に進行していましたが、2023年5月に Module Harmony として整理されました。この記事ではそれら提案についてまとめようと思います。 モジュール提案仕様の依存関係 インポートフェーズ修飾子 モジュールの読み込みがフェーズに分けられ、それぞれに対して修飾子が提案されています。シンタックスとしては import の後ろに修飾子を付けます。 import <Modifier> <ImportBinding> from <ModuleSpecifier>; import.<Modifier>(<AssignmentExpression>); モジュールの各フェーズと修飾子の対応 アセット参照 URL やパス解決のみをするのがアセット参照です。Asset
Based on the discussion around the DefinitelyTyped monorepo use case, we've decided to add support for eslint.config.mjs and eslint.config.cjs by default. Background Originally, we had decided to only support automatically looking for eslint.config.js files for flat config. Contrary to what folks have been saying online, this decision with not about forcing people to use ESM. Because we were rebui
2023-11-14, Version 21.2.0 (Current), @targos Notable Changes [e25c65ee2f] - doc: add MrJithil to collaborators (Jithil P Ponnan) #50666 [f2366573f9] - doc: add Ethan-Arrowood as a collaborator (Ethan Arrowood) #50393 [eac9cc5fcb] - (SEMVER-MINOR) esm: add import.meta.dirname and import.meta.filename (James Sumners) #48740 [7e151114b1] - fs: add stacktrace to fs/promises (翠 / green) #49849 [6dbb28
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く