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

React Native Test App as a Package #204

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tido64
Copy link

@tido64 tido64 commented Feb 11, 2020

We're proposing to provide React Native test apps for all platforms (currently Android, iOS, Windows and macOS) as a package. Our aim is to make it easier for package maintainers to add support for a platform, to be able to switch between React Native versions, run on CI, etc. The package should take care of the native integration so that developers can spend more time on their component/feature.

You can find a rough (but working) prototype of this here: https://github.com/microsoft/react-native-test-app. We are consuming this internally and are actively iterating towards the goals detailed in the proposal.

cc @alexpomsft, @danrydholm, @khovik

@kelset
Copy link
Member

kelset commented Feb 12, 2020

cc @bartolkaruza

@TheSavior
Copy link

I love this. I think making it easier for module owners to verify their modules works on different versions will be great.

I'm a little nervous about this part

Aim to become part of the default create-react-native-app template

The scenario for people who maintain apps to test against other versions seems like a bit of a different problem to me. For example, they probably don't need to make sure their app works across multiple versions of React Native.

Do you see it as important to support app developers with this tool? Or does it make sense to have it be focused on library authors / platform authors?

@brentvatne
Copy link
Contributor

One thing that is notably missing from the list of platforms that this should support is web. Do you have any interest in building this into the package as well or do you think this is out of scope @tido64?

@tido64
Copy link
Author

tido64 commented Feb 15, 2020

@TheSavior: Do you see it as important to support app developers with this tool? Or does it make sense to have it be focused on library authors / platform authors?

I think it completely makes sense to have it be focused on library/platform authors. I guess what I was trying to say is that we want a simple way to get started with a completely new component/library with support for all platforms right off the bat. Maybe a library template for react-native-cli is what I should have put here. E.g. a developer could run react-native init ProjectName --template "react-native-library-template", and you'd get a project with test apps for all platforms ready to go. Does that make more sense?

@brentvatne: One thing that is notably missing from the list of platforms that this should support is web. Do you have any interest in building this into the package as well or do you think this is out of scope @tido64?

Our primary focus will be to support mobile and desktop platforms. That is what we currently have capacity for. @acoates-ms correct me if I'm wrong. That said, I don't think anyone would be opposed to getting help with additional platforms. In fact, we'd welcome any contributions.

@grabbou
Copy link
Member

grabbou commented Feb 17, 2020

On a high level, this proposal seems like an ability to create apps (production or test apps) by writing JavaScript-only files and abstracting away the native code. Is there anything that makes this proposal limited to creating test apps only? If not, then, I think there's an interesting opportunity here.

Either way, I have left some comments here and there to accelerate further discussions. Really looking forward to the next steps as this proposal seems like something that we have been trying to implement for a while already.

@tido64

E.g. a developer could run react-native init ProjectName --template "react-native-library-template", and you'd get a project with test apps for all platforms ready to go. Does that make more sense?

In fact, this idea was floating around for a while already. For example, in this issue, #96 that was created as a motivation for autolinking, one of the next steps was to create a good boilerplate for libraries that use Yarn workspaces and provides ready-to-use test application.

I think the outcome of this proposal could be a creation of such a template. I am more than happy to help out with this part.

@TheSavior
Copy link

@tido64, ah. I understand better now. If you want to make this a default part of creating new modules, I don't think react-native init is the right place as that is mostly known for creating end user apps. After a quick google search, I found these two projects that seem to be for helping bootstrap a new native module / component: bob, and creat-react-native-module.

@tido64
Copy link
Author

tido64 commented Feb 20, 2020

@grabbou: On a high level, this proposal seems like an ability to create apps (production or test apps) by writing JavaScript-only files and abstracting away the native code. Is there anything that makes this proposal limited to creating test apps only? If not, then, I think there's an interesting opportunity here.

There shouldn't be? As far as I can see, you will have to add support for declaring app name and bundle id etc. in the manifest. If that's something you want to work on, you should go for it. That said, I think our top priority should be an excellent dev experience.

@grabbou: I think the outcome of this proposal could be a creation of such a template. I am more than happy to help out with this part.

I'll hold you to your word 👍

@tido64
Copy link
Author

tido64 commented Aug 3, 2020

Hi folks,

Ever since we've published this PR, we've been improving the test apps and ironing out the wrinkles. We've added support for macOS, and Windows support is in progress. We've been dogfooding it for quite some time now, and would really appreciate it if you could try it out and provide feedback. The test app package is now published as react-native-test-app. All our documentation can be found in the wiki.

As always, feel free to file issues in react-native-test-app/issues or reach out directly with questions in the usual channels.

@asklar
Copy link
Contributor

asklar commented Sep 17, 2020

Hi folks,

Ever since we've published this PR, we've been improving the test apps and ironing out the wrinkles. We've added support for macOS, and Windows support is in progress. We've been dogfooding it for quite some time now, and would really appreciate it if you could try it out and provide feedback. The test app package is now published as react-native-test-app. All our documentation can be found in the wiki.

As always, feel free to file issues in react-native-test-app/issues or reach out directly with questions in the usual channels.

My main concern with this is it will make it pretty difficult to make changes to the rnw CLI without breaking apps/modules built with this tool. For example @jonthysell found that this tool places assets in locations that break certain assumptions that the RNW CLI makes which break autolinking.

@tido64
Copy link
Author

tido64 commented Sep 18, 2020

My main concern with this is it will make it pretty difficult to make changes to the rnw CLI without breaking apps/modules built with this tool. For example @jonthysell found that this tool places assets in locations that break certain assumptions that the RNW CLI makes which break autolinking.

@asklar We'd be happy to make any changes that will be more future-proof. Please file an issue on the repo or reach out directly to us.

@tido64
Copy link
Author

tido64 commented Sep 23, 2020

Hi folks,

As of v0.2.5, we now support react-native-windows 0.62 and 0.63. This also means that we've caught up with the latest releases across all supported platforms, while also being backwards compatible to 0.60 on certain platforms. You can refer to the React Native versions table in our wiki for more details.

Please try it out and let us know how you go. If you hit any issues, you can file them here: https://github.com/microsoft/react-native-test-app/issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💡 Proposal This label identifies a proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants