Skip to content

idea: use createUseFetch for generated composables on newer Nuxt #134

Description

@onmax

Nuxt now has createUseFetch (nuxt@>=4.4.0) for custom useFetch instances, and the recommended custom useFetch recipe seems to be moving in that direction.

Would you be open to nuxt-open-fetch adopting that for generated use[Client] / useLazy[Client] composables when the installed Nuxt version supports it, while keeping the current createUseOpenFetch path for older Nuxt versions?

My thought is to keep it small:

  • do the split at generation time, not at runtime
  • keep the public generated API unchanged
  • only use the new path when the feature is available in Nuxt

Resources:

If that direction makes sense, I can put together a PR.

Reasons why i think make sesne

  • it aligns nuxt-open-fetch with Nuxt’s current recommended custom useFetch direction
  • it should reduce maintenance / compatibility risk in future
  • no public api change

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions