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

DRAFT angular: AngularContext support #330

Open
PatrickJS opened this issue May 10, 2022 · 2 comments
Open

DRAFT angular: AngularContext support #330

PatrickJS opened this issue May 10, 2022 · 2 comments
Assignees
Labels
Milestone

Comments

@PatrickJS
Copy link
Collaborator

PatrickJS commented May 10, 2022

In order to support Angular we need to add the missing feature in Angular which is <AngularContext>. Which will allow us to hook into the injector hierarchy for <App> with either ReflectInjector or StaticInjector

// `injector` is optional
<AngularContext injector={this.injector}>
  <App>
</AngularContext>

any code within <App> will work correctly without any refactors needed since at the end of the day we're looking for a key walking up the injector context.

Mitosis can compile the code correctly and it will be up to the dev to either create the injector context correctly or we can let them generate the NgModule/AngularContext

We can also rename this to <AngularInjector> and useInjector and alias it to useContext. We will support useInjector if an react app is getting the ng injector if react is rendered in an angular app

@alujs alujs mentioned this issue May 12, 2022
@PatrickJS PatrickJS changed the title DRAFT: Mitosis AngularContext support DRAFT angular: AngularContext support May 19, 2022
@PatrickJS PatrickJS self-assigned this May 19, 2022
@PatrickJS PatrickJS added this to the angular v1 milestone May 20, 2022
@PatrickJS
Copy link
Collaborator Author

we need to change methods based on which angular version they're using. In angular 14 we can use inject which will make the code simple

@kylecordes
Copy link
Contributor

Adoption usually takes a while, it seems safe to target Angular 14 and up as that will likely no longer be the latest version when Mitosis has a big enough user base for there to be lots of demand for “not the latest Angular” support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants