Skip to content

Allow promise hydration to work with instances of Promise from another context #17235

@Conduitry

Description

@Conduitry

Describe the problem

Sort of similar to sveltejs/devalue#5 (wow, 2018), if I try to serialize an object for hydration and it contains instances of Promise from another context - like it would when I'm running code with vm.runInNewContext() - then Svelte fails to see this as a promise, and devalue balks at having to serialize an arbitrary POJO.

Describe the proposed solution

The only thing I can think of is to try duck typing this. How would we feel about result && typeof result.then == 'function' instead of result instanceof Promise?

Importance

nice to have

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions