Skip to content

Some way to wait before send SSR results #2084

Closed
@outerlook

Description

@outerlook

Describe the problem

I'm used to GraphQL Relay's concepts of data specification in a more declarative rather than imperative way. To achieve that, part of it is based on the principle of collocating data requirements next to where it is used. It makes an data intensive app more scalable as components become more modular, less coupled to pages, without over or underfetching.

Load function is define what you need before you use. The methods I'm used to, you first use some data then it automatically request what you asked. I use gqless to achieve that. Rather than arguing which is better or has better performance, right now my workflow is not supported by svelte-kit.

Describe the proposed solution

It would be highly appretiated to be able to wait for something inside my svelte components before sending the results, or be able to extract the cache of it. Something in which I could extract information of what was compiled (without needing to right an preprocessor), pass cache back after await resolve(request) at Handle function in hooks.ts.

Routify does have an utility called $ready() which would be a good inspiration of api...
https://routify.dev/docs/helpers#ready

Alternatives considered

Leave as is and declare not scope of svelte-kit.

Refactor my app or be happy with some skeleton loading inside my app. But that would be a huge problem for SEO...

Importance

use SvelteKit without it becomes harder

Additional Information

Well, I could use Sveltekit without it, but I'd need to refactor all my app for it. And for my workflow it wouldn't be an improvement in terms of scalability.

about collocation:
https://www.graphql.com/articles/best-practices-for-graphql-clients

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