Skip to content

Migrate to ESM#370

Merged
chvmvd merged 5 commits into
masterfrom
migrate-to-esm
Sep 25, 2023
Merged

Migrate to ESM#370
chvmvd merged 5 commits into
masterfrom
migrate-to-esm

Conversation

@chvmvd
Copy link
Copy Markdown
Contributor

@chvmvd chvmvd commented Sep 18, 2023

Node.jsをESMに完全に移行しました。演習問題集は、移行できていません。

  • 「モジュールとnpm」で、CJSではなくESMで教えるようにしましました。
  • 「トランスパイラとモジュールバンドラ」のESMの説明を「モジュールとnpm」に移行しました。ただし、次のところは移行せず削除しました。
    Screenshot 2023-09-18 at 19 23 40
  • すべてのコードをESMにしました。

@chvmvd chvmvd changed the base branch from master to change-section-order September 18, 2023 09:52
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Sep 18, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 59eaac6
Status: ✅  Deploy successful!
Preview URL: https://a9eb5f2d.utcode-learn.pages.dev
Branch Preview URL: https://migrate-to-esm.utcode-learn.pages.dev

View logs

Comment thread docs/3-web-servers/03-module/index.md Outdated

さきほどのように `export` 文と `import` 文を用いて他の<Term type="javascriptModule">モジュール</Term>とのやり取りを行う JavaScript 標準の<Term type="javascriptModule">モジュール</Term>システムを、[**ECMAScript モジュール**](https://developer.mozilla.org/ja/docs/Web/JavaScript/Guide/Modules)と呼ぶ場合があります。Node.jsでは、拡張子を `.mjs` にすることで、ECMAScript <Term type="javascriptModule">モジュール</Term>を用いてプログラムを記述できます。

逆に、`exports` オブジェクトや `require` 関数を使った<Term type="javascriptModule">モジュール</Term>システムを、[CommonJS モジュール](https://nodejs.org/api/modules.html)と呼ぶ場合があります。Node.js では、拡張子を `.js` にすることで、ECMAScript <Term type="javascriptModule">モジュール</Term>を用いてプログラムを記述できます。
Copy link
Copy Markdown
Contributor

@kazukinumazato kazukinumazato Sep 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

多分いきなり exportsrequire が出てくると混乱しそうなので、「ECMAScript モジュール以外のモジュールシステム としては、CommonJS モジュール があります。CommonJS モジュールでは、プログラム中で exports というオブジェクトが利用できます...」みたいな感じがいいと思う

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

たしかに:eyes:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

直した。

Base automatically changed from change-section-order to master September 18, 2023 13:10
@chvmvd chvmvd merged commit 4418e4f into master Sep 25, 2023
@chvmvd chvmvd deleted the migrate-to-esm branch September 25, 2023 07:19
@chvmvd
Copy link
Copy Markdown
Contributor Author

chvmvd commented Sep 25, 2023

GoGo!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants