Skip to content

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

Open
@posva

Description

@posva

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    need guidanceThe approach/solution in the PR is unclear and requires guidance from maintainer to proceed further.scope: suspense

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions