Skip to content

Commit

Permalink
Upgrade to OCaml 5.2 (#518)
Browse files Browse the repository at this point in the history
* Add depext for @emotion/css >= 11.0.0

* Upgrade to ocaml 5.2

And fix tests that were broken by reason 3.13 refmt
  • Loading branch information
feihong authored Oct 30, 2024
1 parent f4005c1 commit ecac8ed
Show file tree
Hide file tree
Showing 25 changed files with 99 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
matrix:
os: [ubuntu-20.04, macos-latest] # Missing windows-latest
ocaml-compiler:
- 5.1.1
- 5.2.0

runs-on: ${{ matrix.os }}

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ setup-githooks: ## Setup githooks

.PHONY: create-switch
create-switch: ## Create opam switch
opam switch create . 5.1.1 --deps-only --with-test --no-install
opam switch create . 5.2.0 --deps-only --with-test --no-install

.PHONY: install
install: ## Install project dependencies
Expand Down
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
(description
"styled-ppx is the ppx that brings styled components to ReScript and Melange, allowing you to create React Components with type-safe style definitions using CSS.")
(depends
(ocaml (>= 5.1.0))
(ocaml (>= 5.2.0))
(reason (>= 3.11.0))
(menhir (>= 20220210))
(ppx_deriving (>= 5.0))
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 13 additions & 3 deletions packages/css-property-parser/test/snapshots/Spec.expected.re
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,19 @@ module Types = {
| `Rad(number)
| `Turn(number)
]
and time = [ | `Ms(float) | `S(float)]
and frequency = [ | `Hz(float) | `KHz(float)]
and resolution = [ | `Dpi(float) | `Dpcm(float) | `Dppx(float)]
and time = [
| `Ms(float)
| `S(float)
]
and frequency = [
| `Hz(float)
| `KHz(float)
]
and resolution = [
| `Dpi(float)
| `Dpcm(float)
| `Dppx(float)
]
and percentage = float
and ident = string
and custom_ident = string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,10 @@
let make = (props: makeProps('var)) => {
let className =
styles(~var=varGet(props), ()) ++ getOrEmpty(classNameGet(props));
let stylesObject = {"className": className, "ref": innerRefGet(props)};
let stylesObject = {
"className": className,
"ref": innerRefGet(props),
};
let newProps = assign2(Js.Obj.empty(), Obj.magic(props), stylesObject);
ignore(deleteProp(. newProps, "var"));
ignore(deleteProp(. newProps, "innerRef"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,10 @@
let make = (props: makeProps('var)) => {
let className =
styles(~var=varGet(props), ()) ++ getOrEmpty(classNameGet(props));
let stylesObject = {"className": className, "ref": innerRefGet(props)};
let stylesObject = {
"className": className,
"ref": innerRefGet(props),
};
let newProps = assign2(Js.Obj.empty(), Obj.magic(props), stylesObject);
ignore(deleteProp(. newProps, "var"));
ignore(deleteProp(. newProps, "innerRef"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,10 @@
let make = (props: makeProps('var)) => {
let className =
styles(~var=?varGet(props), ()) ++ getOrEmpty(classNameGet(props));
let stylesObject = {"className": className, "ref": innerRefGet(props)};
let stylesObject = {
"className": className,
"ref": innerRefGet(props),
};
let newProps = assign2(Js.Obj.empty(), Obj.magic(props), stylesObject);
ignore(deleteProp(. newProps, "var"));
ignore(deleteProp(. newProps, "innerRef"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,10 @@
let make = (props: makeProps('var)) => {
let className =
styles(~var=varGet(props), ()) ++ getOrEmpty(classNameGet(props));
let stylesObject = {"className": className, "ref": innerRefGet(props)};
let stylesObject = {
"className": className,
"ref": innerRefGet(props),
};
let newProps = assign2(Js.Obj.empty(), Obj.magic(props), stylesObject);
ignore(deleteProp(. newProps, "var"));
ignore(deleteProp(. newProps, "innerRef"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,10 @@
let make = (props: makeProps('size)) => {
let className =
styles(~size=sizeGet(props), ()) ++ getOrEmpty(classNameGet(props));
let stylesObject = {"className": className, "ref": innerRefGet(props)};
let stylesObject = {
"className": className,
"ref": innerRefGet(props),
};
let newProps = assign2(Js.Obj.empty(), Obj.magic(props), stylesObject);
ignore(deleteProp(. newProps, "size"));
ignore(deleteProp(. newProps, "innerRef"));
Expand Down Expand Up @@ -1957,7 +1960,10 @@
let className =
styles(~variant=variantGet(props), ())
++ getOrEmpty(classNameGet(props));
let stylesObject = {"className": className, "ref": innerRefGet(props)};
let stylesObject = {
"className": className,
"ref": innerRefGet(props),
};
let newProps = assign2(Js.Obj.empty(), Obj.magic(props), stylesObject);
ignore(deleteProp(. newProps, "variant"));
ignore(deleteProp(. newProps, "innerRef"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,10 @@
let className =
styles(~color=colorGet(props), ~size=sizeGet(props), ())
++ getOrEmpty(classNameGet(props));
let stylesObject = {"className": className, "ref": innerRefGet(props)};
let stylesObject = {
"className": className,
"ref": innerRefGet(props),
};
let newProps = assign2(Js.Obj.empty(), Obj.magic(props), stylesObject);
ignore(deleteProp(. newProps, "color"));
ignore(deleteProp(. newProps, "size"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,10 @@
let make = (props: makeProps('a)) => {
let className =
styles(~a=aGet(props), ()) ++ getOrEmpty(classNameGet(props));
let stylesObject = {"className": className, "ref": innerRefGet(props)};
let stylesObject = {
"className": className,
"ref": innerRefGet(props),
};
let newProps = assign2(Js.Obj.empty(), Obj.magic(props), stylesObject);
ignore(deleteProp(. newProps, "a"));
ignore(deleteProp(. newProps, "innerRef"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,10 @@
let make = (props: makeProps('color)) => {
let className =
styles(~color=colorGet(props), ()) ++ getOrEmpty(classNameGet(props));
let stylesObject = {"className": className, "ref": innerRefGet(props)};
let stylesObject = {
"className": className,
"ref": innerRefGet(props),
};
let newProps = assign2(Js.Obj.empty(), Obj.magic(props), stylesObject);
ignore(deleteProp(. newProps, "color"));
ignore(deleteProp(. newProps, "innerRef"));
Expand Down
5 changes: 4 additions & 1 deletion packages/ppx/test/snapshot/reason/reason-dynamic.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,10 @@
let className =
styles(~id=idGet(props), ~var=varGet(props), ())
++ getOrEmpty(classNameGet(props));
let stylesObject = {"className": className, "ref": innerRefGet(props)};
let stylesObject = {
"className": className,
"ref": innerRefGet(props),
};
let newProps = assign2(Js.Obj.empty(), Obj.magic(props), stylesObject);
ignore(deleteProp(. newProps, "id"));
ignore(deleteProp(. newProps, "var"));
Expand Down
5 changes: 4 additions & 1 deletion packages/ppx/test/snapshot/reason/reason-keyframes.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,10 @@
CSS.style([|CSS.label("FadeIn"), CSS.animationName(animation)|]);
let make = (props: makeProps) => {
let className = styles ++ getOrEmpty(classNameGet(props));
let stylesObject = {"className": className, "ref": innerRefGet(props)};
let stylesObject = {
"className": className,
"ref": innerRefGet(props),
};
let newProps = assign2(Js.Obj.empty(), Obj.magic(props), stylesObject);
ignore(deleteProp(. newProps, "innerRef"));
let asTag = as_Get(props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,10 @@
|]);
let make = (props: makeProps) => {
let className = styles ++ getOrEmpty(classNameGet(props));
let stylesObject = {"className": className, "ref": innerRefGet(props)};
let stylesObject = {
"className": className,
"ref": innerRefGet(props),
};
let newProps = assign2(Js.Obj.empty(), Obj.magic(props), stylesObject);
ignore(deleteProp(. newProps, "innerRef"));
let asTag = as_Get(props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,10 @@
|]);
let make = (props: makeProps) => {
let className = styles ++ getOrEmpty(classNameGet(props));
let stylesObject = {"className": className, "ref": innerRefGet(props)};
let stylesObject = {
"className": className,
"ref": innerRefGet(props),
};
let newProps = assign2(Js.Obj.empty(), Obj.magic(props), stylesObject);
ignore(deleteProp(. newProps, "innerRef"));
let asTag = as_Get(props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,10 @@
|]);
let make = (props: makeProps) => {
let className = styles ++ getOrEmpty(classNameGet(props));
let stylesObject = {"className": className, "ref": innerRefGet(props)};
let stylesObject = {
"className": className,
"ref": innerRefGet(props),
};
let newProps = assign2(Js.Obj.empty(), Obj.magic(props), stylesObject);
ignore(deleteProp(. newProps, "innerRef"));
let asTag = as_Get(props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,10 @@
|]);
let make = (props: makeProps) => {
let className = styles ++ getOrEmpty(classNameGet(props));
let stylesObject = {"className": className, "ref": innerRefGet(props)};
let stylesObject = {
"className": className,
"ref": innerRefGet(props),
};
let newProps = assign2(Js.Obj.empty(), Obj.magic(props), stylesObject);
ignore(deleteProp(. newProps, "innerRef"));
let asTag = as_Get(props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,10 @@
|]);
let make = (props: makeProps) => {
let className = styles ++ getOrEmpty(classNameGet(props));
let stylesObject = {"className": className, "ref": innerRefGet(props)};
let stylesObject = {
"className": className,
"ref": innerRefGet(props),
};
let newProps = assign2(Js.Obj.empty(), Obj.magic(props), stylesObject);
ignore(deleteProp(. newProps, "innerRef"));
let asTag = as_Get(props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,10 @@
|]);
let make = (props: makeProps) => {
let className = styles ++ getOrEmpty(classNameGet(props));
let stylesObject = {"className": className, "ref": innerRefGet(props)};
let stylesObject = {
"className": className,
"ref": innerRefGet(props),
};
let newProps = assign2(Js.Obj.empty(), Obj.magic(props), stylesObject);
ignore(deleteProp(. newProps, "innerRef"));
let asTag = as_Get(props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,10 @@
|]);
let make = (props: makeProps) => {
let className = styles ++ getOrEmpty(classNameGet(props));
let stylesObject = {"className": className, "ref": innerRefGet(props)};
let stylesObject = {
"className": className,
"ref": innerRefGet(props),
};
let newProps = assign2(Js.Obj.empty(), Obj.magic(props), stylesObject);
ignore(deleteProp(. newProps, "innerRef"));
let asTag = as_Get(props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,10 @@
CSS.style([|CSS.label("OneSingleProperty"), CSS.display(`block)|]);
let make = (props: makeProps) => {
let className = styles ++ getOrEmpty(classNameGet(props));
let stylesObject = {"className": className, "ref": innerRefGet(props)};
let stylesObject = {
"className": className,
"ref": innerRefGet(props),
};
let newProps = assign2(Js.Obj.empty(), Obj.magic(props), stylesObject);
ignore(deleteProp(. newProps, "innerRef"));
let asTag = as_Get(props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,10 @@
let styles = CSS.style([|CSS.label("SelfClosingElement")|]);
let make = (props: makeProps) => {
let className = styles ++ getOrEmpty(classNameGet(props));
let stylesObject = {"className": className, "ref": innerRefGet(props)};
let stylesObject = {
"className": className,
"ref": innerRefGet(props),
};
let newProps = assign2(Js.Obj.empty(), Obj.magic(props), stylesObject);
ignore(deleteProp(. newProps, "innerRef"));
let asTag = as_Get(props);
Expand Down
2 changes: 1 addition & 1 deletion styled-ppx.opam
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ homepage: "https://styled-ppx.vercel.app"
bug-reports: "https://github.com/davesnx/styled-ppx/issues"
depends: [
"dune" {>= "3.8"}
"ocaml" {>= "5.1.0"}
"ocaml" {>= "5.2.0"}
"reason" {>= "3.11.0"}
"menhir" {>= "20220210"}
"ppx_deriving" {>= "5.0"}
Expand Down

0 comments on commit ecac8ed

Please sign in to comment.