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

url: docs deprecate legacy url API #22715

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,16 @@ deprecated along with the undocumented aliases `crypto.prng()` and
`crypto.rng()` in favor of [`crypto.randomBytes()`][] and will be removed in a
future release.

<a id="DEP00XX"></a>
### DEP00XX: Legacy URL API

Type: Documentation

The [Legacy URL API][] is deprecated. This includes [`url.format()`][],
[`url.parse()`][], [`url.resolve()`][], and the [legacy `urlObject`][]. Please
use the [WHATWG URL API][] instead.


[`--pending-deprecation`]: cli.html#cli_pending_deprecation
[`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size
[`Buffer.from(array)`]: buffer.html#buffer_class_method_buffer_from_array
Expand Down Expand Up @@ -1098,6 +1108,7 @@ future release.
[`os.tmpdir()`]: os.html#os_os_tmpdir
[`process.env`]: process.html#process_process_env
[`punycode`]: punycode.html
[`REPLServer.clearBufferedCommand()`]: repl.html#repl_replserver_clearbufferedcommand
[`require.extensions`]: modules.html#modules_require_extensions
[`script.createCachedData()`]: vm.html#vm_script_createcacheddata
[`setInterval()`]: timers.html#timers_setinterval_callback_delay_args
Expand All @@ -1108,6 +1119,9 @@ future release.
[`tls.TLSSocket`]: tls.html#tls_class_tls_tlssocket
[`tls.checkServerIdentity()`]: tls.html#tls_tls_checkserveridentity_hostname_cert
[`tls.createSecureContext()`]: tls.html#tls_tls_createsecurecontext_options
[`url.format()`]: url.html#url_url_format_urlobject
[`url.parse()`]: url.html#url_url_parse_urlstring_parsequerystring_slashesdenotehost
[`url.resolve()`]: url.html#url_url_resolve_from_to
[`util._extend()`]: util.html#util_util_extend_target_source
[`util.debug()`]: util.html#util_util_debug_string
[`util.error()`]: util.html#util_util_error_strings
Expand Down Expand Up @@ -1139,5 +1153,7 @@ future release.
[alloc_unsafe_size]: buffer.html#buffer_class_method_buffer_allocunsafe_size
[from_arraybuffer]: buffer.html#buffer_class_method_buffer_from_arraybuffer_byteoffset_length
[from_string_encoding]: buffer.html#buffer_class_method_buffer_from_string_encoding
[Legacy URL API]: url.html#url_legacy_url_api
[legacy `urlObject`]: url.html#url_legacy_urlobject
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
[`REPLServer.clearBufferedCommand()`]: repl.html#repl_replserver_clearbufferedcommand
[WHATWG URL API]: url.html#url_the_whatwg_url_api
17 changes: 17 additions & 0 deletions doc/api/url.md
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,15 @@ pathToFileURL('/some/path%.js'); // Correct: file:///some/path%25 (POSIX)

## Legacy URL API

> Stability: 0 - Deprecated: Use the WHATWG URL API instead.

### Legacy `urlObject`
<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/22715
description: The Legacy URL API is deprecated. Use the WHATWG URL API.
-->

The legacy `urlObject` (`require('url').Url`) is created and returned by the
`url.parse()` function.
Expand Down Expand Up @@ -1070,6 +1078,9 @@ forward-slash characters (`/`) are required following the colon in the
<!-- YAML
added: v0.1.25
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/22715
description: The Legacy URL API is deprecated. Use the WHATWG URL API.
- version: v7.0.0
pr-url: https://github.com/nodejs/node/pull/7234
description: URLs with a `file:` scheme will now always use the correct
Expand Down Expand Up @@ -1158,6 +1169,9 @@ The formatting process operates as follows:
<!-- YAML
added: v0.1.25
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/22715
description: The Legacy URL API is deprecated. Use the WHATWG URL API.
- version: v9.0.0
pr-url: https://github.com/nodejs/node/pull/13606
description: The `search` property on the returned URL object is now `null`
Expand Down Expand Up @@ -1186,6 +1200,9 @@ A `URIError` is thrown if the `auth` property is present but cannot be decoded.
<!-- YAML
added: v0.1.25
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/22715
description: The Legacy URL API is deprecated. Use the WHATWG URL API.
- version: v6.6.0
pr-url: https://github.com/nodejs/node/pull/8215
description: The `auth` fields are now kept intact when `from` and `to`
Expand Down