Skip to content
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

モジュール(module) #329

Closed
azu opened this issue Dec 7, 2017 · 10 comments
Closed

モジュール(module) #329

azu opened this issue Dec 7, 2017 · 10 comments
Assignees
Labels
Status: Ready for PR Pull RequestしてOKな状態 Type: 基礎文法

Comments

@azu
Copy link
Collaborator

azu commented Dec 7, 2017

#267
環境 > モジュールの章

ユースケースの一部

@azu
Copy link
Collaborator Author

azu commented Feb 15, 2018

@azu azu changed the title モジュール モジュール(module) Mar 22, 2018
@lacolaco lacolaco self-assigned this Mar 22, 2018
@azu
Copy link
Collaborator Author

azu commented Mar 22, 2018

拡張子はデフォルトでつけておいて、Node.jsでは省略できますと注記する

@lacolaco
Copy link
Collaborator

@azu
Copy link
Collaborator Author

azu commented Apr 19, 2018

<script type="module">
    export const scopeA = "A";
</script>
<script type="module">
    // 異なるmoduleスコープの変数には直接はアクセスできない
    console.log(scopeA); // => ReferenceError: scopeA is not defined
</script>

これの説明が必要そうと思った。
ajaxだとこのルール外を前提にbodyからJavaScriptを叩いてるけど、module読み込みだとそれはできない。
todoappだとそうなるから、最初になんで index.jsからまとめて読み込むのって話を書いてる

@azu
Copy link
Collaborator Author

azu commented May 7, 2018

http://kenshir0f.hatenablog.com/entry/2018/05/05/232948
default と named で括弧の有無については言葉でも説明した方がよさそう

@azu
Copy link
Collaborator Author

azu commented May 7, 2018

defaultのメンタルモデル

https://thefeedbackloop.xyz/the-mechanism-is-not-the-mental-model/

@azu
Copy link
Collaborator Author

azu commented May 17, 2018

モジュールのスコープについてを説明することになった
#454 (comment)

@azu
Copy link
Collaborator Author

azu commented May 18, 2018

@lacolaco lacolaco added the Status: Ready for PR Pull RequestしてOKな状態 label May 31, 2018
@azu
Copy link
Collaborator Author

azu commented Jun 18, 2018

現実ではmoduleを直に使うよりbundlerを使ったほうがいいよという話を最後に入れる場合に参照しそうなやつ。

Using JavaScript modules on the web  |  Web Fundamentals  |  Google Developers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Ready for PR Pull RequestしてOKな状態 Type: 基礎文法
Projects
None yet
Development

No branches or pull requests

2 participants