npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vike-vue-pinia-colada

v0.0.9

Published

Vike extension for Pinia Colada

Readme

Built on top of the same patterns as vike-vue-pinia, with added Pinia Colada query cache serialization/hydration.

[!NOTE] Pinia is included — you don't need vike-vue-pinia alongside this extension.

Installation

  1. npm install vike-vue-pinia-colada pinia @pinia/colada

  2. Extend +config.js:

    // pages/+config.js
    
    import vikeVuePiniaColada from 'vike-vue-pinia-colada/config'
    import vikeVue from 'vike-vue/config'
    
    export default {
      // ...
      extends: [vikeVue, vikeVuePiniaColada]
    }

Pinia Colada Options

You can pass options to the Pinia Colada plugin via the piniaColadaOptions config:

// pages/+config.js

export default {
  piniaColadaOptions: {
    queryOptions: {
      staleTime: 5000,
    },
  }
}

All options from PiniaColadaOptions are supported.

Why a separate extension?

Pinia Colada stores its query cache inside Pinia, but serializing it through Pinia's standard state hydration doesn't work reliably — cache keys can be functions, which aren't serializable out of the box. This causes issues when relying solely on vike-vue-pinia for SSR.

The recommended approach is to use the dedicated helpers provided by Pinia Colada (serializeQueryCache / reviveQueryCache) to correctly serialize the query cache on the server and hydrate it on the client. This is exactly what this extension does under the hood.

Architecture differences with vike-vue-pinia

This extension differs from vike-vue-pinia in how Pinia is initialized:

  • vike-vue-pinia uses +onCreatePageContext.ssr.ts for server-side Pinia creation, then creates the client-side instance separately in +onCreateApp.ts via a shared createPiniaPlus helper.
  • vike-vue-pinia-colada uses a single +onCreatePageContext.ts (no .ssr suffix) that handles both environments. On the client, it early-returns if a Pinia instance already exists on globalContext.

Both approaches avoid unnecessary pageContext.json requests during client-side navigation:

  • .ssr.js hooks only run during SSR (initial server render), not during client-side navigation.
  • No-suffix hooks run on both server and client — during client-side navigation, they execute client-side, so no server round-trip is needed.
  • Only .server.js hooks would trigger pageContext.json requests during client-side navigation.

The result is a simpler implementation: one hook handles Pinia creation in both environments, while +onCreateApp focuses solely on app plugin installation and hydration. The trade-off is a negligible extra onCreatePageContext call on each client-side navigation (which immediately early-returns).

See also