Skip to content

feat: add SSR / Nuxt runtime support #15

Description

@anton-gor-dev

Problem

The runtime has two SSR issues:

  1. initComposableObserver() checks typeof window and silently returns on SSR — the observer is never initialized, so DevTools show nothing in Nuxt apps.
  2. The composable registry (Map at module level) is a shared singleton. In SSR, concurrent requests share state, causing cross-request data leaks.

Solution options

Option A — explicit SSR guard (minimal)
Document that the Vue plugin should be wrapped in a import.meta.client guard in Nuxt. Add Nuxt docs and example.

Option B — request-scoped registry (full fix)
Thread a registry instance through Vue's provide/inject so each SSR request gets its own isolated state. Requires API changes to trackComposable.

Acceptance criteria

  • Nuxt app with SSR enabled shows composables in DevTools
  • No state leaks between SSR requests
  • Documented in README / docs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions