Skip to content

Built-in SSR support #10

@MartinMalinda

Description

@MartinMalinda

There's several approaches how to handle SSR with Tasks but none are optimal: https://vue-concurrency.netlify.app/ssr-support/

The approach of saving data to VueX / Pinia or other client side store has proven to work well but probably shouldn't be done just to make SSR with hydration work.
(https://vue-concurrency.netlify.app/examples/store/)

There could be a way to make tasks work with SSR out of the box

  1. right before sending HTML response, serialize task state to JSON and place it on SSR context. All that's needed to serialize is probably _instances as all other state derives from that.
  2. When task is run on the client side, it should pick up the serialized _instances from the ssr context.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions