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

Enable the CLI to create a C# native module library that consumes Microsoft.ReactNative #3201

Closed
4 tasks
jonthysell opened this issue Sep 24, 2019 · 4 comments · Fixed by #5921
Closed
4 tasks
Assignees
Labels
Area: CLI Invalid Triage https://github.com/microsoft/react-native-windows/wiki/Triage-Process (label applied by bot)
Milestone

Comments

@jonthysell
Copy link
Contributor

jonthysell commented Sep 24, 2019

Project should be set up similar to the SampleLibraryCS sample:

  • C# component library
  • Depends only on Microsoft.ReactNative and Microsoft.ReactNative.Managed
  • Provides a ReactPackageProvider that automatically includes all native modules, and view managers
  • Provides a simple sample native module
@ghost ghost added the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Sep 24, 2019
@jonthysell jonthysell added this to the vNext Milestone 3 milestone Sep 24, 2019
@jonthysell jonthysell removed the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Sep 24, 2019
@jonthysell jonthysell self-assigned this Sep 24, 2019
@jonthysell
Copy link
Contributor Author

Stretch goal for M3, possibly move to M4.

@jonthysell
Copy link
Contributor Author

Potentially considering putting this in @brodybits/create-react-native-module, rather than our own CLI.

@brodybits
Copy link

Possibly off-topic: I personally find it somewhat problematic to deal with what seem to be separate and incompatible .NET (C#) and C++ react-native-windows versions. My understanding is that .NET should eventually be considered deprecated. But if you guys have too many users relying on the .NET implementation, this could be extremely "easier said than done".

I am now wondering if there may be any way for react-native-windows to support both .NET and C++ components, with .NET support deprecated, for a hopefully limited period of time. Even if not so efficient in performance, I think it would help give users a more linear transition path.

Any thoughts?

@stmoy
Copy link
Contributor

stmoy commented Nov 20, 2019

Hi @brodybits - thank you for your input. You're right in noting that the move from .NET (C#)/vCurrent to C++/vNext will be a breaking change. However, this breaking change is to be more inclusive of C++ development and not to exclude C# development.

From an “underlying framework” point of view, you’re right that vCurrent will be replace with vNext by the end of the year. By “underlying framework”, I mean the literal guts of React Native for Windows. From an app developer point of view, it should be possible for apps to migrate their existing native code to vNext without too much hassle because vNext supports native modules written in both C++ and C#. To that end, react-native-windows vNext will support .NET and C++ components even though the guts are written in C++.

We expect to have a small support window for vCurrent, but all of our future improvements will be in vNext because it provides us with the best platform in terms of performance and enables us to keep up with changes to the core React Native platform.

@chrisglein chrisglein removed the vnext label Mar 18, 2020
@jonthysell jonthysell modified the milestones: 0.62 (M5), 0.63 (M6) Apr 10, 2020
@chrisglein chrisglein modified the milestones: 0.63, Backlog Jul 13, 2020
jonthysell added a commit to jonthysell/react-native-windows that referenced this issue Sep 11, 2020
This PR extends `react-native-windows-init` with a `--projectType
[app|lib]` option and a set of new native module lib templates for both
C++ and C#. This provides a much needed mechanism for developers wishing
to add windows implementation to an existing native module (esp.
community modules) without having to set up the VS files manually.

Closes microsoft#3203
Closes microsoft#3201
@ghost ghost added the Invalid Triage https://github.com/microsoft/react-native-windows/wiki/Triage-Process (label applied by bot) label Sep 16, 2020
jonthysell added a commit that referenced this issue Sep 18, 2020
…5921)

This PR extends `react-native-windows-init` with a `--projectType [app|lib]` option and a set of new native module lib templates for both C++ and C#. This provides a much needed mechanism for developers wishing to add windows implementation to an existing native module (esp. community modules) without having to set up the VS files manually.

Closes #3203 
Closes #3201
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: CLI Invalid Triage https://github.com/microsoft/react-native-windows/wiki/Triage-Process (label applied by bot)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants