-
-
Notifications
You must be signed in to change notification settings - Fork 227
feat(usecase): モジュール #505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
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
feat(usecase): モジュール #505
Conversation
Deploy preview for js-primer ready! Built with commit 3177013 |
わかっていたけど、どこまで書いてどこまで書かないのかの判断が難しい… |
|
ちがうかなーまずずっとESModuleの構文について触れて、最後に実行環境とモジュールシステムについて話す感じかな。commonjsの構文はnodecliのほうに任せて、Node.jsにはcommonjsがあって、ESModuleまだ実装されてないよ、っていう話と、バンドラによってモジュールシステムが変わるから気をつけなきゃダメだよっていう話か |
歴史的経緯:
現実的な理由:
@teppeis 本(Web+DB vol87)では
http://exploringjs.com/es6/ch_modules.html も比較的似た流れ。 はじめてのJavaScriptは時期的に入ってない感じ?(node_moduleだけ?) |
(実装はされてフラグで使えるけど、)まだまだStableじゃないよ(安定ってより一般的じゃないよというニューアンス) だからここでは書かないよ的なことがわかればいい気はする。 |
@azu とりあえずざっと書けたんですが、lint回りでけっこう苦しいことになっているので助けてもらいたいです... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
今日明日ぐらいで見ます。
source/use-case/module/README.md
Outdated
|
||
まずは`export`文について見ていきましょう。 | ||
|
||
### export文` {#export-syntax} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
` がなぞに残ってる
importがNode VMがパースできずにだめになるパターンか。 |
あと、コードを分けて解決しているけど、同じコード例中で2回defaultエクスポートできないのがけっこう面倒ですね |
es moudleのテストってちゃんとimport/exportできてるかぐらいがわかればいい気がする。
の2系統があればよさそう。
ができれば後からなんとかなりそう。 後でmodule用のテストの仕組みを追加する感じになりそう |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#505 (comment)
にも書いたけど、テストの仕組みは追加するしかなさそう。
とりあえず、必要な部分は全部ファイルになってればコードを[import]
すれば、パースエラーとかにはならないのでCIは通せるかな
source/use-case/module/README.md
Outdated
# モジュール {#module} | ||
|
||
この章では **ECMAScriptモジュール(ESモジュール、JSモジュールとも呼ばれる)** について見ていきます。 | ||
ECMAScriptモジュールは、JavaScriptファイルをモジュールとして扱うための機能です。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
モジュールとは何かというのを簡単に説明した方がよさそう。
(モジュールという概念自体が曖昧なままだとよくわからない話に見えそう)
JavaScriptでのモジュールは、機能をエクスポートしたJavaScriptのファイル、モジュールから機能をインポートしたファイルどちらもモジュールと読んでる。
たとえば、あるxxxという関数を書いて、それを別のところでも使いたいとなったときに、コピペで持ってくるより、モジュールとして再利用できるのでメンテンス性がいいよとかそういうイメージできる何かが最初にあるとよさそう。
- [意訳]初学者のためのJavaScriptモジュール講座 Part1 - Qiita
- JavaScript Modules: A Beginner’s Guide – freeCodeCamp
- Modules :: Eloquent JavaScript
なんかキーワードは思いつくけど文章として難しいな
- 再利用性
- 名前空間: モジュール内はスコープが別れてるから、モジュール直下にコードを書いてもグローバルにはならない
- 1ファイル = 1モジュール?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
疎結合化とテスト可能性とか
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
コピペするとバージョン管理が大変という話も動機として上げていいのでは
source/use-case/module/README.md
Outdated
|
||
## ESモジュール {#es-modules} | ||
|
||
ESモジュールは、ECMAScriptの`import`、`export`構文を使って記述されるモジュールの形式です。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ECMAScriptの
import
、export
構文を使って記述されるモジュールの形式です。
import
, export
がなくてもモジュールなので、ここは何か冗長な感じがする。
ESモジュールは、[export文][]によって変数や関数などのシンボルできます。
また、[import文][]を使って別のモジュールからインポートできます。
とか
source/use-case/module/README.md
Outdated
## ESモジュール {#es-modules} | ||
|
||
ESモジュールは、ECMAScriptの`import`、`export`構文を使って記述されるモジュールの形式です。 | ||
[export文][]によって外部にエクスポートされた変数や関数などのシンボルを、[import文][]を使って別のモジュールからインポートできます。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
シンボル
シンボルって何かが説明されてない感じがする?
(Symbolと勘違いもしそう)
シンボルって表現初めてみた気がするけどこれ仕様とかでそうなってたの?
使うなら最初のところで「〜をシンボルと呼びます」とかが必要そう。
source/use-case/module/README.md
Outdated
ESモジュールは、ECMAScriptの`import`、`export`構文を使って記述されるモジュールの形式です。 | ||
[export文][]によって外部にエクスポートされた変数や関数などのシンボルを、[import文][]を使って別のモジュールからインポートできます。 | ||
|
||
まずは`export`文について見ていきましょう。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここ若干の飛躍があって、おそらくここに入る前に、モジュールでは名前空間が別れてるという概念の説明が入りそうな気がする。
export/importできるけど、なぜするのかがよくわからない状態になってそう(グローバル変数ではだめなの?とか)
source/use-case/module/README.md
Outdated
### export文 {#export-syntax} | ||
|
||
`export`文は変数や関数などのシンボルをエクスポートし、別のモジュールから参照できるようにします。 | ||
エクスポートの方法は、名前付きとデフォルトの2種類があります。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
エクスポートの方法は、名前付きエクスポートとデフォルトエクスポートの2種類があります。
正式名称で書いて良さそう。
source/use-case/module/README.md
Outdated
import { foo as myModuleFoo } from "./myModule.js"; | ||
``` | ||
|
||
すべての名前付きエクスポートをまとめてインポートするための、`import * as`という構文もあります。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これ、セクション分けても良さそうな気がする。
なんていうんだろ?
NameSpaceImport?
source/use-case/module/README.md
Outdated
// 名前付きエクスポートされたfooをインポートする | ||
import myModuleDefault, { foo } from "./myModule.js"; | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
この辺に、エクスポートされてないシンボルをインポートするとどうなるかというのも書けるかも?
ES moduleは静的に解決されるので、存在しないものをインポートしたら、パースエラーになる?
スクリプトとして読み込まれたJavaScriptで`import`文や`export`文を使用すると、シンタックスエラーが発生します。 | ||
|
||
また、インポートされるモジュールの取得はネットワーク経由で解決されます。 | ||
そのため、モジュール名はJavaScriptファイルの絶対URLあるいは相対URLを指定します。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
詳しくはTodoアプリのユースケースでってリンクかな
source/use-case/module/README.md
Outdated
|
||
作成したESモジュールを実行するためには、起点となるJavaScriptファイルをESモジュールとしてWebブラウザに読み込ませる必要があります。 | ||
Webブラウザは`script`タグによってJavaScriptファイルを読み込み、実行します。 | ||
次のように`script`タグに`type="module"`という属性を付与すると、WeブラウザはJavaScriptファイルをESモジュールとして読み込みます。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weブラウザ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type="module"
という属性を付与すると
というは省いていいかな
source/use-case/module/README.md
Outdated
const myModule = require("./myModule.js"); | ||
``` | ||
|
||
Node.jsではESモジュールもサポートする予定ですが、現在はまだ安定した機能としてサポートされていません。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
詳細はCLIのところでってリンク
source/use-case/module/README.md
Outdated
# モジュール {#module} | ||
|
||
この章では **ECMAScriptモジュール(ESモジュール、JSモジュールとも呼ばれる)** について見ていきます。 | ||
ECMAScriptモジュールは、JavaScriptファイルをモジュールとして扱うための機能です。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
疎結合化とテスト可能性とか
source/use-case/module/README.md
Outdated
|
||
## ESモジュールを実行する {#run-es-modules} | ||
|
||
作成したESモジュールを実行するためには、起点となるJavaScriptファイルをESモジュールとしてWebブラウザに読み込ませる必要があります。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ブラウザとは(近い将来)限らないはずなので、なにか別の表現を探したい
source/use-case/module/README.md
Outdated
# モジュール {#module} | ||
|
||
この章では **ECMAScriptモジュール(ESモジュール、JSモジュールとも呼ばれる)** について見ていきます。 | ||
ECMAScriptモジュールは、JavaScriptファイルをモジュールとして扱うための機能です。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
コピペするとバージョン管理が大変という話も動機として上げていいのでは
source/use-case/module/README.md
Outdated
|
||
JavaScriptにおけるモジュールは、保守性・名前空間・再利用性のために使われます。 | ||
|
||
* 保守性: 依存性の高いコードの集合を一ヶ所にまとめ、それ以外のモジュールへの依存性を減らすことができます |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
一ヶ所
と一箇所
が全体で揺れてるけど、prhどっちに寄せるべきか
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
なぜかnetlifyのデプロイが落ちてる |
cache消してdeployしなおしてみたけど、なんか変な原因でコケてるな
|
別PR作ってもコケているので、Netlifyが何かおかしいか。 |
NODE_VERSIONを |
workboxがコケるのは npm/hosted-git-info#35 だった。 追記: Netlifyは勝手に治ったっぽい |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
構文の所までをもう一度見た。
スコープの説明どうするかなー
source/use-case/module/README.md
Outdated
* 名前空間: モジュールごとに分かれたスコープがあり、グローバルの名前空間を汚染しません | ||
* 再利用性: 便利な変数や関数を複数の場所にコピーアンドペーストせず、モジュールとして再利用できます | ||
|
||
JavaScriptのモジュールはひとつのJavaScriptファイルに対応します。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
対応関係的に
ひとつのJavaScriptのモジュールはひとつのJavaScriptファイルに対応します。
source/use-case/module/README.md
Outdated
|
||
`export`文は変数や関数などをエクスポートし、別のモジュールから参照できるようにします。 | ||
エクスポートの方法は、 **名前付きエクスポート** と **デフォルトエクスポート** の2種類があります。 | ||
名前付きエクスポートは、モジュールごとに複数持てます。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
持てます。
持つだとなんか変な気がするから、
- 複数かけます
- 複数エクスポートできます
- 複数の変数や関数などをエクスポートできます
- 複数定義できます
- 複数回書けます
MDNのはモジュールが主語だと訳がおかしい。
You can have multiple named exports per module but only one default export.
export - JavaScript | MDN
source/use-case/module/README.md
Outdated
[import, exportExample.js](src/export-default-1.js) | ||
|
||
また、次のように宣言とエクスポートを同時に行うことができます。 | ||
ただし、関数とクラスに限られます。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここの説明
- 関数とクラスのみは宣言と同時にエクスポートできる
- 名前を省略してエクスポートできる(関数式、クラス式としてエクスポートできる)
- 変数宣言などは宣言と同時にはエクスポートできない
- カンマ区切りで複数宣言できてしまうため
- Why is "export default var a = 1;" invalid syntax?
- 変数をエクスポートする場合は、すでに宣言されている変数をデフォルトエクスポートしないといけない
という関係が微妙にわかりにくい気がする。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ただし、関数とクラスに限られます。
ただし、宣言と同時にエクスポートできるのは関数とクラスに限られ、変数宣言は構文エラーとなります。
変数宣言は、カンマ区切りで複数の変数を定義できてるため。そのため、名前付きエクスポートとは異なりデフォルトエクスポートでの変数宣言はできません。
文で説明すると長い
また、次のように関数とクラスは宣言とデフォルトエクスポートを同時に行うことができます。
....コード
ただし、変数宣言は宣言とデフォルトエクスポートを同時に行うことはできません。
なぜなら、変数宣言はカンマ区切りで複数の変数を定義できてしまうためです。
...だめなコード例
みたいにするとか?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
また、次のように宣言とエクスポートを同時に行うことができます。
ただし、関数とクラスに限られます。
多分なんとなくくる違和感は、
- XXX できます
- ただし、<できる対象>だけです
というみたいな順番になっているのが原因な気がする。(後ろも読まないとできるのが誰かわからないし、逆にできないのは誰かが暗黙的になってる)
source/use-case/module/README.md
Outdated
### import文 {#import-syntax} | ||
|
||
`import`文は、別のモジュールからエクスポートされた変数や関数などを自身のモジュールにインポートします。 | ||
インポートした変数や関数は、そのモジュール内で宣言されたものと同じように扱えます。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- インポートした変数や関数は、そのモジュール内で宣言されたものと同じように扱えます。
+ インポートした変数や関数は、そのモジュールの先頭で宣言されたものと同じように扱えます。
としてhoistingの説明を避けるか、hoistingの説明をするかかな。
console.log(App);
import {App} from "./src/App.js"
hoisting自体の説明は一応されてるけど、どこに書いても先頭に書いたのと同じになるから、イメージ的には先頭でimportしろというのが伝わればいいかなーと思う。
https://asciidwango.github.io/js-primer/basic/function-scope/#hoisting-var
source/use-case/module/README.md
Outdated
|
||
#### 名前付きインポート {#named-import} | ||
|
||
名前付きインポートは、指定したモジュールがもつ名前付きエクスポートをインポートします。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
名前付きインポートは、指定したモジュールがもつ名前付きエクスポートをインポートします。
うしろで import { default as }
をだしてるから、なんか違和感あるかも。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
名前付きインポートは、指定したモジュールから名前を指定してインポートします
としか言いようがない感じはする。
こう書くと次の行とぶつかる。
やっぱり、named importとnamespace importは分けたほうがいい気がする。
分けてるケース:
source/use-case/module/README.md
Outdated
|
||
[import, importExample.js](src/import-2.js) | ||
|
||
もうひとつの方法は、すべての名前付きエクスポートをまとめてインポートする`import * as`構文です。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
source/use-case/module/README.md
Outdated
#### デフォルトインポート {#default-import} | ||
|
||
デフォルトインポートは、指定したモジュールのデフォルトエクスポートをインポートします。 | ||
デフォルトインポートには、専用の構文を使う方法と、名前付きインポートと同じ構文を使う方法の2つがあります。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
名前付きインポートと同じ構文を使う方法の2つがあります。
具体的に 名前付きインポートでdefault
を指定する方法の2つがあります。
とかでもよさそう。
source/use-case/module/README.md
Outdated
ESモジュールでは、エクスポートされていないものはインポートできません。 | ||
デフォルトインポートは指定したモジュールがデフォルトエクスポートをもっている必要があります。 | ||
同様に、名前付きインポートは指定した名前の名前付きエクスポートをもっている必要があります。 | ||
ESモジュールはJavaScriptのパース段階で解決されるため、対象が存在しないインポートはパースエラーを起こします。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
パース段階で解決されるため
パース段階で依存関係が解決されるため
とか(循環参照が許容されるのはたしかこれが理由)
source/use-case/module/README.md
Outdated
|
||
#### 付随効果のためのインポート {#import-for-side-effect} | ||
|
||
モジュールの中には、グローバルのコードを実行するだけで何もエクスポートしないものがあります。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
モジュールの中には、グローバルのコードを実行するだけで何もエクスポートしないものがあります。
具体的に説明ないとピンとこなさそう。
付随効果 は 副作用のための とかでいい気がする。
source/use-case/module/README.md
Outdated
[import, importExample.js](src/import-default-3.js) | ||
|
||
ESモジュールでは、エクスポートされていないものはインポートできません。 | ||
デフォルトインポートは指定したモジュールがデフォルトエクスポートをもっている必要があります。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- デフォルトエクスポートをもっている
+ デフォルトエクスポートをしている
じゃないかな。
source/use-case/module/README.md
Outdated
|
||
ESモジュールでは、エクスポートされていないものはインポートできません。 | ||
デフォルトインポートは指定したモジュールがデフォルトエクスポートをもっている必要があります。 | ||
同様に、名前付きインポートは指定した名前の名前付きエクスポートをもっている必要があります。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
どうように
- 名前付きエクスポートをもっている
+ 名前付きエクスポートをしている
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
デフォルトインポートと対にしたいので、
デフォルトインポートは、指定したモジュールがデフォルトエクスポートをしている必要があります。
同様に名前付きインポートは、指定したモジュールが指定した名前付きエクスポートをしている必要があります。
source/use-case/module/README.md
Outdated
ESモジュールでは、エクスポートされていないものはインポートできません。 | ||
デフォルトインポートは指定したモジュールがデフォルトエクスポートをもっている必要があります。 | ||
同様に、名前付きインポートは指定した名前の名前付きエクスポートをもっている必要があります。 | ||
ESモジュールはJavaScriptのパース段階で依存関係が解決されるため、対象が存在しないインポートはパースエラーを起こします。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
対象が存在しないインポートはパースエラーを起こします。
"対象" が少し曖昧な感じはする。
- ファイルパス
- エクスポートされてない名前
の2つが対象?
パースエラーになるのは エクスポートされてない名前 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
このパラグラフの先頭で
ESモジュールでは、エクスポートされていないものはインポートできません。
と言っているので、この文は同じことを半分言っているけど、微妙に離れてるのが気になる。
- 事実:
- ESモジュールでは、エクスポートされていないものはインポートできません。
- 対象が存在しないインポートはパースエラーを起こします。
- 理由:
- ESモジュールはJavaScriptのパース段階で依存関係が解決されるため
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ESモジュールでは、エクスポートされていないものはインポートできません。
なぜならESモジュールはJavaScriptのパース段階で依存関係が解決され、インポートする対象が存在しない場合はパースエラーとなるためです。
そのためデフォルトインポートは、指定したモジュールがデフォルトエクスポートをしている必要があります。
同様に名前付きインポートは、指定したモジュールが指定した名前付きエクスポートをしている必要があります。
とかかな?
もうちょっと短くできるといい気もするけど。
@@ -0,0 +1,3 @@ | |||
const _foo = "foo"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_
と internelFoo
とかどっちがいいかな?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
internalで
source/use-case/module/README.md
Outdated
モジュールの中には、グローバルのコードを実行するだけで何もエクスポートしないものがあります。 | ||
たとえば次のような、グローバル変数を操作するためのモジュールなどです。 | ||
|
||
[import, sideEffect.js](src/sideEffect.js) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import-side-effects.js?のパスミス
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これは存在するファイルです
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sideEffects.js
だった
source/use-case/module/README.md
Outdated
## CommonJSモジュール {#commonjs-module} | ||
|
||
[CommonJSモジュール][]とは、[Node.js][]環境で利用されているモジュール化の仕組みです。 | ||
ESモジュールの仕様が策定されるよりもずっと古くから使われており、Node.jsの標準パッケージや[NPM][]で配布されるサードパーティパッケージは、ほぼすべてCommonJSモジュールとして提供されています。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ほぼすべてCommonJSモジュールとして提供されています。
CommonJSモジュールとして提供されていることがほとんどです。
どっちが柔らかい感じかで迷った。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mjs が増える未来もあり得なくないので、少し柔らかい感じでもいいかなと思った。
source/use-case/module/README.md
Outdated
結果として、Node.js向けでないアプリケーションのソースコードもモジュール化することが一般的になり、 | ||
モジュールバンドラーはJavaScript開発において無くてはならないものになりました。 | ||
|
||
現在では、CommonJSだけでなくESモジュールにも対応したモジュールバンドラーがいくつも登場しています。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
現在って表現は脆くなりがちなので省いてもよさそう。
CommonJSだけでなくESモジュールにも対応したモジュールバンドラーがいくつも登場しています。
これ自体は事実なので、
モジュールバンドラーにはCommonJSだけでなくESモジュールにも対応したものもあります。
また、バンドルする際にJavaScriptコードの最適化を行うなどバンドル以外の機能を持つものもあります。
[JavaScriptモジュールについてのドキュメント][]では、
+WebにおけるJavaScriptのモジュールと、バンドルする目的などについて詳しくまとめられています。
ぐらいな感じでいいんじゃないかな。
(最適化 ∋ 軽量化 だと思うので)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ほかはLGTM
source/use-case/module/README.md
Outdated
モジュールバンドラーにはCommonJSだけでなくESモジュールにも対応したものもあります。 | ||
また、バンドルする際にJavaScriptコードの最適化を行うなどバンドル以外の機能をもつものもあります。 | ||
[JavaScriptモジュールについてのドキュメント][]では、 | ||
+WebにおけるJavaScriptのモジュールと、バンドルする目的などについて詳しくまとめられています。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+が入ってる
レビューありがとうございます 修正してmergeします |
なんかwebhook飛んでないな |
#329