Skip to content

Commit c855310

Browse files
committed
tools,doc: move more MDN links to types
PR-URL: #58930 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Claudio Wunder <cwunder@gnome.org> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
1 parent 6d1fe67 commit c855310

File tree

5 files changed

+23
-25
lines changed

5 files changed

+23
-25
lines changed

doc/api/buffer.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ changes:
464464
description: No longer experimental.
465465
-->
466466

467-
A [`Blob`][] encapsulates immutable, raw data that can be safely shared across
467+
A {Blob} encapsulates immutable, raw data that can be safely shared across
468468
multiple worker threads.
469469

470470
### `new buffer.Blob([sources[, options]])`
@@ -5522,7 +5522,6 @@ introducing security vulnerabilities into an application.
55225522
[UTF-16]: https://en.wikipedia.org/wiki/UTF-16
55235523
[UTF-8]: https://en.wikipedia.org/wiki/UTF-8
55245524
[WHATWG Encoding Standard]: https://encoding.spec.whatwg.org/
5525-
[`Blob`]: https://developer.mozilla.org/en-US/docs/Web/API/Blob
55265525
[`Buffer.alloc()`]: #static-method-bufferallocsize-fill-encoding
55275526
[`Buffer.allocUnsafe()`]: #static-method-bufferallocunsafesize
55285527
[`Buffer.allocUnsafeSlow()`]: #static-method-bufferallocunsafeslowsize

doc/api/cli.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1814,7 +1814,7 @@ For more information, see the [TypeScript type-stripping][] documentation.
18141814
added: v22.0.0
18151815
-->
18161816

1817-
Disable exposition of [`WebSocket`][] on the global scope.
1817+
Disable exposition of {WebSocket} on the global scope.
18181818

18191819
### `--no-extra-info-on-fatal-exception`
18201820

@@ -3917,7 +3917,6 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12
39173917
[`NO_COLOR`]: https://no-color.org
39183918
[`SlowBuffer`]: buffer.md#class-slowbuffer
39193919
[`Web Storage`]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API
3920-
[`WebSocket`]: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket
39213920
[`YoungGenerationSizeFromSemiSpaceSize`]: https://chromium.googlesource.com/v8/v8.git/+/refs/tags/10.3.129/src/heap/heap.cc#328
39223921
[`dns.lookup()`]: dns.md#dnslookuphostname-options-callback
39233922
[`dns.setDefaultResultOrder()`]: dns.md#dnssetdefaultresultorderorder

doc/api/globals.md

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ changes:
3636
<!-- type=global -->
3737

3838
A utility class used to signal cancelation in selected `Promise`-based APIs.
39-
The API is based on the Web API [`AbortController`][].
39+
The API is based on the Web API {AbortController}.
4040

