René's URL Explorer Experiment


Title: Adjust color type to make it more safe · Issue #746 · rescript-react-native/rescript-react-native · GitHub

Open Graph Title: Adjust color type to make it more safe · Issue #746 · rescript-react-native/rescript-react-native

X Title: Adjust color type to make it more safe · Issue #746 · rescript-react-native/rescript-react-native

Description: The problem Now that we have PlatformColor (nice implementation btw), I think we should think about color not being a type alias to string anymore (part reversal of this PR). I would like to gradually start to use platform colors in my a...

Open Graph Description: The problem Now that we have PlatformColor (nice implementation btw), I think we should think about color not being a type alias to string anymore (part reversal of this PR). I would like to gradua...

X Description: The problem Now that we have PlatformColor (nice implementation btw), I think we should think about color not being a type alias to string anymore (part reversal of this PR). I would like to gradua...

Opengraph URL: https://github.com/rescript-react-native/rescript-react-native/issues/746

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Adjust color type to make it more safe","articleBody":"## The problem\r\n\r\nNow that we have `PlatformColor` (nice implementation btw), I think we should think about color not being a type alias to string anymore [(part reversal of this PR)](https://github.com/rescript-react-native/rescript-react-native/pull/448). I would like to gradually start to use platform colors in my app, now all colors are strings, and sometimes I do some manipulation on them (like darken/lighten), of course that wouldn't work on platform colors.\r\n\r\n## Considered solution\r\n\r\nSo to make colors safe I think we should make them phantom typed.\r\n\r\n```\r\ntype t\u003c'a\u003e\r\nexternal string: string =\u003e t\u003cstring\u003e = \"%identity\"\r\nexternal get: color\u003c'a\u003e =\u003e 'a = \"%identity\"\r\n...\r\nlet blue = Color.string(\"blue\")\r\n\r\nlet blueString = Color.get(blue)\r\n```\r\n\r\nWith platform colors being `color\u003cPlatformColor.t\u003e`.\r\n\r\nIn `Style.t` we can accept all colors (we need a lot of type parameters in the external though)\r\n\r\n##  Alternative solution\r\n\r\nAn opaque type. The type of the color would be lost, so we can't easily have a `get` or `toString` that would raise a type error for a platform color. The upside for this is that we need less type parameters.","author":{"url":"https://github.com/jfrolich","@type":"Person","name":"jfrolich"},"datePublished":"2021-06-21T02:57:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/746/rescript-react-native/issues/746"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:fc487f5b-43b6-5c12-cfc9-dab896745ac1
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idADE2:2D90C6:17B5C6E:2101616:69652396
html-safe-noncef17b8b99e94fed0f82cd1244f7b8897d9ca28f4a8f0c5884cf189a0fe94d4dd0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBREUyOjJEOTBDNjoxN0I1QzZFOjIxMDE2MTY6Njk2NTIzOTYiLCJ2aXNpdG9yX2lkIjoiNTMxNDA3MDcxMjQ5MjA0MTExMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacfe07d234862cd55f28c392b2255a1549844f30144bc548d54bf015e314b45f15
hovercard-subject-tagissue:925772302
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/rescript-react-native/rescript-react-native/746/issue_layout
twitter:imagehttps://opengraph.githubassets.com/83daa4a075f477da5b32082d9f0f793830c32451899f9f2a17a6f0b3f616d071/rescript-react-native/rescript-react-native/issues/746
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/83daa4a075f477da5b32082d9f0f793830c32451899f9f2a17a6f0b3f616d071/rescript-react-native/rescript-react-native/issues/746
og:image:altThe problem Now that we have PlatformColor (nice implementation btw), I think we should think about color not being a type alias to string anymore (part reversal of this PR). I would like to gradua...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejfrolich
hostnamegithub.com
expected-hostnamegithub.com
None817276b8a3521a687e743b852e21b1c4c62a9fabf649a41d85c1499aaa39fab1
turbo-cache-controlno-preview
go-importgithub.com/rescript-react-native/rescript-react-native git https://github.com/rescript-react-native/rescript-react-native.git
octolytics-dimension-user_id54703302
octolytics-dimension-user_loginrescript-react-native
octolytics-dimension-repository_id86237257
octolytics-dimension-repository_nworescript-react-native/rescript-react-native
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id86237257
octolytics-dimension-repository_network_root_nworescript-react-native/rescript-react-native
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release4a4c6d32d56fbcafaf5646e244c8989317f135a9
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/rescript-react-native/rescript-react-native/issues/746#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Frescript-react-native%2Frescript-react-native%2Fissues%2F746
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Frescript-react-native%2Frescript-react-native%2Fissues%2F746
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=rescript-react-native%2Frescript-react-native
Reloadhttps://github.com/rescript-react-native/rescript-react-native/issues/746
Reloadhttps://github.com/rescript-react-native/rescript-react-native/issues/746
Reloadhttps://github.com/rescript-react-native/rescript-react-native/issues/746
rescript-react-native https://github.com/rescript-react-native
rescript-react-nativehttps://github.com/rescript-react-native/rescript-react-native
Please reload this pagehttps://github.com/rescript-react-native/rescript-react-native/issues/746
Notifications https://github.com/login?return_to=%2Frescript-react-native%2Frescript-react-native
Fork 150 https://github.com/login?return_to=%2Frescript-react-native%2Frescript-react-native
Star 932 https://github.com/login?return_to=%2Frescript-react-native%2Frescript-react-native
Code https://github.com/rescript-react-native/rescript-react-native
Issues 10 https://github.com/rescript-react-native/rescript-react-native/issues
Pull requests 2 https://github.com/rescript-react-native/rescript-react-native/pulls
Discussions https://github.com/rescript-react-native/rescript-react-native/discussions
Actions https://github.com/rescript-react-native/rescript-react-native/actions
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/rescript-react-native/rescript-react-native/security
Please reload this pagehttps://github.com/rescript-react-native/rescript-react-native/issues/746
Insights https://github.com/rescript-react-native/rescript-react-native/pulse
Code https://github.com/rescript-react-native/rescript-react-native
Issues https://github.com/rescript-react-native/rescript-react-native/issues
Pull requests https://github.com/rescript-react-native/rescript-react-native/pulls
Discussions https://github.com/rescript-react-native/rescript-react-native/discussions
Actions https://github.com/rescript-react-native/rescript-react-native/actions
Security https://github.com/rescript-react-native/rescript-react-native/security
Insights https://github.com/rescript-react-native/rescript-react-native/pulse
New issuehttps://github.com/login?return_to=https://github.com/rescript-react-native/rescript-react-native/issues/746
New issuehttps://github.com/login?return_to=https://github.com/rescript-react-native/rescript-react-native/issues/746
Adjust color type to make it more safehttps://github.com/rescript-react-native/rescript-react-native/issues/746#top
https://github.com/jfrolich
https://github.com/jfrolich
jfrolichhttps://github.com/jfrolich
on Jun 21, 2021https://github.com/rescript-react-native/rescript-react-native/issues/746#issue-925772302
(part reversal of this PR)https://github.com/rescript-react-native/rescript-react-native/pull/448
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.