forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 138
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
DynamicColorMacOS fixes #1028
Merged
Merged
DynamicColorMacOS fixes #1028
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
harrieshin
reviewed
Feb 18, 2022
harrieshin
approved these changes
Feb 18, 2022
HeyImChris
approved these changes
Feb 18, 2022
Saadnajmi
added a commit
to Saadnajmi/react-native-macos
that referenced
this pull request
Feb 18, 2022
* Use initWithDynamicProvider + Add HC Support * Update log error
Saadnajmi
added a commit
that referenced
this pull request
Feb 19, 2022
* RCTSwitch: Use NSSwitch instead of NSButton (#924) * add pull yml * match handleOpenURLNotification event payload with iOS (#755) (#2) Co-authored-by: Ryan Linton <ryanlntn@gmail.com> * [pull] master from microsoft:master (#11) * Deprecated api (#853) * Remove deprecated/unused context param * Update a few Mac deprecated APIs * Packing RN dependencies, hermes and ignoring javadoc failure, (#852) * Ignore javadoc failure * Bringing few more changes from 0.63-stable * Fixing a patch in engine selection * Fixing a patch in nuget spec * Fixing the output directory of nuget pack * Packaging dependencies in the nuget * Fix onMouseEnter/onMouseLeave callbacks not firing on Pressable (#855) * add pull yml * match handleOpenURLNotification event payload with iOS (#755) (#2) Co-authored-by: Ryan Linton <ryanlntn@gmail.com> * fix mouse evetns on pressable * delete extra yml from this branch * Add macOS tags * reorder props to have onMouseEnter/onMouseLeave always be before onPress Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com> Co-authored-by: Ryan Linton <ryanlntn@gmail.com> * Grammar fixes. (#856) Updates simple grammar issues. Co-authored-by: Nick Trescases <42704557+ntre@users.noreply.github.com> Co-authored-by: Anandraj <anandrag@microsoft.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com> Co-authored-by: Ryan Linton <ryanlntn@gmail.com> Co-authored-by: Muhammad Hamza Zaman <mh.zaman.4069@gmail.com> * Use NSSwitch * remove change from my fork Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com> Co-authored-by: Ryan Linton <ryanlntn@gmail.com> Co-authored-by: Nick Trescases <42704557+ntre@users.noreply.github.com> Co-authored-by: Anandraj <anandrag@microsoft.com> Co-authored-by: Muhammad Hamza Zaman <mh.zaman.4069@gmail.com> * DynamicColorMacOS fixes (#1028) * Use initWithDynamicProvider + Add HC Support * Update log error * replace all references to 10.14 (#938) * Replace currentAppearance with currentDrawingAppearance on macOS 11+ (#1029) * Manually cherry-pick #1012 Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com> Co-authored-by: Ryan Linton <ryanlntn@gmail.com> Co-authored-by: Nick Trescases <42704557+ntre@users.noreply.github.com> Co-authored-by: Anandraj <anandrag@microsoft.com> Co-authored-by: Muhammad Hamza Zaman <mh.zaman.4069@gmail.com>
This was referenced Mar 2, 2022
christophpurrer
pushed a commit
to christophpurrer/react-native-macos
that referenced
this pull request
Jan 15, 2023
…h web" behind experimental feature (microsoft#1028) (microsoft#1201) Summary: Fixes facebook/yoga#850 facebook/yoga#850 describes a conformance issue where positioning of an absolute child using percentages is not calculated against the correct box size. This takes the fix for that in facebook/yoga#1028, regenerates tests, and fixes tests so that the experimental feature can be enabled. Goal is to run this as an experiment internally to see if we can enable by default. Changelog: [Internal] X-link: facebook/yoga#1201 Reviewed By: yungsters Differential Revision: D42282358 Pulled By: NickGerleman fbshipit-source-id: 57c0dd9b0f1c47cb9335ff6e13d44b4646e5fa58
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please select one of the following
Summary
This should resolve part of #511 .
Previously, we had a custom class called
RCTDynamicColor
to implementDynamicColorMacOS
. That is because at the time, there was no macOS equivalent to UIColor's initWithDynamicProvider constructor. RCTDynamicColor had the issue that it used[NSAppearance currentAppearance]
, which is deprecated and is a UI Thread only method. We actually did create RCTDynamicColor's on background threads often, leading to the above mentioned bug.Nowadays, there is an NSColor equivalent:-> init(name:dynamicProvider:). We also raised our minimum OS to 10.15 so we can just use this and delete RCTDynamicColor altogether. Additionally, Upstream DynamicColorIOS added High Contrast support with facebook#31651 , so let's also implement that in DynamicColorMacOS
Changelog
[macOS] [Fixed] - Fixed DynamicColorMacOS violating main thread checker + added High Contrast support.
Test Plan
I updated the test page for PlatformColor in RN-Tester. I should also add this change upstream, since there isn't a DynamicColorIOS example of High Contrast there.
Screen.Recording.2022-02-17.at.11.31.48.AM.mov