Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ReScript 10 / records with optional fields #766

Closed
@cknitt

Description

@cknitt

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

letstyles=StyleSheet.create({openStyle  {"statusBar":style(      ~flexDirection=#row,      ~height=dp(22.),      ~alignItems=#center,      ~paddingLeft=dp(12.),      (),    ),"text":style(~color=NativeColors.white, ~marginLeft=dp(4.), ()),  }})

we could have

letstyles=StyleSheet.create({openStyle  {"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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp