Skip to content

Commit ad97045

Browse files
MikeMcC399aduh95
authored andcommitted
doc: include url.resolve() in DEP0169 application deprecation
Mark url.resolve() as deprecated Update also DEP0116 with cross-reference to DEP0169 PR-URL: #62002 Fixes: #61816 Refs: #61780 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
1 parent 79fb8cb commit ad97045

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

doc/api/deprecations.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2642,11 +2642,15 @@ future release.
26422642

26432643
<!-- YAML
26442644
changes:
2645+
- version:
2646+
- v24.0.0
2647+
pr-url: https://github.com/nodejs/node/pull/55017
2648+
description: DEP0169 covers also `url.format()` and `url.resolve()`.
26452649
- version:
26462650
- v19.0.0
26472651
- v18.13.0
26482652
pr-url: https://github.com/nodejs/node/pull/44919
2649-
description: \`url.parse()` is deprecated again in DEP0169.
2653+
description: DEP0169 deprecates `url.parse()` again.
26502654
- version:
26512655
- v15.13.0
26522656
- v14.17.0
@@ -3729,7 +3733,7 @@ Type: Application (non-`node_modules` code only)
37293733
have security implications. Use the [WHATWG URL API][] instead. CVEs are not
37303734
issued for `url.parse()` vulnerabilities.
37313735

3732-
Passing a string argument to [`url.format()`][] invokes `url.parse()`
3736+
Calling [`url.format(urlString)`][] or [`url.resolve()`][] invokes `url.parse()`
37333737
internally, and is therefore also covered by this deprecation.
37343738

37353739
### DEP0170: Invalid port when using `url.parse()`
@@ -4503,6 +4507,7 @@ const server = http2.createSecureServer({
45034507
[`tls.createSecureContext()`]: tls.md#tlscreatesecurecontextoptions
45044508
[`tls.createServer()`]: tls.md#tlscreateserveroptions-secureconnectionlistener
45054509
[`url.format()`]: url.md#urlformaturlobject
4510+
[`url.format(urlString)`]: url.md#urlformaturlstring
45064511
[`url.parse()`]: url.md#urlparseurlstring-parsequerystring-slashesdenotehost
45074512
[`url.resolve()`]: url.md#urlresolvefrom-to
45084513
[`util._extend()`]: util.md#util_extendtarget-source

doc/api/url.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1833,7 +1833,7 @@ changes:
18331833
18341834
`url.format(urlString)` is shorthand for `url.format(url.parse(urlString))`.
18351835
1836-
Because it invokes the deprecated [`url.parse()`][], passing a string argument
1836+
Because it invokes the deprecated [`url.parse()`][] internally, passing a string argument
18371837
to `url.format()` is itself deprecated.
18381838
18391839
Canonicalizing a URL string can be performed using the WHATWG URL API, by
@@ -1950,6 +1950,10 @@ npx codemod@latest @nodejs/node-url-to-whatwg-url
19501950
<!-- YAML
19511951
added: v0.1.25
19521952
changes:
1953+
- version:
1954+
- v24.0.0
1955+
pr-url: https://github.com/nodejs/node/pull/55017
1956+
description: Deprecated again through DEP0169.
19531957
- version:
19541958
- v15.13.0
19551959
- v14.17.0
@@ -1973,6 +1977,8 @@ changes:
19731977
contains a hostname.
19741978
-->
19751979
1980+
> Stability: 0 - Deprecated: Use the WHATWG URL API instead.
1981+
19761982
* `from` {string} The base URL to use if `to` is a relative URL.
19771983
* `to` {string} The target URL to resolve.
19781984
@@ -1986,6 +1992,8 @@ url.resolve('http://example.com/', '/one'); // 'http://example.com/one'
19861992
url.resolve('http://example.com/one', '/two'); // 'http://example.com/two'
19871993
```
19881994
1995+
Because it invokes the deprecated [`url.parse()`][] internally, `url.resolve()` is itself deprecated.
1996+
19891997
To achieve the same result using the WHATWG URL API:
19901998
19911999
```js

0 commit comments

Comments
 (0)