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

RFC: Vue.js Options API support #1327

Closed
franciscolourenco opened this issue Jan 19, 2021 · 8 comments
Closed

RFC: Vue.js Options API support #1327

franciscolourenco opened this issue Jan 19, 2021 · 8 comments
Labels
future 🔮 An enhancement or feature proposal that will be addressed after the next release help wanted ⛏️ Extra attention is needed hold ⚠️ This issue is accepted but no contributor is available yet or prerequisites must be fulfilled first.

Comments

@franciscolourenco
Copy link

franciscolourenco commented Jan 19, 2021

Summary

Some people would prefer to keep using the Options API instead of the alternative Composition API.

The Options API, as opposed to the Composition API, is the original way of creating Vue apps and components which can be found all over the docs, in which an options object is passed to the Vue constructor, or exported in the case of Single File Components.

Proposed Solution

A way to use urql using the declarative Options API in addition to the existing Composition API. The API could look something like the vue-apollo API

@franciscolourenco franciscolourenco added the future 🔮 An enhancement or feature proposal that will be addressed after the next release label Jan 19, 2021
@franciscolourenco franciscolourenco changed the title RFC: Vue Options API RFC: Vue Options API support Jan 19, 2021
@JoviDeCroock
Copy link
Collaborator

JoviDeCroock commented Jan 19, 2021

Could you elaborate on what the options api is, how an implementation would look like and so on? This isn't really an RFC rather than a request. Other issues tagged with future could serve as an example.

@franciscolourenco
Copy link
Author

franciscolourenco commented Jan 19, 2021

It was not my ambition to create a RFC, just a feature request. However this was the closest template which fitted the feature request case.
image

With that out of the way, the Options API as opposed to the Composition API, is the original way of creating Vue apps and components which can be found all over the docs, in which an options object is passed to the Vue constructor, or exported in the case of Single File Components.

@franciscolourenco
Copy link
Author

franciscolourenco commented Jan 19, 2021

vue-apollo is an example of what supporting the Options API could look like https://apollo.vuejs.org/guide/apollo/#usage-in-vue-components

@kitten
Copy link
Member

kitten commented Jan 19, 2021

I'm wondering however, would it make sense to still provide an Options API if Vue 3 shows the Composition API front and centre. Our ambition was to support mostly Vue 3and this seemed to be the more idiomatic approach of the two at least there.
cc @LinusBorg: Do you have any insights on whether it'd be necessary or make sense to support both?

@franciscolourenco
Copy link
Author

franciscolourenco commented Jan 19, 2021

My understanding is that:

  1. The majority of the docs is written with the Options API
  2. There is a section in the docs for the Composition API
  3. There is no intention to deprecate the Options API
  4. The Composition API is not touted as the successor to the Options API, but as an alternative

@LinusBorg
Copy link
Contributor

That's pretty much spot on on. the fact that the composition API right now take so much of the spotlight is just stemming from the fact that it's new and exciting.

It does solve real problems in areas of abstraction, composition and reusability, but the main API people are familiar with, and many/most new people probably pick up first, is still the Options API that remains largely unchanged from Vue 2.

So in that light it would be great if it would be supported. It should be possible to achieve it in a way that adds little overhead and uses the existing use* functions under the hood - I'll take a look, might take a bit though.

@franciscolourenco franciscolourenco changed the title RFC: Vue Options API support RFC: Vue.js Options API support Jan 20, 2021
@kitten kitten added the hold ⚠️ This issue is accepted but no contributor is available yet or prerequisites must be fulfilled first. label Mar 25, 2021
@franciscolourenco
Copy link
Author

@kitten Could you share some context on the hold ⚠️ tag? Thanks!

@JoviDeCroock JoviDeCroock added the help wanted ⛏️ Extra attention is needed label Dec 9, 2021
@kitten
Copy link
Member

kitten commented Jan 10, 2023

Closing as not planned.

I know this is controversial, but our whole opinion on this was to wait out and see whether we a) could implement this cleanly, and b) whether adoption of Vue 3 would pick up fast enough.

We've seen that it's reasonably fine to adopt, and that the Options API wouldn't live up to our standardds, both in implementation and usability.

Sorry! 😅

@kitten kitten closed this as not planned Won't fix, can't repro, duplicate, stale Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
future 🔮 An enhancement or feature proposal that will be addressed after the next release help wanted ⛏️ Extra attention is needed hold ⚠️ This issue is accepted but no contributor is available yet or prerequisites must be fulfilled first.
Projects
None yet
Development

No branches or pull requests

4 participants