-
-
Notifications
You must be signed in to change notification settings - Fork 149
Closed
Description
ReScript 10 will support records with optional fields. This would allow us to simplify a lot of things/move them closer to how they are done in JS.
E.g., styles: Instead of
let styles = StyleSheet.create({
open Style
{
"statusBar": style(
~flexDirection=#row,
~height=dp(22.),
~alignItems=#center,
~paddingLeft=dp(12.),
(),
),
"text": style(~color=NativeColors.white, ~marginLeft=dp(4.), ()),
}
})
we could have
let styles = StyleSheet.create({
open Style
{
"statusBar": style({
flexDirection: #row,
height: dp(22.),
alignItems: #center,
paddingLeft: dp(12.),
}),
"text": style({
color: "white",
marginLeft: dp(4.),
}),
}
})
Or for APIs taking some config object, like
Share.share(Share.content(~title="Title", ~url="https://example.com", ()))
we could have
Share.share({title: "Title", url: "https://example.com"})
@MoOx For me the question is, can these be breaking changes or should we try to remain compatible with the existing way where possible?
If we go for breaking changes, then we could also do #748 at the same time.
fhammerschmidt and MoOx
Metadata
Metadata
Assignees
Labels
No labels