Skip to content

Commit b56f2cb

Browse files
authored
Merge pull request #130 from rescript-lang/without-underscores
Remove underscores
2 parents beb6b0c + 255429d commit b56f2cb

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

docs/content/docs/contributing/code-generation.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ external fetch2: (window, ~input: string, ~init: requestInit=?)
2929
While not that bad and usable, it can be improved:
3030

3131
- Rename `fetch2` to `fetch` because it is the more common usage of the function.
32-
- Rename `fetch` to `fetch_with_request` for clarity that this is the "overload" with a `Request` object.
32+
- Rename `fetch` to `fetchWithRequest` for clarity that this is the "overload" with a `Request` object.
3333
- Consider removing the named `~input` and `~init` arguments and use positional arguments instead.
3434
Motivation: If the function does not have any parameters with the same type, it is more ergonomic to use positional arguments.
3535
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=?)
4343
4444
/** TODO: add better docs */
4545
@send
46-
external fetch_withRequest: (window, request, ~init: requestInit=?)
46+
external fetchWithRequest: (window, request, ~init: requestInit=?)
4747
=> promise<response> = "fetch"
4848
```
4949

src/DOMAPI/Element.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,13 +419,13 @@ element->Element.scrollIntoView_alignToTop()
419419
Scrolls the element's ancestor containers such that the element on which scrollIntoView() is called is visible to the user.
420420
421421
```res
422-
element->Element.scrollIntoView_withOptions({ behavior: DOMAPI.Smooth })
422+
element->Element.scrollIntoViewWithOptions({ behavior: DOMAPI.Smooth })
423423
```
424424
425425
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView)
426426
*/
427427
@send
428-
external scrollIntoView_withOptions: (T.t, scrollIntoViewOptions) => unit = "scrollIntoView"
428+
external scrollIntoViewWithOptions: (T.t, scrollIntoViewOptions) => unit = "scrollIntoView"
429429

430430
/**
431431
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo)

src/DOMAPI/Window.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ let response = await window->Window.fetch("https://rescript-lang.org")
303303
external fetch: (window, string, ~init: requestInit=?) => promise<response> = "fetch"
304304

305305
/**
306-
`fetch_withRequest(window, request, init)`
306+
`fetchWithRequest(window, request, init)`
307307
308308
Starts the process of fetching a resource from the network,
309309
returning a promise that is fulfilled once the response is available.
@@ -314,7 +314,7 @@ let response = await window->Window.fetch(myRequest)
314314
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/fetch)
315315
*/
316316
@send
317-
external fetch_withRequest: (window, request, ~init: requestInit=?) => promise<response> = "fetch"
317+
external fetchWithRequest: (window, request, ~init: requestInit=?) => promise<response> = "fetch"
318318

319319
/**
320320
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/requestAnimationFrame)

src/Global.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ let response = await fetch("https://rescript-lang.org")
493493
external fetch: (string, ~init: requestInit=?) => promise<response> = "fetch"
494494

495495
/**
496-
`fetch_withRequest(request, init)`
496+
`fetchWithRequest(request, init)`
497497
498498
Starts the process of fetching a resource from the network,
499499
returning a promise that is fulfilled once the response is available.
@@ -504,7 +504,7 @@ let response = await fetch(myRequest)
504504
505505
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/fetch)
506506
*/
507-
external fetch_withRequest: (request, ~init: requestInit=?) => promise<response> = "fetch"
507+
external fetchWithRequest: (request, ~init: requestInit=?) => promise<response> = "fetch"
508508

509509
/**
510510
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/requestAnimationFrame)

src/WebWorkersAPI/WorkerGlobalScope.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ let response = await self->WorkerGlobalScope.fetch("https://rescript-lang.org")
2424
external fetch: (T.t, string, ~init: requestInit=?) => promise<response> = "fetch"
2525

2626
/**
27-
`fetch_withRequest(workerGlobalScope, request, init)`
27+
`fetchWithRequest(workerGlobalScope, request, init)`
2828
2929
The fetch() method of the WorkerGlobalScope interface starts the process of fetching a resource from the network,
3030
returning a promise that is fulfilled once the response is available.
@@ -35,7 +35,7 @@ let response = await self->WorkerGlobalScope.fetch(myRequest)
3535
3636
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/fetch)
3737
*/
38-
external fetch_withRequest: (T.t, request, ~init: requestInit=?) => promise<response> = "fetch"
38+
external fetchWithRequest: (T.t, request, ~init: requestInit=?) => promise<response> = "fetch"
3939
}
4040

4141
include Impl({type t = workerGlobalScope})

tests/DOMAPI/HTMLElement__test.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ document
55
->Document.querySelector("form")
66
->Null.toOption
77
->Option.forEach(form => {
8-
form->Element.scrollIntoView_withOptions({behavior: DOMAPI.Smooth})
8+
form->Element.scrollIntoViewWithOptions({behavior: DOMAPI.Smooth})
99
})

tests/Global__test.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ let response2 = await fetch(
1515
},
1616
)
1717

18-
let response3 = await fetch_withRequest(
18+
let response3 = await fetchWithRequest(
1919
Request.fromURL("https://rescript-lang.org/"),
2020
~init={
2121
method: "POST",

0 commit comments

Comments
 (0)