Skip to content
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

Make "Snapshot/Screenshot" test page works #546

Merged
merged 27 commits into from
Aug 26, 2020
Merged

Make "Snapshot/Screenshot" test page works #546

merged 27 commits into from
Aug 26, 2020

Conversation

ZihanChen-MSFT
Copy link

@ZihanChen-MSFT ZihanChen-MSFT commented Aug 18, 2020

Please select one of the following

  • I am removing an existing difference between facebook/react-native and microsoft/react-native-macos 👍
  • I am cherry-picking a change from Facebook's react-native into microsoft/react-native-macos 👍
  • I am making a fix / change for the macOS implementation of react-native
  • I am making a change required for Microsoft usage of react-native

Summary

  • In RNTester, the Snapshot/Screenshot page is originally designed for taking a screenshot from the main window in iOS using NativeModule.
  • Before this fix, operations on this test page results in crashing.
  • I made it run in macOS with turbo module.
  • This change is created based on fb62merge.

Changelog

[macOS] [Fixed] - Make "Snapshot/Screenshot" test page works.

Test Plan

Manually tested.

Microsoft Reviewers: Open in CodeFlow

@ZihanChen-MSFT ZihanChen-MSFT marked this pull request as ready for review August 18, 2020 00:43
@ZihanChen-MSFT ZihanChen-MSFT requested a review from tom-un as a code owner August 18, 2020 00:43
Copy link
Member

@alloy alloy left a comment

Choose a reason for hiding this comment

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

Welcome to Xcode land 😄

One thing that isn’t immediately clear to me is why this is using Turbo Modules; is it just forward thinking or did you take this module as an entry-point to start your larger work effort on Turbo Modules in RN macOS?

RNTester/NativeModuleExample/Screenshot.mm Outdated Show resolved Hide resolved
RNTester/NativeModuleExample/Screenshot.m Outdated Show resolved Hide resolved
RNTester/NativeModuleExample/Screenshot.mm Outdated Show resolved Hide resolved
RNTester/RNTester-macOS/AppDelegate.mm Outdated Show resolved Hide resolved
RNTester/RNTester-macOS/AppDelegate.mm Outdated Show resolved Hide resolved
RNTester/RNTester/RNTesterTurboModuleProvider.mm Outdated Show resolved Hide resolved
RNTester/js/examples/Snapshot/SnapshotExample.js Outdated Show resolved Hide resolved
third-party-podspecs/RCT-Folly.podspec Show resolved Hide resolved
@ZihanChen-MSFT ZihanChen-MSFT changed the base branch from fb62merge to master August 21, 2020 22:10
Copy link
Member

@alloy alloy left a comment

Choose a reason for hiding this comment

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

Yep, this seems good to me 👍

The one thing I’m wondering now is if we should wait to merge this into master until we’ve released v0.62 proper (currently still in prerelease), or perhaps you can create a new macos-turbo-modules branch and merge these changes there, an merge all of that work into master later on?

/cc @acoates-ms

Copy link

@analysis-bot analysis-bot left a comment

Choose a reason for hiding this comment

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

Code analysis results:

  • eslint found some issues. Run yarn lint --fix to automatically fix problems.

@ghost ghost removed the Needs: Author Feedback label Aug 22, 2020
@ZihanChen-MSFT ZihanChen-MSFT merged commit e4bc8c4 into microsoft:master Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants