Skip to content

Commit 15b4fe3

Browse files
authored
build: run dune fmt with OCamlformat 0.28 (#909)
1 parent 86a7481 commit 15b4fe3

File tree

5 files changed

+398
-304
lines changed

5 files changed

+398
-304
lines changed

.ocamlformat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = 0.27.0
1+
version = 0.28.1

ppx/reason_react_ppx.ml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ let jsxExprAndChildren ~component_type ~loc ~ctxt mapper ~keyProps children =
493493
children *)
494494
( Builder.pexp_ident ~loc { loc; txt = Ldot (ident, "jsxs") },
495495
None,
496-
Some (Binding.React.array ~loc children))
496+
Some (Binding.React.array ~loc children) )
497497
| None, (label, key) :: _ ->
498498
( Builder.pexp_ident ~loc { loc; txt = Ldot (ident, "jsxKeyed") },
499499
Some (label, key),
@@ -527,10 +527,10 @@ let jsxMapper =
527527
in
528528
let propsArg =
529529
(match childrenProp with
530-
| Some childrenProp -> (labelled "children", childrenProp) :: otherProps
531-
| None -> otherProps)
530+
| Some childrenProp -> (labelled "children", childrenProp) :: otherProps
531+
| None -> otherProps)
532532
|> List.map (fun (label, expression) ->
533-
(label, mapper#expression ctxt expression))
533+
(label, mapper#expression ctxt expression))
534534
in
535535
let isCap str =
536536
match String.length str with
@@ -611,11 +611,11 @@ let jsxMapper =
611611
in
612612
let props =
613613
(match childrenProp with
614-
| Some childrenProp ->
615-
(labelled "children", childrenProp) :: nonChildrenProps
616-
| None -> nonChildrenProps)
614+
| Some childrenProp ->
615+
(labelled "children", childrenProp) :: nonChildrenProps
616+
| None -> nonChildrenProps)
617617
|> List.map (fun (label, expression) ->
618-
(label, mapper#expression ctxt expression))
618+
(label, mapper#expression ctxt expression))
619619
in
620620
let component = (nolabel, componentNameExpr)
621621
and props =

src/ReactDOM.re

Lines changed: 50 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -484,30 +484,35 @@ module Experimental = {
484484
external preloadOptions:
485485
(
486486
~_as: [
487-
| `audio
488-
| `document
489-
| `embed
490-
| `fetch
491-
| `font
492-
| `image
493-
| [@mel.as "object"] `object_
494-
| `script
495-
| `style
496-
| `track
497-
| `video
498-
| `worker
499-
],
500-
~fetchPriority: [ | `auto | `high | `low]=?,
501-
~referrerPolicy: [
502-
| [@mel.as "no-referrer"] `noReferrer
503-
| [@mel.as "no-referrer-when-downgrade"]
504-
`noReferrerWhenDowngrade
505-
| [@mel.as "origin"] `origin
506-
| [@mel.as "origin-when-cross-origin"]
507-
`originWhenCrossOrigin
508-
| [@mel.as "unsafe-url"] `unsafeUrl
509-
]
510-
=?,
487+
| `audio
488+
| `document
489+
| `embed
490+
| `fetch
491+
| `font
492+
| `image
493+
| [@mel.as "object"] `object_
494+
| `script
495+
| `style
496+
| `track
497+
| `video
498+
| `worker
499+
],
500+
~fetchPriority:
501+
[
502+
| `auto
503+
| `high
504+
| `low
505+
]
506+
=?,
507+
~referrerPolicy:
508+
[
509+
| [@mel.as "no-referrer"] `noReferrer
510+
| [@mel.as "no-referrer-when-downgrade"] `noReferrerWhenDowngrade
511+
| [@mel.as "origin"] `origin
512+
| [@mel.as "origin-when-cross-origin"] `originWhenCrossOrigin
513+
| [@mel.as "unsafe-url"] `unsafeUrl
514+
]
515+
=?,
511516
~imageSrcSet: string=?,
512517
~imageSizes: string=?,
513518
~crossOrigin: string=?,
@@ -520,11 +525,29 @@ module Experimental = {
520525
[@deriving jsProperties]
521526
type preinitOptions = {
522527
[@mel.as "as"]
523-
_as: [ | `script | `style],
528+
_as: [
529+
| `script
530+
| `style
531+
],
524532
[@mel.optional]
525-
fetchPriority: option([ | `auto | `high | `low]),
533+
fetchPriority:
534+
option(
535+
[
536+
| `auto
537+
| `high
538+
| `low
539+
],
540+
),
526541
[@mel.optional]
527-
precedence: option([ | `reset | `low | `medium | `high]),
542+
precedence:
543+
option(
544+
[
545+
| `reset
546+
| `low
547+
| `medium
548+
| `high
549+
],
550+
),
528551
[@mel.optional]
529552
crossOrigin: option(string),
530553
[@mel.optional]

src/ReactDOM.rei

Lines changed: 51 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -490,42 +490,47 @@ module Experimental: {
490490
type preloadOptions;
491491

492492
[@mel.obj]
493+
/* Its possible values are audio, document, embed, fetch, font, image, object, script, style, track, video, worker. */
493494
external preloadOptions:
494-
/* Its possible values are audio, document, embed, fetch, font, image, object, script, style, track, video, worker. */
495495
(
496496
~_as: [
497-
| `audio
498-
| `document
499-
| `embed
500-
| `fetch
501-
| `font
502-
| `image
503-
| [@mel.as "object"] `object_
504-
| `script
505-
| `style
506-
| `track
507-
| `video
508-
| `worker
509-
],
497+
| `audio
498+
| `document
499+
| `embed
500+
| `fetch
501+
| `font
502+
| `image
503+
| [@mel.as "object"] `object_
504+
| `script
505+
| `style
506+
| `track
507+
| `video
508+
| `worker
509+
],
510510
/*
511511
Suggests a relative priority for fetching the resource.
512512
The possible values are auto (the default), high, and low.
513513
*/
514-
~fetchPriority: [ | `auto | `high | `low]=?,
514+
~fetchPriority:
515+
[
516+
| `auto
517+
| `high
518+
| `low
519+
]
520+
=?,
515521
/*
516522
The Referrer header to send when fetching.
517523
Its possible values are no-referrer-when-downgrade (the default), no-referrer, origin, origin-when-cross-origin, and unsafe-url.
518524
*/
519-
~referrerPolicy: [
520-
| [@mel.as "no-referrer"] `noReferrer
521-
| [@mel.as "no-referrer-when-downgrade"]
522-
`noReferrerWhenDowngrade
523-
| [@mel.as "origin"] `origin
524-
| [@mel.as "origin-when-cross-origin"]
525-
`originWhenCrossOrigin
526-
| [@mel.as "unsafe-url"] `unsafeUrl
527-
]
528-
=?,
525+
~referrerPolicy:
526+
[
527+
| [@mel.as "no-referrer"] `noReferrer
528+
| [@mel.as "no-referrer-when-downgrade"] `noReferrerWhenDowngrade
529+
| [@mel.as "origin"] `origin
530+
| [@mel.as "origin-when-cross-origin"] `originWhenCrossOrigin
531+
| [@mel.as "unsafe-url"] `unsafeUrl
532+
]
533+
=?,
529534
/*
530535
For use only with as: "image". Specifies the source set of the image.
531536
https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images
@@ -563,20 +568,38 @@ module Experimental: {
563568
type preinitOptions = {
564569
/* possible values: "script" or "style" */
565570
[@mel.as "as"]
566-
_as: [ | `script | `style],
571+
_as: [
572+
| `script
573+
| `style
574+
],
567575
/*
568576
Suggests a relative priority for fetching the resource.
569577
The possible values are auto (the default), high, and low.
570578
*/
571579
[@mel.optional]
572-
fetchPriority: option([ | `auto | `high | `low]),
580+
fetchPriority:
581+
option(
582+
[
583+
| `auto
584+
| `high
585+
| `low
586+
],
587+
),
573588
/*
574589
Required with Stylesheets (`style). Says where to insert the stylesheet relative to others.
575590
Stylesheets with higher precedence can override those with lower precedence.
576591
The possible values are reset, low, medium, high.
577592
*/
578593
[@mel.optional]
579-
precedence: option([ | `reset | `low | `medium | `high]),
594+
precedence:
595+
option(
596+
[
597+
| `reset
598+
| `low
599+
| `medium
600+
| `high
601+
],
602+
),
580603
/*
581604
a required string. It must be "anonymous", "use-credentials", and "".
582605
https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin

0 commit comments

Comments
 (0)