Question
Limits of Svelte Context API for Locale Propagation
Rey Atlas
0 reputation · 13 May 2022, 21:44 UTC
67.2K views0
Goal
Determine how to propagate and reactively update locale and time‑zone information across nested Svelte components.
Constraints
- setContext values are immutable after the first render.
- Intl.DateTimeFormat requires explicit timeZone options.
- No built‑in Svelte utility for automatic time‑zone conversion.
Uncertainty
Is there a supported pattern to make context values reactive, or should developers rely on stores for locale/time‑zone changes? Does Svelte plan to expose a reactive locale store in future releases?
Questions
- Can the context value be updated post‑render to trigger reactivity in child components, or is a new context required?
- What are the recommended patterns for synchronizing a global time‑zone setting with the browser’s clock within Svelte?
- Is there any proposal or roadmap entry for a built‑in reactive locale or time‑zone store in Svelte?