-
-
Notifications
You must be signed in to change notification settings - Fork 197
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
refactor!: update to latest brisk-reconciler #576
Conversation
Btw, this is a PR for merge into: #566 |
@@ -5,7 +5,7 @@ open Revery.UI.Components; | |||
module DefaultButtonWithCounter = { | |||
let%component make = () => { | |||
let%hook (count, setCount) = Hooks.state(0); | |||
let increment = () => setCount(count + 1); | |||
let increment = () => setCount(_ => count + 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're supposed to do setCount(count => count + 1);
here. That's why it was made a function ;) It's unlikely to cause a problem if you don't, especially in this case where it worked absolutely fine before, but when it does cause a problem it's a tricky one to find because it requires breaking the abstraction. It also might be very hard to reproduce. See briskml/brisk-reconciler#26 for details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep! I just mangled through all these and lazily replaced them with _
!
EDIT: Could probably do a search and replace for (_ =>
and walk through them! 🙂
|
I don't why I have a empty windows when executing |
|
You should better rebase onto master instead of merging (you will avoid this kind of merge error). |
~height=?, | ||
~src="", | ||
~style=Style.emptyImageStyle, | ||
~children=React.empty, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Image can have children 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for other Primitives like OpenGL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this changes that, we just need t provide an empty children as a default which is needed IIRC!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scrollview, Row, Container, Center must have one argument so default arg to React.empty
is not fine for me. Ticker shouldn't have child.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I though not exposing argument and defining a local children variable. What do you think ? I can fix that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That might make sense, but it differs from how master looks currently: https://github.com/revery-ui/revery/blob/master/src/UI_Components/Input.re#L356
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated all containers except Container
as to explicitly take children @Et7f3.
Do you want me to push these, or do you want to create a separate issue for that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see so create another issue. IIRC @bryphe wanted some compile time assertion to be verified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for reference #489 (comment)_
Wonder if we should change the merge target to master instead of #566? |
When reviewing it I compared this branch and master and it was clean. I think it is better to change it. |
So cool to see this green and the Pretty heroic and impressive change @lessp @wokalski @Et7f3
Sounds good to me! We can just close #566 in lieu of this more complete change 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So cool to see the let%hook
and let%component
PPXs in action to remove the boilerplate we have today,
The only problem is that let%hook doesn't work in reis currently. And it's hard to make it work there. |
No, it’s very hard. There are lower hanging fruits with more ROI. |
So, pushing what I've got, I began converting the examples. Most of the should be OK now hopefully. Got a bit stuck on theUI_Primitives
type-errors.This PR introduces the changes from brisk-reconciler with the new syntax:
e.g.