From 255429d6ef3397c6ffeb18db6c1b8195d6e945ae Mon Sep 17 00:00:00 2001 From: nojaf Date: Sun, 27 Jul 2025 16:43:09 +0200 Subject: [PATCH] Remove underscores --- docs/content/docs/contributing/code-generation.mdx | 4 ++-- src/DOMAPI/Element.res | 4 ++-- src/DOMAPI/Window.res | 4 ++-- src/Global.res | 4 ++-- src/WebWorkersAPI/WorkerGlobalScope.res | 4 ++-- tests/DOMAPI/HTMLElement__test.res | 2 +- tests/Global__test.res | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/content/docs/contributing/code-generation.mdx b/docs/content/docs/contributing/code-generation.mdx index a139556..d54e9b2 100644 --- a/docs/content/docs/contributing/code-generation.mdx +++ b/docs/content/docs/contributing/code-generation.mdx @@ -29,7 +29,7 @@ external fetch2: (window, ~input: string, ~init: requestInit=?) While not that bad and usable, it can be improved: - Rename `fetch2` to `fetch` because it is the more common usage of the function. -- Rename `fetch` to `fetch_with_request` for clarity that this is the "overload" with a `Request` object. +- Rename `fetch` to `fetchWithRequest` for clarity that this is the "overload" with a `Request` object. - Consider removing the named `~input` and `~init` arguments and use positional arguments instead. Motivation: If the function does not have any parameters with the same type, it is more ergonomic to use positional arguments. This heuristic is not set in stone and can be adjusted based on the specific function. @@ -43,7 +43,7 @@ external fetch: (window, string, ~init: requestInit=?) /** TODO: add better docs */ @send -external fetch_withRequest: (window, request, ~init: requestInit=?) +external fetchWithRequest: (window, request, ~init: requestInit=?) => promise = "fetch" ``` diff --git a/src/DOMAPI/Element.res b/src/DOMAPI/Element.res index 13b665b..19fc537 100644 --- a/src/DOMAPI/Element.res +++ b/src/DOMAPI/Element.res @@ -419,13 +419,13 @@ element->Element.scrollIntoView_alignToTop() Scrolls the element's ancestor containers such that the element on which scrollIntoView() is called is visible to the user. ```res -element->Element.scrollIntoView_withOptions({ behavior: DOMAPI.Smooth }) +element->Element.scrollIntoViewWithOptions({ behavior: DOMAPI.Smooth }) ``` [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) */ @send - external scrollIntoView_withOptions: (T.t, scrollIntoViewOptions) => unit = "scrollIntoView" + external scrollIntoViewWithOptions: (T.t, scrollIntoViewOptions) => unit = "scrollIntoView" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) diff --git a/src/DOMAPI/Window.res b/src/DOMAPI/Window.res index 9b59e32..2d16381 100644 --- a/src/DOMAPI/Window.res +++ b/src/DOMAPI/Window.res @@ -303,7 +303,7 @@ let response = await window->Window.fetch("https://rescript-lang.org") external fetch: (window, string, ~init: requestInit=?) => promise = "fetch" /** -`fetch_withRequest(window, request, init)` +`fetchWithRequest(window, request, init)` Starts the process of fetching a resource from the network, returning a promise that is fulfilled once the response is available. @@ -314,7 +314,7 @@ let response = await window->Window.fetch(myRequest) [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/fetch) */ @send -external fetch_withRequest: (window, request, ~init: requestInit=?) => promise = "fetch" +external fetchWithRequest: (window, request, ~init: requestInit=?) => promise = "fetch" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/requestAnimationFrame) diff --git a/src/Global.res b/src/Global.res index f213762..49bec62 100644 --- a/src/Global.res +++ b/src/Global.res @@ -493,7 +493,7 @@ let response = await fetch("https://rescript-lang.org") external fetch: (string, ~init: requestInit=?) => promise = "fetch" /** -`fetch_withRequest(request, init)` +`fetchWithRequest(request, init)` Starts the process of fetching a resource from the network, returning a promise that is fulfilled once the response is available. @@ -504,7 +504,7 @@ let response = await fetch(myRequest) [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/fetch) */ -external fetch_withRequest: (request, ~init: requestInit=?) => promise = "fetch" +external fetchWithRequest: (request, ~init: requestInit=?) => promise = "fetch" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/requestAnimationFrame) diff --git a/src/WebWorkersAPI/WorkerGlobalScope.res b/src/WebWorkersAPI/WorkerGlobalScope.res index 08113bb..8c88ef0 100644 --- a/src/WebWorkersAPI/WorkerGlobalScope.res +++ b/src/WebWorkersAPI/WorkerGlobalScope.res @@ -24,7 +24,7 @@ let response = await self->WorkerGlobalScope.fetch("https://rescript-lang.org") external fetch: (T.t, string, ~init: requestInit=?) => promise = "fetch" /** -`fetch_withRequest(workerGlobalScope, request, init)` +`fetchWithRequest(workerGlobalScope, request, init)` The fetch() method of the WorkerGlobalScope interface starts the process of fetching a resource from the network, returning a promise that is fulfilled once the response is available. @@ -35,7 +35,7 @@ let response = await self->WorkerGlobalScope.fetch(myRequest) [Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/fetch) */ - external fetch_withRequest: (T.t, request, ~init: requestInit=?) => promise = "fetch" + external fetchWithRequest: (T.t, request, ~init: requestInit=?) => promise = "fetch" } include Impl({type t = workerGlobalScope}) diff --git a/tests/DOMAPI/HTMLElement__test.res b/tests/DOMAPI/HTMLElement__test.res index fdd1a38..9b8743b 100644 --- a/tests/DOMAPI/HTMLElement__test.res +++ b/tests/DOMAPI/HTMLElement__test.res @@ -5,5 +5,5 @@ document ->Document.querySelector("form") ->Null.toOption ->Option.forEach(form => { - form->Element.scrollIntoView_withOptions({behavior: DOMAPI.Smooth}) + form->Element.scrollIntoViewWithOptions({behavior: DOMAPI.Smooth}) }) diff --git a/tests/Global__test.res b/tests/Global__test.res index a1eee25..4539335 100644 --- a/tests/Global__test.res +++ b/tests/Global__test.res @@ -15,7 +15,7 @@ let response2 = await fetch( }, ) -let response3 = await fetch_withRequest( +let response3 = await fetchWithRequest( Request.fromURL("https://rescript-lang.org/"), ~init={ method: "POST",