Skip to content

Server side rendering with getRunningOperationPromises #2477

@JulienKode

Description

@JulienKode

Hi

I've try to take a look at the ssr-experiment exemple here:

I've:

On the beedrill fetch this is what I can see when displaying running promises:

{
"getPokemonByName(\"beedrill\")": {
  "arg": "beedrill",
  "requestId": "070QxaL_aSi7MV3VbQzDQ",
  "queryCacheKey": "getPokemonByName(\"beedrill\")"
},
"getPokemonByName(\"bulbasaur\")": {
  "arg": "bulbasaur",
  "requestId": "FdsRw3PmBbDP5sR7-kKPe",
  "queryCacheKey": "getPokemonByName(\"bulbasaur\")"
}
}
  • Is it normal that we are waiting for bulbasaur when our page are just concern about beedrill ?
  • Should the runningPromises created in the api be unique to each page and not sharing across different page ? otherwise on large scale apps this could be an issue if we are waiting for the queries of another page
  • Does the runningPromises should be isolated to each page on SSR ?
  • like createListenerMiddleware should we have a createApiMiddleware ? Then on server side, we can have a different middleware instance for each page that does not share values

This is the debug line that I've added in redux:

  function getRunningOperationPromises() {
    console.warn("[DEBUG] RUNNING OPERATION PROMISES ", {runningQueries})
    console.warn(JSON.stringify(runningQueries, null, 2))

@phryneas @markerikson

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions