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

types(reactivity): make Ref _shallow type public #2625

Closed
wants to merge 1 commit into from
Closed

types(reactivity): make Ref _shallow type public #2625

wants to merge 1 commit into from

Conversation

yangmingshan
Copy link
Contributor

This will help to use @vue/reactivity standalone. Current I have to use // @ts-expect-error in my custom watch.

https://github.com/vue-mini/vue-mini/blob/master/packages/wechat/src/watch.ts#L152

@yangmingshan yangmingshan changed the title fix(reactivity): make Ref _shallow type public types(reactivity): make Ref _shallow type public Nov 17, 2020
@posva
Copy link
Member

posva commented Nov 17, 2020

you are not explaining why you need that...

@yangmingshan
Copy link
Contributor Author

@posva I think I did, but never mind. I use @vue/reactivity to build my own watch, so I need _shallow type, check the link above (Vue Mini is library base on Vue 3 for mini program).

@posva
Copy link
Member

posva commented Nov 18, 2020

You are only saying it I need it so I can omit a ts-expect-error in my own code but you should explain why accessing this internal property is necessary and why you can't do otherwise

@yangmingshan
Copy link
Contributor Author

yangmingshan commented Nov 18, 2020

As I said I'm using @vue/reactivity to building my own watch, it's just like watch in Vue but without Vue special runtime binding. In this commit Evan use _shallow mark to determine whether a ref can be force trigger. I need to do same thing in my custom watch, use same _shallow mark, to fix same bug.

Hopefully I explained clearly why I need it, and why I can't do otherwise.

@yangmingshan
Copy link
Contributor Author

@posva Can we move this PR forward?

@posva
Copy link
Member

posva commented Feb 7, 2021

You still haven't explained with a proper use case what can't be done currently and requires the exposing of an internal variable to do so.

@yangmingshan
Copy link
Contributor Author

Thinking in this way, @vue/reactivity is a library can be used standalone, I'm using it to build a mini fork Vue for real word use case in China. _shallow is internal for Vue not @vue/reactivity, it should be public for @vue/reactivity, because @vue/runtime-core is using it. And in my mini fork Vue's runtime-core need use it to solve #2231 just like Vue itself.

@yangmingshan
Copy link
Contributor Author

@posva I appreciate your help, but I really try my best 😅, if you still don't get it, maybe we can ask another one to review this PR?

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.

2 participants