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

fix(runtime-core): inject function support self-inject #3022

Closed
wants to merge 1 commit into from

Conversation

huanggm
Copy link

@huanggm huanggm commented Jan 15, 2021

Before this pull request, I have read #1818 and #2400. And I think self-inject feature is required.

I wrote a vue3 plugin that depends on self-inject. Without self-inject feature, every container component must be splited into two components.

We can learn from angular. In angular, we can define component scope providers. By default we can self-inject.
And we can use @Skip to inject from parent.

WARNING!!! In this pull request, by default we inject from parent, and use selfInject parameter to control whether or not self-inject.

By the way. I don't think v3.0.2 is a patch update. It should be a minor update at least. It is not a compatible update.
image

@CyberAP @69hunter

@posva
Copy link
Member

posva commented Jan 15, 2021

Thank you but this would be a breaking change on something that is working as intended. It won't be considered unless it's fixing an existing case without breaking others.

You might want to open an RFC in the rfcs repository instead to propose something new

@posva posva closed this Jan 15, 2021
@LinusBorg
Copy link
Member

What's proposed in the PR is not really a breaking change as it uses a new, 3rd argument to inject() to optionally self-inject.

However I agree that it should go through RFC, as required for new features.

@huanggm
Copy link
Author

huanggm commented Jan 15, 2021

@posva Thank you for you reply.

This PR is absolutely not a breaking change. I just add a optional parameter selfInject.
In fact, v3.0.2 is a breaking change.

In v3.0.1, inject function is self-inject by default. But in v3.0.2, inject function inject from parent by default and I have no way to inject from self. So I add a extra optional parameter to control self-inject or not.

If you think RFC is required. Could you tell me where should I post the RFC.
Is this link right?

@posva
Copy link
Member

posva commented Jan 15, 2021

yes, that's the link

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

Successfully merging this pull request may close these issues.

3 participants