-
Notifications
You must be signed in to change notification settings - Fork 4
/
967.txt
76 lines (54 loc) · 4.11 KB
/
967.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
[5] [DFN[[RUBYB[モジュール写像][module map]]]]は、
[[モジュールスクリプト]]の読み込みを管理するための[[仕様書]]上の[[データ構造]]です。
[[文書]]や[[ワーカー]]ごとに読み込み中や読み込み済みの[[モジュールスクリプト]]の [[URL]]
が保存されており、二重に [[fetch]] されるのを防ぐ働きをしています。
* 仕様書
[REFS[
- [10] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2016-03-27 03:13:07 +09:00]] 版) <https://html.spec.whatwg.org/#concept-document-module-map>
- [13] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2016-03-27 03:13:07 +09:00]] 版) <https://html.spec.whatwg.org/#environment-settings-object>
- [2] '''[CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2016-01-21 11:56:00 +09:00]] 版) <https://html.spec.whatwg.org/#module-map>'''
- [14] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2016-03-27 03:13:07 +09:00]] 版) <https://html.spec.whatwg.org/#concept-workerglobalscope-module-map>
]REFS]
* 意味
[3] [DFN[[F[[RUBYB[モジュール写像]@en[module map]]]]]]は、
[[絶対URL]]から値への[[写像]]です [SRC[>>2]]。
[6] この[[写像]]は、[[輸入]]された [[JavaScript]] [[モジュール]]が、
一度だけ [[fetch]]、[[構文解析]]、[[評価]]されるようにするためのものです [SRC[>>2]]。
[4] 値は、[[モジュールスクリプト]]、 [[null]]、 [CODE[fetching]]
のいずれかです [SRC[>>2]]。
[20] [DFN[[CODE[fetching]]]] は、[[スクリプトのfetch]]が実行中であることを表します。
[[仕様書]]上は特別な値として扱われていますが、同時に、他の [[fetch]]
の完了を[RUBYB[待つ]@en[wait]]他のいくつかの処理のリスト
([[履行]]時の[[コールバック]]を登録できる[[約束]]のようなもの) とも捉えれれます。
* 文脈
[11] [[文書]]は、[DFN[[F[[RUBYB[[[モジュール写像]]]@en[module map]]]]]]を持ちます。
初期状態では、空の[[モジュール写像]]です。 [SRC[>>10]]
[15] [CODE(DOMi)@en[WorkerGlobalScope]] は、
[DFN[[F[[RUBYB[[[モジュール写像]]]@en[module map]]]]]]を持ちます。
初期状態では、空の[[モジュール写像]]です。 [SRC[>>14]]
[12] [[環境設定群オブジェクト]]は、
[DFN[[F[[RUBYB[[[モジュール写像]]]@en[module map]]]]]]を持ちます [SRC[>>13]]。
これは[[文書]]や[[ワーカー大域オブジェクト]]の[F[モジュール写像]]を返すものです。
;; [[環境設定群オブジェクト]]参照。
[7] この[[写像]]は、[[単一モジュールスクリプトのfetch]]で参照・変更されます。
[8] この[[写像]]は、 [CODE[[[HostResolveImportedModule]]]] で参照されます。
[16] この[[写像]]は、[[未実現値化包括的子孫モジュールスクリプト群]]で参照されます。
* 歴史
[REFS[
- [1] [CITE@en[Add <script type="module"> and module resolution/fetching/evaluation · whatwg/html@cd1a9fb]] ([TIME[2016-01-21 23:18:53 +09:00]] 版) <https://github.com/whatwg/html/commit/cd1a9fb1e83f7d0bc30be8b34ecdaf444a0b19a4>
]REFS]
[9] [CITE@en[Move module map to Document/WorkerGlobalScope · whatwg/html@9a889fe]]
([TIME[2016-03-28 21:48:49 +09:00]] 版)
<https://github.com/whatwg/html/commit/9a889fee2ecb106974fb48fa50491edd77047954>
[17] [CITE@en[Clarify what null means in the module map]]
([[domenic]]著, [TIME[2016-11-02 03:07:35 +09:00]])
<https://github.com/whatwg/html/commit/317160cc396f08506e920bdc5e28c27aad633529>
[18] [CITE@en[Editorial: refactor modules to use Infra Standard data structures]]
([[domenic]]著, [TIME[2016-11-17 08:03:04 +09:00]])
<https://github.com/whatwg/html/commit/37ea5ac07f36b71b1b9e3861804f623752ed210d>
[19] [CITE@en[Don't handle impossible errors in HostResolveImportedModule]]
([[domenic]]著, [TIME[2017-05-13 01:59:57 +09:00]])
<https://github.com/whatwg/html/commit/616df18cd9e6c17878db5167909c69ca9f9d2906>
[21] [CITE@en[Add <link> rel="modulepreload"]]
([[domenic]]著, [TIME[2017-12-15 05:04:40 +09:00]])
<https://github.com/whatwg/html/commit/7c28027b80208aa6b126fa7b086c44877f584178>