4141
```js
4242
const ac = new AbortController();
@@ -453,7 +453,7 @@ changes:
453453
454454
<!-- type=global -->
455455

456-
A browser-compatible implementation of the [`CustomEvent` Web API][].
456+
A browser-compatible implementation of {CustomEvent}.
457457

458458
## Class: `DecompressionStream`
459459

@@ -493,7 +493,7 @@ added: v22.3.0
493493
> Stability: 1 - Experimental. Enable this API with the [`--experimental-eventsource`][]
494494
> CLI flag.
495495
496-
A browser-compatible implementation of the [`EventSource`][] class.
496+
A browser-compatible implementation of {EventSource}.
497497

498498
## `EventTarget`
499499

@@ -685,7 +685,7 @@ added: v15.0.0
685685
686686
<!-- type=global -->
687687

688-
The `MessageEvent` class. See [`MessageEvent`][] for more details.
688+
A browser-compatible implementation of {MessageEvent}.
689689

690690
## `MessagePort`
691691

@@ -1121,10 +1121,10 @@ added: v0.0.1
11211121
added: v22.4.0
11221122
-->
11231123

1124-
> Stability: 1.0 - Early development.
1124+
> Stability: 1.0 - Early development. Enable this API with the
1125+
> [`--experimental-webstorage`][] CLI flag.
11251126
1126-
A browser-compatible implementation of [`Storage`][]. Enable this API with the
1127-
[`--experimental-webstorage`][] CLI flag.
1127+
A browser-compatible implementation of {Storage}.
11281128

11291129
## `structuredClone(value[, options])`
11301130

@@ -1167,7 +1167,7 @@ added: v17.0.0
11671167
11681168
<!-- type=global -->
11691169

1170-
The WHATWG `DOMException` class. See [`DOMException`][] for more details.
1170+
The WHATWG {DOMException} class.
11711171

11721172
## `TextDecoder`
11731173

@@ -1298,7 +1298,7 @@ changes:
12981298

12991299
> Stability: 2 - Stable
13001300
1301-
A browser-compatible implementation of [`WebSocket`][]. Disable this API
1301+
A browser-compatible implementation of {WebSocket}. Disable this API
13021302
with the [`--no-experimental-websocket`][] CLI flag.
13031303

13041304
## Class: `WritableStream`
@@ -1350,17 +1350,12 @@ A browser-compatible implementation of [`WritableStreamDefaultWriter`][].
13501350
[`--no-experimental-global-navigator`]: cli.md#--no-experimental-global-navigator
13511351
[`--no-experimental-global-webcrypto`]: cli.md#--no-experimental-global-webcrypto
13521352
[`--no-experimental-websocket`]: cli.md#--no-experimental-websocket
1353-
[`AbortController`]: https://developer.mozilla.org/en-US/docs/Web/API/AbortController
13541353
[`ByteLengthQueuingStrategy`]: webstreams.md#class-bytelengthqueuingstrategy
13551354
[`CompressionStream`]: webstreams.md#class-compressionstream
13561355
[`CountQueuingStrategy`]: webstreams.md#class-countqueuingstrategy
1357-
[`CustomEvent` Web API]: https://dom.spec.whatwg.org/#customevent
1358-
[`DOMException`]: https://developer.mozilla.org/en-US/docs/Web/API/DOMException
13591356
[`DecompressionStream`]: webstreams.md#class-decompressionstream
1360-
[`EventSource`]: https://developer.mozilla.org/en-US/docs/Web/API/EventSource
13611357
[`EventTarget` and `Event` API]: events.md#eventtarget-and-event-api
13621358
[`MessageChannel`]: worker_threads.md#class-messagechannel
1363-
[`MessageEvent`]: https://developer.mozilla.org/en-US/docs/Web/API/MessageEvent/MessageEvent
13641359
[`MessagePort`]: worker_threads.md#class-messageport
13651360
[`PerformanceEntry`]: perf_hooks.md#class-performanceentry
13661361
[`PerformanceMark`]: perf_hooks.md#class-performancemark
@@ -1374,7 +1369,6 @@ A browser-compatible implementation of [`WritableStreamDefaultWriter`][].
13741369
[`ReadableStreamDefaultController`]: webstreams.md#class-readablestreamdefaultcontroller
13751370
[`ReadableStreamDefaultReader`]: webstreams.md#class-readablestreamdefaultreader
13761371
[`ReadableStream`]: webstreams.md#class-readablestream
1377-
[`Storage`]: https://developer.mozilla.org/en-US/docs/Web/API/Storage
13781372
[`TextDecoderStream`]: webstreams.md#class-textdecoderstream
13791373
[`TextDecoder`]: util.md#class-utiltextdecoder
13801374
[`TextEncoderStream`]: webstreams.md#class-textencoderstream
@@ -1383,7 +1377,6 @@ A browser-compatible implementation of [`WritableStreamDefaultWriter`][].
13831377
[`TransformStream`]: webstreams.md#class-transformstream
13841378
[`URLSearchParams`]: url.md#class-urlsearchparams
13851379
[`URL`]: url.md#class-url
1386-
[`WebSocket`]: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket
13871380
[`WritableStreamDefaultController`]: webstreams.md#class-writablestreamdefaultcontroller
13881381
[`WritableStreamDefaultWriter`]: webstreams.md#class-writablestreamdefaultwriter
13891382
[`WritableStream`]: webstreams.md#class-writablestream

doc/api/http.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4239,7 +4239,7 @@ added:
42394239
- v22.5.0
42404240
-->
42414241
4242-
A browser-compatible implementation of [`WebSocket`][].
4242+
A browser-compatible implementation of {WebSocket}.
42434243
42444244
[RFC 8187]: https://www.rfc-editor.org/rfc/rfc8187.txt
42454245
[`'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`]: errors.md#err_http_content_length_mismatch
@@ -4257,7 +4257,6 @@ A browser-compatible implementation of [`WebSocket`][].
42574257
[`Headers`]: globals.md#class-headers
42584258
[`TypeError`]: errors.md#class-typeerror
42594259
[`URL`]: url.md#the-whatwg-url-api
4260-
[`WebSocket`]: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket
42614260
[`agent.createConnection()`]: #agentcreateconnectionoptions-callback
42624261
[`agent.getName()`]: #agentgetnameoptions
42634262
[`destroy()`]: #agentdestroy

tools/doc/type-parser.mjs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
const jsDocPrefix = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/';
1+
const mdnPrefix = 'https://developer.mozilla.org/en-US/docs/Web';
2+
const jsDocPrefix = `${mdnPrefix}/JavaScript/`;
23

34
const jsDataStructuresUrl = `${jsDocPrefix}Data_structures`;
45
const jsPrimitives = {
@@ -32,8 +33,7 @@ const customTypesMap = {
3233
'AbortController': 'globals.html#class-abortcontroller',
3334
'AbortSignal': 'globals.html#class-abortsignal',
3435

35-
'ArrayBufferView':
36-
'https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView',
36+
'ArrayBufferView': `${mdnPrefix}/API/ArrayBufferView`,
3737

3838
'AsyncIterator': 'https://tc39.github.io/ecma262/#sec-asynciterator-interface',
3939

@@ -137,6 +137,14 @@ const customTypesMap = {
137137
'CustomEvent': 'events.html#class-customevent',
138138
'EventListener': 'events.html#event-listener',
139139

140+
'CloseEvent': `${mdnPrefix}/API/CloseEvent`,
141+
'EventSource': `${mdnPrefix}/API/EventSource`,
142+
'MessageEvent': `${mdnPrefix}/API/MessageEvent`,
143+
144+
'DOMException': `${mdnPrefix}/API/DOMException`,
145+
'Storage': `${mdnPrefix}/API/Storage`,
146+
'WebSocket': `${mdnPrefix}/API/WebSocket`,
147+
140148
'FileHandle': 'fs.html#class-filehandle',
141149
'fs.Dir': 'fs.html#class-fsdir',
142150
'fs.Dirent': 'fs.html#class-fsdirent',

0 commit comments

Comments
 (0)