Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

feat(nuxt3, bridge): add lazy helpers (useLazyAsyncData and useLazyFetch) #1861

Merged
merged 10 commits into from
Nov 15, 2021

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented Nov 11, 2021

πŸ”— Linked issue

resolves nuxt/bridge#214, resolves nuxt/bridge#193

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This PR:

  • renames defer to lazy within the useAsyncData and useFetch composables
  • adds new useLazyAsyncData and useLazyFetch as aliases for lazy: true versions of these composables
  • exposes these within Nuxt Bridge
  • adds onServerPrefetch to useAsyncData for Nuxt 2 support
  • adds documentation for default option
  • adds composition api migration docs

Note: there is a (separate) issue with typing for these composables within Bridge as Ref is being imported from vue - still thinking of how to solve πŸ€”

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.
  • solve typing in Nuxt Bridge

@danielroe danielroe added documentation Improvements or additions to documentation enhancement New feature or request bridge nuxt3 labels Nov 11, 2021
@danielroe danielroe requested a review from pi0 November 11, 2021 12:40
@danielroe danielroe self-assigned this Nov 11, 2021
@netlify
Copy link

netlify bot commented Nov 11, 2021

βœ”οΈ Deploy Preview for nuxt3-docs ready!

πŸ”¨ Explore the source changes: c6e0ce6

πŸ” Inspect the deploy log: https://app.netlify.com/sites/nuxt3-docs/deploys/618d816d5a36fd0007e57eeb

😎 Browse the preview: https://deploy-preview-1861--nuxt3-docs.netlify.app

@danielroe danielroe marked this pull request as draft November 11, 2021 13:35
@danielroe danielroe marked this pull request as ready for review November 11, 2021 16:12
Co-authored-by: Damian <48835293+DamianGlowala@users.noreply.github.com>
@pi0 pi0 merged commit f011a60 into main Nov 15, 2021
@pi0 pi0 deleted the feat/lazy-helpers branch November 15, 2021 12:09
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3.x bridge documentation Improvements or additions to documentation enhancement New feature or request nuxt3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add useLazyAsyncData and useLazyFetch No typescript support anymore for imports from Vue
3 participants