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

Move away from internals - use the new native hydrate API #91

Open
Tofandel opened this issue Sep 3, 2024 · 5 comments
Open

Move away from internals - use the new native hydrate API #91

Tofandel opened this issue Sep 3, 2024 · 5 comments

Comments

@Tofandel
Copy link

Tofandel commented Sep 3, 2024

Since vuejs/core#11458

Using the component will throw an error __asyncHydrate is not a function (because vue thinks it's a suspense component but the new internal is missing and Vue doesn't explicitly check it)

Since they now provide a native way to do lazy hydration. Maybe this component should be rewritten to be a wrapper around the new api

@Tofandel
Copy link
Author

Tofandel commented Sep 6, 2024

It was patched in 3.5.3 but we'll need to start working on moving away from the internals and to the new API, leaving it open to track this instead

@Tofandel Tofandel changed the title Not compatible with Vue 3.5.0 Move away from internals - use the new native hydrate API Sep 6, 2024
@dmitryuk
Copy link

dmitryuk commented Nov 4, 2024

As I faced with a new VUE 3.5 API it doesn't work as I need.
Current library doesn't load a lazy chunk before Hydration moment occurred, but VUE 3.5 API does (load). I don't want to load extra JS if I don't need it.

@Tofandel
Copy link
Author

Tofandel commented Nov 4, 2024

Please see nuxt/nuxt#26468

Which will eventually replace this package

@dmitryuk
Copy link

dmitryuk commented Nov 4, 2024

I think can't, because with these changes:

  1. Some people don't use NUXT, for example, I'm
  2. As I previously said, async chunk will be loaded immediately on a page load unlike this package do (on hydration event)

lazy load+ lazy hydration versus lazy hydration only (Vue 3.5)

@Tofandel
Copy link
Author

Tofandel commented Nov 4, 2024

This lib is only for lazy hydration, for lazy load of a component you need to do that yourself with a defineAsyncComponent and a dynamic import, a lib cannot do what it doesn't control and in this case it's you already statically importing the component to use it in the slot of the Lazyhydrate component

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

No branches or pull requests

2 participants