Skip to content

SSR should use AsyncLocalStorage for locale #7806

@wmertens

Description

@wmertens

During SSR, multiple requests with different locales could be running at the same time. This leads to PRs like #7804.

The locale is stored as a singleton in module scope in use-locale.ts, and setLocale() just changes that value.

Instead, it should use AsyncLocalStorage if that's available, and then withLocale should only be used once during request processing in qwik router.

We're already doing that to store the request event, for example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    COMMUNITY: PR is welcomedWe think it's a good feature to have but would love for the community to help with the PR for itCOMP: runtime

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions