Skip to content

Commit e788dce

Browse files
committed
Remove uses of @bs.send.pipe in tests.
1 parent c47ae6a commit e788dce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+4
-2184
lines changed

jscomp/syntax/tests/conversion/reason/attributes.res

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,5 @@ list{1, 2, 3}->map(a => a + 1)->filter(a => modulo(a, 2) == 0)->Js.log
1616

1717
type t
1818
@new external make: unit => t = "DOMParser"
19-
@bs.send.pipe(: t)
20-
external parseHtmlFromString: (string, @as("text/html") _) => Dom.htmlDocument = "parseFromString"
2119

2220
Js.log(make() |> parseHtmlFromString("sdsd"))

jscomp/syntax/tests/conversion/reason/expected/attributes.res.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,5 @@ list{1, 2, 3}->map(a => a + 1)->filter(a => modulo(a, 2) == 0)->Js.log
1616

1717
type t
1818
@new external make: unit => t = "DOMParser"
19-
@bs.send.pipe(: t)
20-
external parseHtmlFromString: (string, @as("text/html") _) => Dom.htmlDocument = "parseFromString"
2119

2220
Js.log(make() |> parseHtmlFromString("sdsd"))

jscomp/syntax/tests/idempotency/bs-webapi/src/Webapi/Webapi__Canvas/Webapi__Canvas__Canvas2d.res

Lines changed: 0 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,8 @@ type rec style<_> =
7777
| Gradient: style<gradient>
7878
| Pattern: style<pattern>
7979

80-
/* 2d Canvas API, following https://simon.html5.org/dump/html5-canvas-cheat-sheet.html */
81-
@bs.send.pipe(: t) external save: unit = ""
82-
@bs.send.pipe(: t) external restore: unit = ""
8380

8481
/* Transformation */
85-
@bs.send.pipe(: t) external scale: (~x: float, ~y: float) => unit = ""
86-
@bs.send.pipe(: t) external rotate: float => unit = ""
87-
@bs.send.pipe(: t) external translate: (~x: float, ~y: float) => unit = ""
88-
@bs.send.pipe(: t)
8982
external transform: (
9083
~m11: float,
9184
~m12: float,
@@ -94,15 +87,6 @@ external transform: (
9487
~dx: float,
9588
~dy: float,
9689
) => unit = ""
97-
@bs.send.pipe(: t)
98-
external setTransform: (
99-
~m11: float,
100-
~m12: float,
101-
~m21: float,
102-
~m22: float,
103-
~dx: float,
104-
~dy: float,
105-
) => unit = ""
10690

10791
/* Compositing */
10892
@set external globalAlpha: (t, float) => unit = ""
@@ -167,79 +151,14 @@ let strokeStyle = (ctx: t) => ctx |> strokeStyle |> reifyStyle
167151
@set external shadowColor: (t, string) => unit = ""
168152

169153
/* Gradients */
170-
@bs.send.pipe(: t)
171-
external createLinearGradient: (~x0: float, ~y0: float, ~x1: float, ~y1: float) => gradient = ""
172-
@bs.send.pipe(: t)
173-
external createRadialGradient: (
174-
~x0: float,
175-
~y0: float,
176-
~x1: float,
177-
~y1: float,
178-
~r0: float,
179-
~r1: float,
180-
) => gradient = ""
181-
@bs.send.pipe(: gradient) external addColorStop: (float, string) => unit = ""
182-
@val
183-
external createPattern: (
184-
t,
185-
Dom.element,
186-
@string
187-
[
188-
| #repeat
189-
| @as("repeat-x") #repeatX
190-
| @as("repeat-y") #repeatY
191-
| @as("no-repeat") #noRepeat
192-
],
193-
) => pattern = ""
194-
195-
/* Paths */
196-
@bs.send.pipe(: t) external beginPath: unit = ""
197-
@bs.send.pipe(: t) external closePath: unit = ""
198-
@bs.send.pipe(: t) external fill: unit = ""
199-
@bs.send.pipe(: t) external stroke: unit = ""
200-
@bs.send.pipe(: t) external clip: unit = ""
201-
@bs.send.pipe(: t) external moveTo: (~x: float, ~y: float) => unit = ""
202-
@bs.send.pipe(: t) external lineTo: (~x: float, ~y: float) => unit = ""
203-
@bs.send.pipe(: t)
204-
external quadraticCurveTo: (~cp1x: float, ~cp1y: float, ~x: float, ~y: float) => unit = ""
205-
@bs.send.pipe(: t)
206-
external bezierCurveTo: (
207-
~cp1x: float,
208-
~cp1y: float,
209-
~cp2x: float,
210-
~cp2y: float,
211-
~x: float,
212-
~y: float,
213-
) => unit = ""
214-
@bs.send.pipe(: t)
215-
external arcTo: (~x1: float, ~y1: float, ~x2: float, ~y2: float, ~r: float) => unit = ""
216-
@bs.send.pipe(: t)
217-
external arc: (
218-
~x: float,
219-
~y: float,
220-
~r: float,
221-
~startAngle: float,
222-
~endAngle: float,
223-
~anticw: bool,
224-
) => unit = ""
225-
@bs.send.pipe(: t) external rect: (~x: float, ~y: float, ~w: float, ~h: float) => unit = ""
226-
@bs.send.pipe(: t) external isPointInPath: (~x: float, ~y: float) => bool = ""
227154

228155
/* Text */
229156
@set external font: (t, string) => unit = ""
230157
@set external textAlign: (t, string) => unit = ""
231158
@set external textBaseline: (t, string) => unit = ""
232-
@bs.send.pipe(: t)
233-
external fillText: (string, ~x: float, ~y: float, ~maxWidth: float=?) => unit = ""
234-
@bs.send.pipe(: t)
235-
external strokeText: (string, ~x: float, ~y: float, ~maxWidth: float=?) => unit = ""
236-
@bs.send.pipe(: t) external measureText: string => measureText = ""
237159
@get external width: measureText => float = ""
238160

239161
/* Rectangles */
240-
@bs.send.pipe(: t) external fillRect: (~x: float, ~y: float, ~w: float, ~h: float) => unit = ""
241-
@bs.send.pipe(: t) external strokeRect: (~x: float, ~y: float, ~w: float, ~h: float) => unit = ""
242-
@bs.send.pipe(: t) external clearRect: (~x: float, ~y: float, ~w: float, ~h: float) => unit = ""
243162

244163
@send
245164
external createImageDataCoords: (t, ~width: float, ~height: float) => Webapi__Dom__Image.t =

jscomp/syntax/tests/idempotency/bs-webapi/src/Webapi/Webapi__Dom/Webapi__Dom__CharacterData.res

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ module Impl = (
66
@get external data: T.t => string = ""
77
@get external length: T.t => int = ""
88

9-
@bs.send.pipe(: T.t) external substringData: (~offset: int, ~count: int) => string = ""
10-
@bs.send.pipe(: T.t) external appendData: string => unit = ""
11-
@bs.send.pipe(: T.t) external insertData: (~offset: int, string) => unit = ""
12-
@bs.send.pipe(: T.t) external deleteData: (~offset: int, ~count: int) => unit = ""
13-
@bs.send.pipe(: T.t) external replaceData: (~offset: int, ~count: int, string) => unit = ""
149
}
1510

1611
type t = Dom.characterData

jscomp/syntax/tests/idempotency/bs-webapi/src/Webapi/Webapi__Dom/Webapi__Dom__ChildNode.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ module Impl = (
44
type t
55
},
66
) => {
7-
@bs.send.pipe(: T.t) external remove: unit = ""
7+
external remove: unit = ""
88
}

jscomp/syntax/tests/idempotency/bs-webapi/src/Webapi/Webapi__Dom/Webapi__Dom__CssStyleDeclaration.res

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ type cssRule /* TODO: Move to Webapi__Dom */
66
@get external length: t => int = ""
77
@get external parentRule: t => cssRule = ""
88

9-
@bs.send.pipe(: t) external getPropertyPriority: string => string = ""
10-
@bs.send.pipe(: t) external getPropertyValue: string => string = ""
11-
@bs.send.pipe(: t) external item: int => string = ""
12-
@bs.send.pipe(: t) external removeProperty: string => string = ""
13-
@bs.send.pipe(: t) external setProperty: (string, string, string) => unit = ""
14-
/* [@@bs.send.pipe : t] external setPropertyValue : (string, string) => unit = ""; */ /* not mentioned by MDN and not implemented by chrome, but in the CSSOM spec: https://drafts.csswg.org/cssom/#the-cssstyledeclaration-interface */
159

1610
/* CSS2Properties */
1711
@get external azimuth: t => string = ""

jscomp/syntax/tests/idempotency/bs-webapi/src/Webapi/Webapi__Dom/Webapi__Dom__Document.res

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -43,68 +43,6 @@ module Impl = (
4343
let visibilityState: T.t => Webapi__Dom__Types.visibilityState = self =>
4444
Webapi__Dom__Types.decodeVisibilityState(visibilityState(self))
4545

46-
@bs.send.pipe(: T.t) external adoptNode: Dom.element_like<'a> => Dom.element_like<'a> = ""
47-
@bs.send.pipe(: T.t) external createAttribute: string => Dom.attr = ""
48-
@bs.send.pipe(: T.t) external createAttributeNS: (string, string) => Dom.attr = ""
49-
@bs.send.pipe(: T.t) external createComment: string => Dom.comment = ""
50-
@bs.send.pipe(: T.t) external createDocumentFragment: Dom.documentFragment = ""
51-
@bs.send.pipe(: T.t) external createElement: string => Dom.element = ""
52-
@bs.send.pipe(: T.t)
53-
external createElementWithOptions: (string, {..}) => Dom.element =
54-
"createElement" /* not widely supported */
55-
@bs.send.pipe(: T.t) external createElementNS: (string, string) => Dom.element = ""
56-
@bs.send.pipe(: T.t)
57-
external createElementNSWithOptions: (string, string, {..}) => Dom.element =
58-
"createElementNS" /* not widely supported */
59-
@bs.send.pipe(: T.t)
60-
external createEvent: string /* large enum */ => Dom.event =
61-
"" /* discouraged (but not deprecated) in favor of Event constructors */
62-
@bs.send.pipe(: T.t) external createNodeIterator: Dom.node_like<'a> => Dom.nodeIterator = ""
63-
@bs.send.pipe(: T.t)
64-
external createNodeIteratorWithWhatToShow: (
65-
Dom.node_like<'a>,
66-
Webapi__Dom__Types.WhatToShow.t,
67-
) => Dom.nodeIterator = "createNodeIterator"
68-
@bs.send.pipe(: T.t)
69-
external createNodeIteratorWithWhatToShowFilter: (
70-
Dom.node_like<'a>,
71-
Webapi__Dom__Types.WhatToShow.t,
72-
Dom.nodeFilter,
73-
) => Dom.nodeIterator = "createNodeIterator" /* createProcessingInstruction */
74-
@bs.send.pipe(: T.t) external createRange: Dom.range = ""
75-
@bs.send.pipe(: T.t) external createTextNode: string => Dom.text = ""
76-
@bs.send.pipe(: T.t) external createTreeWalker: Dom.element_like<'a> => Dom.treeWalker = ""
77-
@bs.send.pipe(: T.t)
78-
external createTreeWalkerWithWhatToShow: (
79-
Dom.element_like<'a>,
80-
Webapi__Dom__Types.WhatToShow.t,
81-
) => Dom.treeWalker = "createTreeWalker"
82-
@bs.send.pipe(: T.t)
83-
external createTreeWalkerWithWhatToShowFilter: (
84-
Dom.element_like<'a>,
85-
Webapi__Dom__Types.WhatToShow.t,
86-
Dom.nodeFilter,
87-
) => Dom.treeWalker = "createTreeWalker"
88-
@bs.send.pipe(: T.t)
89-
external elementFromPoint: (int, int) => Dom.element = "" /* experimental, but widely supported */
90-
@bs.send.pipe(: T.t)
91-
external elementsFromPoint: (int, int) => array<Dom.element> = "" /* experimental */
92-
@bs.send.pipe(: T.t) external enableStyleSheetsForSet: string => unit = ""
93-
@bs.send.pipe(: T.t) external exitPointerLock: unit = "" /* experimental */
94-
@bs.send.pipe(: T.t) external getAnimations: array<Dom.animation> = "" /* experimental */
95-
@bs.send.pipe(: T.t) external getElementsByClassName: string => Dom.htmlCollection = ""
96-
@bs.send.pipe(: T.t) external getElementsByTagName: string => Dom.htmlCollection = ""
97-
@bs.send.pipe(: T.t) external getElementsByTagNameNS: (string, string) => Dom.htmlCollection = ""
98-
@bs.send.pipe(: T.t) external importNode: Dom.element_like<'a> => Dom.element_like<'a> = ""
99-
@bs.send.pipe(: T.t)
100-
external importNodeDeep: (Dom.element_like<'a>, @as(json`true`) _) => Dom.element_like<'a> =
101-
"importNode"
102-
@bs.send.pipe(: T.t)
103-
external registerElement: (string, unit) => Dom.element =
104-
"" /* experimental and deprecated in favor of customElements.define() */
105-
@bs.send.pipe(: T.t)
106-
external registerElementWithOptions: (string, {..}, unit) => Dom.element =
107-
"registerElement" /* experimental and deprecated in favor of customElements.define() */
10846

10947
@@ocaml.doc(
11048
" XPath stuff "
Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,4 @@
11
type t = Dom.domImplementation
22

3-
@bs.send.pipe(: t)
4-
external createDocumentType: (
5-
~qualifiedName: string,
6-
~publicId: string,
7-
~systemId: string,
8-
) => Dom.documentType = ""
9-
@bs.send.pipe(: t)
10-
external createDocument: (Js.null<string>, string, Js.null<Dom.documentType>) => Dom.xmlDocument =
11-
""
12-
let createDocument = (
13-
~namespace: option<string>=?,
14-
~qualifiedName: string,
15-
~docType: option<Dom.documentType>=?,
16-
) => createDocument(Js.Null.fromOption(namespace), qualifiedName, Js.Null.fromOption(docType))
17-
@bs.send.pipe(: t) external createHTMLDocument: Dom.htmlDocument = ""
18-
@bs.send.pipe(: t)
19-
external createHTMLDocumentWithTitle: string => Dom.htmlDocument = "createHTMLDocument"
20-
@bs.send.pipe(: t)
213
external hasFeature: bool =
224
"" /* useless; always returns true (this is exact wording from the actual spec) */

jscomp/syntax/tests/idempotency/bs-webapi/src/Webapi/Webapi__Dom/Webapi__Dom__DomTokenList.res

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,6 @@ type t = Dom.domTokenList
22

33
@get external length: t => int = ""
44

5-
@bs.send.pipe(: t) @return(nullable) external item: int => option<string> = ""
6-
@bs.send.pipe(: t) external add: string => unit = ""
7-
@bs.send.pipe(: t) @variadic external addMany: array<string> => unit = "add"
8-
@bs.send.pipe(: t) external contains: string => bool = "contains"
9-
/* entries: iterator API, should have language support */
10-
@bs.send.pipe(: t) external forEach: ((string, int) => unit) => unit = ""
11-
/* keys: iterator API, should have language support */
12-
@bs.send.pipe(: t) external remove: string => unit = ""
13-
@bs.send.pipe(: t) @variadic external removeMany: array<string> => unit = "remove"
14-
@bs.send.pipe(: t) external replace: (string, string) => unit = "" /* experimental */
15-
@bs.send.pipe(: t)
16-
external supports: string => bool = "" /* experimental, Content Management Level 1 */
17-
@bs.send.pipe(: t) external toggle: string => bool = ""
18-
@bs.send.pipe(: t) external toggleForced: (string, @as(json`true`) _) => bool = "toggle"
19-
@bs.send.pipe(: t) external toString: string = ""
20-
/* values: iterator API, should have language support */
21-
225
@get
236
external value: t => string = "" /* experimental, from being merged with domSettableTokenList */
247
@set

jscomp/syntax/tests/idempotency/bs-webapi/src/Webapi/Webapi__Dom/Webapi__Dom__Element.res

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -50,81 +50,22 @@ module Impl = (
5050
@set external setSlot: (T.t, string) => unit = "slot" /* experimental */
5151
@get external tagName: T.t => string = ""
5252

53-
@bs.send.pipe(: T.t)
54-
external attachShadow: {"mode": string} => Dom.shadowRoot = "" /* experimental */
55-
@bs.send.pipe(: T.t)
56-
external attachShadowOpen: @as(json`{ "mode": "open" }`) _ => Dom.shadowRoot =
57-
"attachShadow" /* experimental */
58-
@bs.send.pipe(: T.t)
59-
external attachShadowClosed: @as(json`{ "mode": "closed" }`) _ => Dom.shadowRoot =
60-
"attachShadow" /* experimental */
61-
@bs.send.pipe(: T.t) external animate: ({..}, {..}) => Dom.animation = "" /* experimental */
62-
@bs.send.pipe(: T.t) @return(nullable)
63-
external closest: string => option<Dom.element> = "" /* experimental */
64-
@bs.send.pipe(: T.t)
65-
external createShadowRoot: Dom.shadowRoot = "" /* experimental AND deprecated (?!) */
66-
@bs.send.pipe(: T.t) @return(nullable) external getAttribute: string => option<string> = ""
67-
@bs.send.pipe(: T.t) @return(nullable)
68-
external getAttributeNS: (string, string) => option<string> = ""
69-
@bs.send.pipe(: T.t) external getBoundingClientRect: Dom.domRect = ""
70-
@bs.send.pipe(: T.t) external getClientRects: array<Dom.domRect> = ""
71-
@bs.send.pipe(: T.t) external getElementsByClassName: string => Dom.htmlCollection = ""
72-
@bs.send.pipe(: T.t) external getElementsByTagName: string => Dom.htmlCollection = ""
73-
@bs.send.pipe(: T.t) external getElementsByTagNameNS: (string, string) => Dom.htmlCollection = ""
74-
@bs.send.pipe(: T.t) external hasAttribute: string => bool = ""
75-
@bs.send.pipe(: T.t) external hasAttributeNS: (string, string) => bool = ""
76-
@bs.send.pipe(: T.t) external hasAttributes: bool = ""
77-
@bs.send.pipe(: T.t)
78-
external insertAdjacentElement: (string /* insertPosition enum */, Dom.element_like<'a>) => unit =
79-
"" /* experimental, but widely supported */
8053
let insertAdjacentElement: (
8154
Webapi__Dom__Types.insertPosition,
8255
Dom.element_like<'a>,
8356
T.t,
8457
) => unit = (position, element, self) =>
8558
insertAdjacentElement(Webapi__Dom__Types.encodeInsertPosition(position), element, self)
86-
@bs.send.pipe(: T.t)
87-
external insertAdjacentHTML: (string /* insertPosition enum */, string) => unit =
88-
"" /* experimental, but widely supported */
8959
let insertAdjacentHTML: (Webapi__Dom__Types.insertPosition, string, T.t) => unit = (
9060
position,
9161
text,
9262
self,
9363
) => insertAdjacentHTML(Webapi__Dom__Types.encodeInsertPosition(position), text, self)
94-
@bs.send.pipe(: T.t)
95-
external insertAdjacentText: (string /* insertPosition enum */, string) => unit =
96-
"" /* experimental, but widely supported */
9764
let insertAdjacentText: (Webapi__Dom__Types.insertPosition, string, T.t) => unit = (
9865
position,
9966
text,
10067
self,
10168
) => insertAdjacentText(Webapi__Dom__Types.encodeInsertPosition(position), text, self)
102-
@bs.send.pipe(: T.t)
103-
external matches: string => bool = "" /* experimental, but widely supported */
104-
@bs.send.pipe(: T.t) external releasePointerCapture: Dom.eventPointerId => unit = ""
105-
@bs.send.pipe(: T.t) external removeAttribute: string => unit = ""
106-
@bs.send.pipe(: T.t) external removeAttributeNS: (string, string) => unit = ""
107-
@bs.send.pipe(: T.t) external requestFullscreen: unit = "" /* experimental */
108-
@bs.send.pipe(: T.t) external requestPointerLock: unit = "" /* experimental */
109-
@bs.send.pipe(: T.t) external scrollIntoView: unit = "" /* experimental, but widely supported */
110-
@bs.send.pipe(: T.t)
111-
external scrollIntoViewNoAlignToTop: @as(json`true`) _ => unit =
112-
"scrollIntoView" /* experimental, but widely supported */
113-
@bs.send.pipe(: T.t)
114-
external scrollIntoViewWithOptions: {"behavior": string, "block": string} => unit =
115-
"scrollIntoView" /* experimental */
116-
@bs.send.pipe(: T.t) external scrollBy: (float, float) => unit = ""
117-
@bs.send.pipe(: T.t)
118-
external scrollByWithOptions: {"top": float, "left": float, "behavior": string} => unit =
119-
"scrollBy"
120-
@bs.send.pipe(: T.t) external scrollTo: (float, float) => unit = ""
121-
@bs.send.pipe(: T.t)
122-
external scrollToWithOptions: {"top": float, "left": float, "behavior": string} => unit =
123-
"scrollTo"
124-
@bs.send.pipe(: T.t) external setAttribute: (string, string) => unit = ""
125-
@bs.send.pipe(: T.t) external setAttributeNS: (string, string, string) => unit = ""
126-
@bs.send.pipe(: T.t) external setPointerCapture: Dom.eventPointerId => unit = ""
127-
12869
/* GlobalEventHandlers interface */
12970
/* Not sure this should be exposed, since EventTarget seems like a better API */
13071

jscomp/syntax/tests/idempotency/bs-webapi/src/Webapi/Webapi__Dom/Webapi__Dom__Event.res

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ module Impl = (
1616
@get external type_: T.t => string = "type"
1717
@get external isTrusted: T.t => bool = ""
1818

19-
@bs.send.pipe(: T.t) external preventDefault: unit = ""
20-
@bs.send.pipe(: T.t) external stopImmediatePropagation: unit = ""
21-
@bs.send.pipe(: T.t) external stopPropagation: unit = ""
2219
}
2320

2421
type t = Dom.event

0 commit comments

Comments
 (0)