v0.9.0
BREAKING CHANGES
To improve performance, the changeLocale
function has been removed and it is no longer possible to change locale at runtime without navigating/reloading the page.
To be compliant with i18n Qwik documentation, Qwik Speak Inline plugin generates chunks for each language, and the loading of translation files takes place only in dev mode or on server (except for the new runtimeAssets
).
So you must:
- Remove
changeLocale
function and navigate/reload the page to change locale - Move your runtime assets into the new option
runtimeAssets
- Remove
isDev
and other checks fromloadTranslation$
- Provide the base URL for the chunks in
entry.ssr.tsx
:
export function extractBase({ serverData }: RenderOptions): string {
if (!isDev && serverData?.locale) {
return '/build/' + serverData.locale;
} else {
return '/build';
}
}
export default function (opts: RenderToStreamOptions) {
return renderToStream(<Root />, {
manifest,
...opts,
// Determine the base URL for the client code
base: extractBase,
});
}
Ses Qwik Speak Inline Vite plugin and tutorial for more details.