Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-13411

Provide a synchronous way to hydrate the Page Model in the SPA SDK

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 14.3.0
    • None
    • None
    • 1
    • Quasar
    • Puma Sprint 236, Puma Sprint 237, Puma Sprint 238, Puma Sprint 239

    Description

      Problem:
      Some of the universal frameworks (Nuxt.js or Vue SSR) do the DOM hydration by mapping Virtual DOM with the DOM rendered on the server. Currently, that cannot be achieved because the SPA SDK always returns a promise.

      Solution:
      Update the SPA SDK to return the hydrated model in the current tick if a prefetched model was provided.

      Notes:

      • The `initialize` function should accept the `Page` object in the case when the model was initialized externally (like Next.js or Nuxt.js).
      • Update all the framework-specific SDKs to delegate Page Model hydration to the SPA SDK.

      Testing:

      • The change should not break all the existing e2e tests.
      • Server-side rendered apps should not repeat the Page Model API request before the initial render.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mdokolin Mikhail Dokolin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: