Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to reason-react 0.14 #18

Merged
merged 2 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,18 @@
(maintainers "Denis Strelkov <[email protected]>")
(authors "bloodyowl <[email protected]>")
(license "MIT")
(tags ("melange" "org:ahrefs"))
(tags
("melange" "org:ahrefs"))
(depends
ocaml
(melange
(>= 2.0.0))
(reason
(>= 3.10.0))
reason-react
reason-react-ppx
(reason-react
(>= 0.14.0))
(reason-react-ppx
(>= 0.14.0))
(ocaml-lsp-server :with-test)
(opam-check-npm-deps :with-test) ; todo: use with-dev-setup once opam 2.2 is out
))
1 change: 1 addition & 0 deletions example/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
(target example)
(alias example)
(libraries reshowcase reason-react)
(module_systems es6)
(preprocess
(pps melange.ppx reason-react-ppx)))
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"devDependencies": {
"concurrently": "^6.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"react": "^18.0.0",
"react-dom": "^18.0.0"
}
}
8 changes: 6 additions & 2 deletions reshowcase.opam
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ depends: [
"ocaml"
"melange" {>= "2.0.0"}
"reason" {>= "3.10.0"}
"reason-react"
"reason-react-ppx"
"reason-react" {>= "0.14.0"}
"reason-react-ppx" {>= "0.14.0"}
"ocaml-lsp-server" {with-test}
"opam-check-npm-deps" {with-test}
"odoc" {with-doc}
Expand All @@ -41,3 +41,7 @@ depexts: [
["webpack"] {npm-version = "^5.76.1"}
["webpack-dev-server"] {npm-version = "^4.11.1"}
]
pin-depends: [
[ "reason-react.dev" "git+https://github.com/reasonml/reason-react.git#6938d62b70c506eade2755d32f7c5f3aae005e8c" ]
[ "reason-react-ppx.dev" "git+https://github.com/reasonml/reason-react.git#6938d62b70c506eade2755d32f7c5f3aae005e8cd" ]
]
4 changes: 4 additions & 0 deletions reshowcase.opam.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ depexts: [
["webpack"] {npm-version = "^5.76.1"}
["webpack-dev-server"] {npm-version = "^4.11.1"}
]
pin-depends: [
[ "reason-react.dev" "git+https://github.com/reasonml/reason-react.git#6938d62b70c506eade2755d32f7c5f3aae005e8c" ]
[ "reason-react-ppx.dev" "git+https://github.com/reasonml/reason-react.git#6938d62b70c506eade2755d32f7c5f3aae005e8cd" ]
]
4 changes: 3 additions & 1 deletion src/Entry.re
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ let demo = (f): unit => {

let start = () =>
switch (ReactDOM.querySelector("#root")) {
| Some(root) => ReactDOM.render(<ReshowcaseUi.App demos=rootMap />, root)
| Some(root) =>
let root = ReactDOM.Client.createRoot(root);
ReactDOM.Client.render(root, <ReshowcaseUi.App demos=rootMap />);
| None => ()
};
28 changes: 14 additions & 14 deletions src/ReshowcaseUi.re
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ module TopPanel = {
}
}
onClick={event => {
event->ReactEvent.Mouse.preventDefault;
event->React.Event.Mouse.preventDefault;
onSetResponsiveMode(_ => Desktop);
}}>
Icon.desktop
Expand All @@ -120,7 +120,7 @@ module TopPanel = {
}
}
onClick={event => {
event->ReactEvent.Mouse.preventDefault;
event->React.Event.Mouse.preventDefault;
onSetResponsiveMode(_ => Mobile);
}}>
Icon.mobile
Expand All @@ -139,7 +139,7 @@ module TopPanel = {
}
style=Styles.squareButton
onClick={event => {
event->ReactEvent.Mouse.preventDefault;
event->React.Event.Mouse.preventDefault;
onRightSidebarToggle();
}}>
<div
Expand Down Expand Up @@ -170,11 +170,11 @@ module Link = {
href
onClick={event =>
switch (
ReactEvent.Mouse.metaKey(event),
ReactEvent.Mouse.ctrlKey(event),
React.Event.Mouse.metaKey(event),
React.Event.Mouse.ctrlKey(event),
) {
| (false, false) =>
ReactEvent.Mouse.preventDefault(event);
React.Event.Mouse.preventDefault(event);
ReasonReactRouter.push(href);
| _ => ()
}
Expand Down Expand Up @@ -432,7 +432,7 @@ module DemoListSidebar = {
)}
title="Toggle default collapsed categories"
onClick={event => {
event->ReactEvent.Mouse.preventDefault;
event->React.Event.Mouse.preventDefault;
onToggleCollapsedCategoriesByDefault();
}}>
{if (isCategoriesCollapsedByDefault) {Icon.categoryCollapsed} else {
Expand All @@ -442,7 +442,7 @@ module DemoListSidebar = {
<SearchInput
value={filterValue->(Option.getWithDefault(""))}
onChange={event => {
let value = event->ReactEvent.Form.target##value;
let value = event->React.Event.Form.target##value;

setFilterValue(_ =>
if (value->Js.String2.trim == "") {
Expand Down Expand Up @@ -574,15 +574,15 @@ module DemoUnitSidebar = {
onChange={event =>
onStringChange(
propName,
event->ReactEvent.Form.target##value,
event->React.Event.Form.target##value,
)
}
/>
| Some(options) =>
<select
style=Styles.select
onChange={event => {
let value = event->ReactEvent.Form.target##value;
let value = event->React.Event.Form.target##value;

onStringChange(propName, value);
}}>
Expand Down Expand Up @@ -618,7 +618,7 @@ module DemoUnitSidebar = {
onChange={event =>
onIntChange(
propName,
event->ReactEvent.Form.target##value->int_of_string,
event->React.Event.Form.target##value->int_of_string,
)
}
/>
Expand All @@ -640,7 +640,7 @@ module DemoUnitSidebar = {
onChange={event =>
onFloatChange(
propName,
event->ReactEvent.Form.target##value->float_of_string,
event->React.Event.Form.target##value->float_of_string,
)
}
/>
Expand All @@ -660,7 +660,7 @@ module DemoUnitSidebar = {
onChange={event =>
onBoolChange(
propName,
event->ReactEvent.Form.target##checked,
event->React.Event.Form.target##checked,
)
}
/>
Expand Down Expand Up @@ -920,7 +920,7 @@ module DemoUnitFrame = {
<div name="DemoUnitFrame" style={container(responsiveMode)}>
<iframe
onLoad={event => {
let iframe = event->ReactEvent.Synthetic.target;
let iframe = event->React.Event.Synthetic.target;
let window = iframe##contentWindow;
onLoad(window);
}}
Expand Down
34 changes: 13 additions & 21 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1675,11 +1675,6 @@ nth-check@^2.0.1:
dependencies:
boolbase "^1.0.0"

object-assign@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=

object-inspect@^1.9.0:
version "1.12.3"
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9"
Expand Down Expand Up @@ -1859,22 +1854,20 @@ [email protected]:
iconv-lite "0.4.24"
unpipe "1.0.0"

react-dom@^17.0.2:
version "17.0.2"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23"
integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==
react-dom@^18.0.0:
version "18.2.0"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d"
integrity sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
scheduler "^0.20.2"
scheduler "^0.23.0"

react@^17.0.2:
version "17.0.2"
resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037"
integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==
react@^18.0.0:
version "18.2.0"
resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5"
integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"

read-pkg@^5.2.0:
version "5.2.0"
Expand Down Expand Up @@ -2000,13 +1993,12 @@ [email protected], safe-buffer@>=5.1.0, safe-buffer@^5.1.0, safe-buffer@~5.2.0:
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==

scheduler@^0.20.2:
version "0.20.2"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91"
integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==
scheduler@^0.23.0:
version "0.23.0"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe"
integrity sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"

schema-utils@^3.1.0, schema-utils@^3.1.1:
version "3.1.1"
Expand Down
Loading