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

Allow modules to run code during autolinking (to capture unmet implicit dependencies/requirements) #6553

Open
asklar opened this issue Nov 17, 2020 · 3 comments
Labels
Area: Native Modules bug enhancement Needs: Dev Design Workstream: Module Support Module developers have the requisite tooling and clear path for adding windows support to modules.
Milestone

Comments

@asklar
Copy link
Member

asklar commented Nov 17, 2020

Sometimes a community module will have requirements for the app to consume it successfully.
For example:

  • the react-native-print module requires that the app define a XAML Canvas element named RNPrintCanvas.
  • similarly, use of inking will require the app to set IsPerspectiveEnabled=false
  • C# modules require C++ apps to add the consumecsharpmodules property (this already works automatically)

In the case of react-native-print, this is documented in the module's readme, but it would be good if there was a way for the module to express requirements or even run some JS during autolink to either (in pri order):

  1. print a message explaining module requirements on the app
  2. check whether the condition is satisfied and if not print a message
  3. check the condition and fix it for the user
@asklar asklar added the bug label Nov 17, 2020
@ghost ghost added the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Nov 17, 2020
@acoates-ms
Copy link
Contributor

In 0.64 react-native doctor should be pluggable. At which point community modules would be able to provide their own checks. Maybe that would be a way to do this?

This doesn't seem like a react-native-windows specific issue.

@chrisglein chrisglein added Area: Native Modules Needs: Dev Design and removed Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) labels Nov 19, 2020
@chrisglein
Copy link
Member

The goal would be to have as much automatic validation as possible so that errors are caught proactively. Being able to diagnose after the fact is good too, but maybe we can fail faster?

@chrisglein chrisglein changed the title Allow modules to run code during autolinking Allow modules to run code during autolinking (to capture unmet implicit dependencies/requirements) Nov 19, 2020
@chrisglein chrisglein added this to the Backlog milestone Nov 19, 2020
@jaimecbernardo
Copy link

Another related issue is that modules may want to plug into some application events.
One example is react-native-splash-screen, which extends the splash screen.
The windows implementation would benefit from being able to hook into the Application.OnLaunched event to get Splash Screen information, as it's the supported way of doing this on Windows: https://docs.microsoft.com/en-us/windows/uwp/launch-resume/create-a-customized-splash-screen

@chiaramooney chiaramooney added the Workstream: Module Support Module developers have the requisite tooling and clear path for adding windows support to modules. label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Native Modules bug enhancement Needs: Dev Design Workstream: Module Support Module developers have the requisite tooling and clear path for adding windows support to modules.
Projects
None yet
Development

No branches or pull requests

6 participants