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

Get rid of @string/@int for polyvars#770

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
MoOx merged 1 commit intomainfromsimplify-polyvars
Oct 5, 2022
Merged

Conversation

@cknitt
Copy link
Member

Resurrected#767.
Merge for ReScript 10 release.

@cknittcknitt added this to the0.70 / rescript 10 milestoneAug 18, 2022
Copy link
Member

@MoOxMoOx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Awesome work !

Do you think we could do something in PlatformColor for Android ? (I can handle it, I just want your opinion on this inglorious code xD

@cknitt
Copy link
MemberAuthor

I have never used thePlatformColor API myself. The current implementation looks a bit like "overkill". 🙂

Compare to TypeScript which just has this:https://github.com/DefinitelyTyped/DefinitelyTyped/blob/16db88356a79c458dbe5d88d9706aadec1d20db5/types/react-native/index.d.ts#L6041

I don't quite understand why one can pass an array of color names, what is that used for?

@MoOx
Copy link
Member

MoOx commentedOct 5, 2022

Yeah that's clearly some copy paste here...
The idea is not to have string, but "known" strings that correspond to "registered" color names ( by the OS) or "unsafe" (created by the developer).

And why an array ? Because if you pass more than one string value to the PlatformColor function, it will treat the first value as the default and the rest as fallback depending on their availability (make more sense for "user" values, with system fallbacks).

I will update PlatformColor later then.

@MoOxMoOx merged commit6495093 intomainOct 5, 2022
@MoOxMoOx deleted the simplify-polyvars branchOctober 5, 2022 13:25
@cknitt
Copy link
MemberAuthor

@MoOx Ah, but if you can define a type now with#"@android:color/background_dark" etc. and no@as(...) anymore, then you can use@variadic, right? That should drastically simplify things.

MoOx added a commit that referenced this pull requestOct 5, 2022
* main:  Use polymorphic variant for Platform.os (#771)  Get rid of @string/@int for polyvars (#770)
@MoOx
Copy link
Member

MoOx commentedOct 6, 2022

Exactly.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@MoOxMoOxMoOx approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@cknitt@MoOx

[8]ページ先頭

©2009-2025 Movatter.jp