並び順

ブックマーク数

期間指定

  • から
  • まで

41 - 80 件 / 119件

新着順 人気順

ESMの検索結果41 - 80 件 / 119件

  • Announcing TypeScript 5.0 Beta - TypeScript

    Today we’re excited to announce our beta release of TypeScript 5.0! This release brings many new features, while aiming to make TypeScript, smaller, simpler, and faster. We’ve implemented the new decorators standard, functionality to better support ESM projects in Node and bundlers, new ways for library authors to control generic inference, expanded our JSDoc functionality, simplified configuratio

      Announcing TypeScript 5.0 Beta - TypeScript
    • Hello, Modules!

      It has already been available for some time in modern browsers, but we can now finally use it in Node.js, thanks to Node.js 10 becoming obsolete. As I wrote about earlier this year, I have personally been waiting for this day for 10 years. Here’s a good overview of JavaScript Modules. What are the benefits of JavaScript Modules over CommonJS?Unified syntax. Helps with teaching.Browser compatibilit

        Hello, Modules!
      • ブラウザにおける ES Modules の利用とパフォーマンスについて - 30歳からのプログラミング

        現代の主要なブラウザでは、ES Modules(以下、ESM)を利用することができる。 つまり、import文やexport文を使った JavaScript ファイルを、トランスパイルすることなくそのまま使えるということである。 モジュールシステムをそのまま使えるので、複数のファイルをバンドルする必要もない。 この記事ではまず、ブラウザで ESM を使う方法について説明していく。 その後、処理の流れを詳しく確認していく。これを理解していないと、パフォーマンスが非常に悪いページになってしまう恐れがある。 動作確認は Google Chrome の84.0.4147.105で行っている。 ESM 利用の基本 まずは検証用にサーバを立てる。 以下のコードを Deno(バージョンは1.2.2)で実行する。 そうすると、http://localhost:8080/にアクセスしたときにindex.ht

          ブラウザにおける ES Modules の利用とパフォーマンスについて - 30歳からのプログラミング
        • Announcing TypeScript 4.5 Beta - TypeScript

          Today we are excited to announce the beta release of TypeScript 4.5! To get started using the beta, you can get it through NuGet, or use npm with the following command: You can also get editor support by Downloading for Visual Studio 2019/2017 Following directions for Visual Studio Code and Sublime Text 3. Some major highlights of TypeScript 4.5 are: ECMAScript Module Support in Node.js Supporting

            Announcing TypeScript 4.5 Beta - TypeScript
          • Node.jsのネイティブES Modulesサポートが抱える問題を解決するBabelプラグインを書いた

            babel-plugin-node-cjs-interop というパッケージを作ったのでその紹介です。 (GitHub) 何が問題か Node.jsのネイティブES ModulesサポートとBabelやTypeScriptのES Modulesサポートを併用したときに問題が起きます。 ESMとCJS JavaScriptには標準のモジュールシステム (ES Modules, ESM) がありますが、ESMの策定前に先だっていくつかのコミュニティー定義のモジュールシステムが存在していました。そのうちNode.jsを中心として使われていたのがCommonJS Modules (CJS) です。そのNode.js界隈でもESMへの移行が進んでいます。 移行にあたって問題になることのひとつが、ESMとCJSのエクスポートモデルの違いです。 ESMでは、モジュールは0個以上の名前つきエクスポートを定

              Node.jsのネイティブES Modulesサポートが抱える問題を解決するBabelプラグインを書いた
            • Publish, ship, and install modern JavaScript for faster applications  |  Articles  |  web.dev

              Publish, ship, and install modern JavaScript for faster applications Stay organized with collections Save and categorize content based on your preferences. Over 90% of browsers are capable of running modern JavaScript, but the prevalence of legacy JavaScript remains a large source of performance problems on the web today. Modern JavaScript Modern JavaScript is not characterized as code written in

              • ESM treeshake に対応したバンドルサイズを計算してくれる Shakerphobia を作った

                bundlephobia.com というサイトがあります。これは npm のモジュールを参照した際のバンドルサイズを算出してくれるサービスです。 便利なんですが、基本的に dist/.. 等の package.json の main で配られるものだけをターゲットにしているので、 ESM Treeshake で一部のモジュールだけ import {} from ... した際のバンドルサイズがわからない、という問題がありました。 なので、それに対応したものを自分で作りました。netlify にデプロイしてあります。 こんな感じです。 使い方 https://shakerphobia.netlify.app/?pkg=<>&imports=<a,b,c> どうやって動いてるか URL を踏むと、 cdn.skypack.dev (その実体は npm) からソースコードを落としてきて、 Web

                  ESM treeshake に対応したバンドルサイズを計算してくれる Shakerphobia を作った
                • eslint-cjs-to-esm: CJSをESMへとマイグレーションするツールを書いた

                  最近、色々なライブラリをCommonJS(CJS)からECMAScript Module(ESM)へとマイグレーションしています。 その際に、ESMでは__dirnameやrequireなどCommonJS特有の機能は使えなくなっています。 また、TypeScriptやBabelなど多くのツールはCJSではimport時に拡張子はなくても大丈夫ですが、ESMの場合はimport時に拡張子が必要になります。 import url from "node:url"; - import { mdEscape } from "./mdEscape"; + import { mdEscape } from "./mdEscape.js"; // ESMでは相対パスに拡張子は省略できない + const __filename = url.fileURLToPath(import.meta.url); /

                    eslint-cjs-to-esm: CJSをESMへとマイグレーションするツールを書いた
                  • GitHub - vercel/nft: Node.js dependency tracing utility

                    You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

                      GitHub - vercel/nft: Node.js dependency tracing utility
                    • GitHub - tsmodule/tsmodule: Create standardized TypeScript ESM packages for Node or browser.

                      A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

                        GitHub - tsmodule/tsmodule: Create standardized TypeScript ESM packages for Node or browser.
                      • Hybrid npm packages (ESM and CommonJS)

                        Warning: This blog post is outdated. It may contain incorrect information. Update 2019-11-22: ESM support in Node.js is not experimental, anymore. This post was updated to reflect that. Conditional exports are now explained. In this blog post, we look at npm packages that contain both ES modules and CommonJS modules. Required knowledge: How ES modules are supported natively on Node.js. You can rea

                        • Announcing TypeScript 4.5 RC - TypeScript

                          Today we’re excited to announce our Release Candidate (RC) of TypeScript 4.5! Between now and the stable release of TypeScript 4.5, we expect no further changes apart from critical bug fixes. To get started using the RC, you can get it through NuGet, or use npm with the following command: You can also get editor support by Downloading for Visual Studio 2019/2017 Trying Visual Studio Code Insiders 

                            Announcing TypeScript 4.5 RC - TypeScript
                          • Node.js と ECMAScript の Import Specifier は意味が違うらしい

                            Node.js の import specifier と ECMAScript の ImportSpecifier 先日 Firefox の JavaScript エンジンである SpiderMonkey の公式ブログに Import Maps についての記事が投稿された。 https://spidermonkey.dev/blog/2023/02/23/javascript-import-maps-part-1-introduction.html この記事は、そもそも ECMAScript Modules とは何かというところから入り、Node.js のモジュールシステムの歴史やブラウザの ECMAScript Modules との関係などを説明した後、本題である Import Maps について解説している。短い時間で読める面白い記事なので、まだ読んでいない人はぜひ読んでほしい。 この

                              Node.js と ECMAScript の Import Specifier は意味が違うらしい
                            • Deno + dntでCJS・ESMに対応したnpmパッケージを作ろう

                              3 行まとめ CJS、ESM に対応した npm パッケージが Deno + dntで簡単に作成できる Deno で開発できるので、Lint、Format、Test、TypeCheck が設定なしですぐに使える dntで作成した CJS、ESM のファイルに対して、それぞれ Node.js でもテストを実行してくれる Deno のモジュールを npm パッケージに変換するdnt Deno のdntモジュールを使うと、Deno で実装したモジュールを CommonJS(CJS) と ESM、TypeScript に対応した npm パッケージとして公開できます。 実際、今回 Deno とdntを試してみましたが、Deno には Linter、Formatter、Test などが組み込まれているので、すぐに npm パッケージの作成に取り掛かれるのが良かったです。また、CICD の自動化(Gi

                                Deno + dntでCJS・ESMに対応したnpmパッケージを作ろう
                              • GitHub - frehner/modern-guide-to-packaging-js-library: A guide to help ensure your JavaScript library is the most compatible, fast, and efficient library you can make.

                                You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

                                  GitHub - frehner/modern-guide-to-packaging-js-library: A guide to help ensure your JavaScript library is the most compatible, fast, and efficient library you can make.
                                • Using Native JavaScript Modules in Production Today — Philip Walton

                                  Two years ago I wrote about a technique—now commonly referred to as the module/nomodule pattern—that allows you to write ES2015+ JavaScript and then use bundlers and transpilers to generate two versions of your codebase, one with modern syntax (loaded via <script type="module">) and one with ES5 syntax (loaded via <script nomodule>). The technique allows you to ship significantly less code to modu

                                  • Top-level awaitとDual Package Hazard - 株式会社カブク

                                    Node.js Advent Calendar 2019の21日目の記事です。 2019/12/25追記 もともと「Top-level awaitによるESモジュールの非同期化とDual Package Hazard」というタイトルにしていましたが、表現に勇み足な部分があり、ご指摘をいただいたので、少し修正しました。 「TLAによってNode.jsのESMが非同期になった」という表現はおそらく正確ではありません。ESMに関する2017年のNode.jsのドキュメントでは、特に理由は触れずに「ESMのロードは非同期で、それはブラウザの挙動と合致する」と記述されています。ここでいう「ブラウザの挙動」とは、WHATWG Loaderで定められた仕様を指すと考えられます。ECMAScriptの仕様としては、少なくとも2019まではESMが非同期であるとの記述はなさそうなので、ブラウザの仕様に合わせ

                                      Top-level awaitとDual Package Hazard - 株式会社カブク
                                    • TypeScriptのESMでハマる - くらげになりたい。

                                      markdownからhtmlに変換したいなーと思い、 micromarkを使おうとしたら、 ES Modulesでかなりハマったので、その時の備忘録。 はじまり 今まで使っていたらちょっとしたツールのプロジェクトに、 micromarkをインストールしたら、こんなエラーが。。 $ npx ts-node sample.ts ./node_modules/ts-node/dist/index.js:842 return old(m, filename); ^ Error [ERR_REQUIRE_ESM]: require() of ES Module ./src/node_modules/micromark/index.js from ./src/sample.ts not supported. Instead change the require of index.js in src/s

                                        TypeScriptのESMでハマる - くらげになりたい。
                                      • 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

                                        • ESM移行は無理だけどおれもSindreのライブラリが使いたい!

                                          依存しているライブラリが ESM only になってしまうことがあると思います。 そんなとき、自分たちが CommonJS だと素直に使えなくて困りますよね。 そこで、なんとかしてCommonJS環境から ESM only のパッケージをrequireする方法をご紹介します。推奨はしません。

                                            ESM移行は無理だけどおれもSindreのライブラリが使いたい!
                                          • JSPM - jspm.dev Release

                                            Guy Bedford, June 19th 2020 The latest version of the jspm CDN, https://jspm.dev has been launched today as the new replacement for https://dev.jspm.io. jspm.dev allows directly importing any package from npm into the browser using only native ECMAScript module import semantics like import('https://jspm.dev/pkgname'). As of today, dev.jspm.io serves 6 million requests to over 150,000 users each mo

                                              JSPM - jspm.dev Release
                                            • Node.js — Node v12.22.0 (LTS)

                                              Notable changes The legacy HTTP parser is runtime deprecated The legacy HTTP parser, selected by the --http-parser=legacy command line option, is deprecated with the pending End-of-Life of Node.js 10.x (where it is the only HTTP parser implementation provided) at the end of April 2021. It will now warn on use but otherwise continue to function and may be removed in a future Node.js 12.x release. T

                                                Node.js — Node v12.22.0 (LTS)
                                              • modules/unflagging-announcement.md at main · nodejs/modules

                                                Announcing core Node.js support for ECMAScript modules Node.js 13.2.0 ships support for ECMAScript modules, known for their import and export statements. This support was previously behind the --experimental-modules flag, which is no longer required; however the implementation remains experimental and subject to change. Enabling Node.js will treat the following as ES modules when passed to node as

                                                  modules/unflagging-announcement.md at main · nodejs/modules
                                                • Ship ESM & CJS in one Package

                                                  [[toc]] ESM & CJS ESM - ECMAScript modules CJS - CommonJS In the past decade, due to the lack of a standard module system of JavaScript, CommonJS (a.k.a the require('xxx') and module.exports syntax) has been the way how Node.js and NPM packages work. Until 2015, when ECMAScript modules finally show up as the standard solution, the community start migrating to native ESM gradually. // CJS const cir

                                                    Ship ESM & CJS in one Package
                                                  • GitHub - egoist/tsup: The simplest and fastest way to bundle your TypeScript libraries.

                                                    You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

                                                      GitHub - egoist/tsup: The simplest and fastest way to bundle your TypeScript libraries.
                                                    • Node.js — Node v21.0.0 (Current)

                                                      2023-10-17, Version 21.0.0 (Current), @RafaelGSS and @targos We're excited to announce the release of Node.js 21! Highlights include updates of the V8 JavaScript engine to 11.8, stable fetch and WebStreams, a new experimental flag to change the interpretation of ambiguous code from CommonJS to ES modules (--experimental-default-type), many updates to our test runner, and more! Node.js 21 will repl

                                                        Node.js — Node v21.0.0 (Current)
                                                      • How Jotai Specifies Package Entry Points

                                                        Introduction If someone has already looked into package.json in the jotai library, they may find "exports" field. https://github.com/pmndrs/jotai/blob/v1.6.4/package.json#L18-L31 "exports": { "./package.json": "./package.json", ".": { "types": "./index.d.ts", "module": "./esm/index.js", "import": "./esm/index.mjs", "default": "./index.js" }, "./utils": { "types": "./utils.d.ts", "module": "./esm/u

                                                          How Jotai Specifies Package Entry Points
                                                        • バンドルサイズに優しい tree shakeable なライブラリを作成する

                                                          この記事では次のブログの内容を参考にしながら、バンドルサイズに優しい tree shakeable な JavaScript ライブラリの作成方法について紹介します。細かい内容が気になる方は、是非原文の方もご確認ください。 作成方法のまとめ 結論から知りたい人向けに、まずは作成方法のまとめから記述します。バンドルサイズに優しい tree shakeable な JavaScript ライブラリを作成するためには、次の点に気をつけると良いです。 ESM 形式でライブラリを配布し、package.json の module フィールドを指定する ライブラリで使用する npm パッケージも可能な限り tree shakeable なものを利用する 1つのファイルにバンドルせず、モジュールツリーの構造を保持したまま配布する package.json の sideEffects フィールドに fal

                                                            バンドルサイズに優しい tree shakeable なライブラリを作成する
                                                          • Blogged Answers: My Experience Modernizing Packages to ESM

                                                            Random musings on React, Redux, and more, by Redux maintainer Mark "acemarke" Erikson This is a post in the Blogged Answers series. Details on the painful experiences and hard-earned lessons I've learned migrating the Redux packages to ESM Table of Contents 🔗︎ Introduction Redux Packages Background Packages and Configurations Issue History Early Attempts Migrating to Vitest Initial Alpha Testing

                                                              Blogged Answers: My Experience Modernizing Packages to ESM
                                                            • Everything You Need to Know About JavaScript Import Maps

                                                              Import maps are a new way for web pages to control the behavior of JavaScript imports, potentially enabling you to ditch your build system. In this article, Ayooluwa Isaiah dives deep into the specification.

                                                                Everything You Need to Know About JavaScript Import Maps
                                                              • Node.js v22の主な変更点 - 別にしんどくないブログ

                                                                引用元: https://nodejs.org/en/about/branding 2024年4月24日にリリースされたNode.js v22の主な変更点を紹介します。 Node.js v22はLTS(長期サポート)のバージョンになります。10月の後半にLTSとしてサポートが始まります。 nodejs.org require()がESMをサポート V8 12.4 アップデートによる JavaScript の機能 Array.fromAsync() Set methods union() intersection() difference() symmetricDifference() isSubsetOf() isSupersetOf() isDisjointFrom() Iterator Helpers map() filter() reduce() --runオプションによるpacka

                                                                  Node.js v22の主な変更点 - 別にしんどくないブログ
                                                                • GitHub - billinghamj/fix-es-imports: Fixes your ES import paths - from Node-style to explicit filenames

                                                                  You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

                                                                    GitHub - billinghamj/fix-es-imports: Fixes your ES import paths - from Node-style to explicit filenames
                                                                  • find-node-modules-import: importsしてるパッケージ名やNode.jsのコアモジュールを検出するツール

                                                                    find-node-modules-import: importsしてるパッケージ名やNode.jsのコアモジュールを検出するツール find-node-modules-importという、ソースコードからimportsしてるパッケージ名を検索するシンプルなCLIを書きました。 azu/find-node-modules-import: Find specific node modules import statement in your source code 特徴 インポートしてるパッケージ名を全て検出できる インポートしてる特定のパッケージ名を検出できる node:fsやassertのようなNode.jsのコアモジュールを検出できる 📝 このツールは、ESMのimportのみに対応しています。 JavaScriptとTypeScriptどちらも対応しています。 使い方 Usage

                                                                      find-node-modules-import: importsしてるパッケージ名やNode.jsのコアモジュールを検出するツール
                                                                    • Core: Migrate from AMD to ES modules 🎉 by mgol · Pull Request #4541 · jquery/jquery

                                                                      Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community. Pick a username Email Address Password Sign up for GitHub By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails. Already on GitHub? Sign in to your account

                                                                        Core: Migrate from AMD to ES modules 🎉 by mgol · Pull Request #4541 · jquery/jquery
                                                                      • JavaScript Import maps, Part 1: Introduction

                                                                        We recently shipped import maps in Firefox 108 and this article is the first in a series that describes what they are and the problems they can solve. In this first article, we will go through the background and basics of import maps and follow up with a second article explaining more details of import maps. Background: JavaScript Modules If you don’t know JavaScript modules, you can read the MDN

                                                                          JavaScript Import maps, Part 1: Introduction
                                                                        • Next.js with ESM

                                                                          $ npx create-next-app ✔ What is your project named? … esm ✔ Would you like to use TypeScript with this project? … No / Yes ✔ Would you like to use ESLint with this project? … No / Yes cat package.json { "name": "esm", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev", "build": "next build", "start": "next start", "lint": "next lint" }, "dependencies": { "@types/node": "18.11.11",

                                                                            Next.js with ESM
                                                                          • Node.js — Node v13.7.0 (Current)

                                                                            Notable Changes deps: upgrade to libuv 1.34.1 (cjihrig) #31332 upgrade npm to 6.13.6 (Ruy Adorno) #31304 module add API for interacting with source maps (bcoe) #31132 loader getSource, getFormat, transform hooks (Geoffrey Booth) #30986 logical conditional exports ordering (Guy Bedford) #31008 unflag conditional exports (Guy Bedford) #31001 process: allow monitoring uncaughtException (Gerhard Stoeb

                                                                              Node.js — Node v13.7.0 (Current)
                                                                            • Using Node.js ES modules and top-level await in AWS Lambda | Amazon Web Services

                                                                              AWS Compute Blog Using Node.js ES modules and top-level await in AWS Lambda This post is written by Dan Fox, Principal Specialist Solutions Architect, Serverless. AWS Lambda now enables the use of ECMAScript (ES) modules in Node.js 14 runtimes. This feature allows Lambda customers to use dependency libraries that are configured as ES modules, or to designate their own function code as an ES module

                                                                                Using Node.js ES modules and top-level await in AWS Lambda | Amazon Web Services
                                                                              • GitHub - getify/moduloze: Convert CommonJS (CJS) modules to UMD and ESM formats

                                                                                Moduloze enables authoring JS modules in the CommonJS (CJS) format that's native to the Node.js ecosystem, and converting those modules to Universal Module Definition (UMD) and ES Modules (ESM) formats. UMD is particularly useful in browsers where ESM is not already being used in the application. CJS continues to work fully in all versions of Node, but in the latest Node versions, the ESM format f

                                                                                  GitHub - getify/moduloze: Convert CommonJS (CJS) modules to UMD and ESM formats
                                                                                • Node.js — Node v14.13.0 (Current)

                                                                                  Notable Changes [19b95a7fa9] - (SEMVER-MINOR) deps: upgrade to libuv 1.40.0 (Colin Ihrig) #35333 [f551f52f83] - (SEMVER-MINOR) module: named exports for CJS via static analysis (Guy Bedford) #35249 [505731871e] - (SEMVER-MINOR) module: exports pattern support (Guy Bedford) #34718 [0d8eaa3942] - (SEMVER-MINOR) src: allow N-API addon in AddLinkedBinding() (Anna Henningsen) #35301 Commits [19b95a7fa9

                                                                                    Node.js — Node v14.13.0 (Current)