Skip to content

Commit

Permalink
url: replace url-parser with ada
Browse files Browse the repository at this point in the history
PR-URL: #46410
Backport-PR-URL: #47435
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
  • Loading branch information
anonrig authored and danielleadams committed Apr 12, 2023
1 parent 0bc4c17 commit e926354
Show file tree
Hide file tree
Showing 17 changed files with 376 additions and 2,957 deletions.
495 changes: 139 additions & 356 deletions lib/internal/url.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,6 @@
'src/node_trace_events.cc',
'src/node_types.cc',
'src/node_url.cc',
'src/node_url_tables.cc',
'src/node_util.cc',
'src/node_v8.cc',
'src/node_wasi.cc',
Expand Down Expand Up @@ -1261,7 +1260,6 @@
'test/cctest/test_sockaddr.cc',
'test/cctest/test_traced_value.cc',
'test/cctest/test_util.cc',
'test/cctest/test_url.cc',
],

'conditions': [
Expand Down
7 changes: 3 additions & 4 deletions src/crypto/crypto_common.cc
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#include "crypto/crypto_common.h"
#include "base_object-inl.h"
#include "env-inl.h"
#include "memory_tracker-inl.h"
#include "node.h"
#include "node_buffer.h"
#include "node_crypto.h"
#include "crypto/crypto_common.h"
#include "node.h"
#include "node_internals.h"
#include "node_url.h"
#include "string_bytes.h"
#include "memory_tracker-inl.h"
#include "v8.h"

#include <openssl/ec.h>
Expand Down
5 changes: 3 additions & 2 deletions src/inspector_agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -647,8 +647,9 @@ class NodeInspectorClient : public V8InspectorClient {
protocol::StringUtil::StringViewToUtf8(resource_name_view);
if (!IsFilePath(resource_name))
return nullptr;
node::url::URL url = node::url::URL::FromFilePath(resource_name);
return Utf8ToStringView(url.href());

std::string url = node::url::FromFilePath(resource_name);
return Utf8ToStringView(url);
}

node::Environment* env_;
Expand Down
3 changes: 0 additions & 3 deletions src/module_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "node_errors.h"
#include "node_internals.h"
#include "node_process-inl.h"
#include "node_url.h"
#include "node_watchdog.h"
#include "util-inl.h"

Expand All @@ -20,8 +19,6 @@ namespace loader {
using errors::TryCatchScope;

using node::contextify::ContextifyContext;
using node::url::URL;
using node::url::URL_FLAGS_FAILED;
using v8::Array;
using v8::ArrayBufferView;
using v8::Context;
Expand Down
2 changes: 1 addition & 1 deletion src/node_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ void napi_module_register_by_symbol(v8::Local<v8::Object> exports,
// a file system path.
// TODO(gabrielschulhof): Pass the `filename` through unchanged if/when we
// receive it as a URL already.
module_filename = node::url::URL::FromFilePath(filename.ToString()).href();
module_filename = node::url::FromFilePath(filename.ToString());
}

// Create a new napi_env for this specific module.
Expand Down
2 changes: 2 additions & 0 deletions src/node_metadata.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "node_metadata.h"
#include "acorn_version.h"
#include "ada.h"
#include "ares.h"
#include "brotli/encode.h"
#include "llhttp.h"
Expand Down Expand Up @@ -115,6 +116,7 @@ Metadata::Versions::Versions() {
#endif

simdutf = SIMDUTF_VERSION;
ada = ADA_VERSION;
}

Metadata::Release::Release() : name(NODE_RELEASE) {
Expand Down
1 change: 1 addition & 0 deletions src/node_metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ namespace node {
V(uvwasi) \
V(acorn) \
V(simdutf) \
V(ada) \
NODE_VERSIONS_KEY_UNDICI(V)

#if HAVE_OPENSSL
Expand Down
Loading

0 comments on commit e926354

Please sign in to comment.