Skip to content

Suspense emit are inconsistent with non Async children on the initial render #5376

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

Open
posva opened this issue Feb 8, 2022 · 0 comments
Open
Labels
need guidance The approach/solution in the PR is unclear and requires guidance from maintainer to proceed further. scope: suspense

Comments

@posva
Copy link
Member

posva commented Feb 8, 2022

Version

3.2.30

Reproduction link

sfc.vuejs.org/

Steps to reproduce

  • Open the link

What is expected?

  • To have pending and resolve events like when the component is async as it happens when switching between components

What is actually happening?

  • Only resolve is emitted on the initial render

Since suspense can be used with both async and sync components, I think we need some consistent event emitting:

  • Either emit both pending and resolve with sync components
  • Emit a different event to know a component is being displayed

The idea is being able to know that Suspense is displaying something and handle with the same code async and sync children. This could be useful for the router to know when view components start loading and when they are done loading. At the end there should be the same amount of pending and resolve (or errors or any other event)

@posva posva added need guidance The approach/solution in the PR is unclear and requires guidance from maintainer to proceed further. scope: suspense labels Feb 8, 2022
@posva posva changed the title Suspense emit are inconsistent with non Async children Suspense emit are inconsistent with non Async children on the initial render Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need guidance The approach/solution in the PR is unclear and requires guidance from maintainer to proceed further. scope: suspense
Projects
None yet
Development

No branches or pull requests

1 participant