React-native-windows: [Onboarding] Consider first-party add-platform tool in @react-native-community/cli

Created on 6 Mar 2019  路  4Comments  路  Source: microsoft/react-native-windows

Currently, we have an installer package that resolves the correct version of react-native-windows called rnpm-plugin-windows. We should consider dropping a proposal in React Native Community Discussions & Proposals to make a unified mechanism for adding platforms to a React Native project. E.g., today we require a CLI extension to install react-native-windows called rnpm-plugin-windows, but it would feel like a much more seamless experience if there was already a builtin tool for adding platforms to a React Native app.

E.g., if we had something like:

react-native add-platform <platform>

Which did the following:

  1. Install a package named react-native-<platform>@latest
  2. Call a "resolver" module from that package to correct the version (i.e., we may need to downgrade the version of react-native-<platform> to a package that is compatible with the currently installed version of React Native)
  3. Call an "init" module which generates the boilerplate for the platform

cc @vincentriemer in case he has considered this before for react-native-dom.

CLI needs PM design

Most helpful comment

Related: #2133
Really, we just want some way to integrate into the init process up front, either via a prompt or a built-in option. Adding on after the fact would be less desirable but better than what we have.

All 4 comments

FYI - I found a relevant proposal in React Native Community Discussions & Proposals and updated it with more details about this:
https://github.com/react-native-community/discussions-and-proposals/issues/50

I love this idea! Working towards making all platforms equal (aka not included by default, adding the ones the dev wants through an simple process like the proposed command) definitely seems like something worth working towards.

Related: #2133
Really, we just want some way to integrate into the init process up front, either via a prompt or a built-in option. Adding on after the fact would be less desirable but better than what we have.

With @asklar 's change to the react-native-cli that now prompts for adding windows and macOS after init command, we are slightly better off. I do agree that the end goal is to add-platform for all platforms. However, the right space to discuss this is in the linked issue since this is about the CLI + all platforms and we are probably a little ways off from being in the fully platform agnostic slim core before we can make this happen.

Closing this issue so we can continue the conversation on the discussions and proposals repo.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

syedibrahimt picture syedibrahimt  路  3Comments

tahakhozooie picture tahakhozooie  路  4Comments

GurtejSafaltek picture GurtejSafaltek  路  3Comments

dubiao picture dubiao  路  3Comments

kikisaints picture kikisaints  路  4Comments