diff --git a/packages/intl/README.md b/packages/intl/README.md index 6324fc76..150ef01e 100644 --- a/packages/intl/README.md +++ b/packages/intl/README.md @@ -31,6 +31,7 @@ A lightweight internationalization library for Nano Kit applications. - **Type-safe**. Message schemes are checked against translation data. - **Composable**. Build messages from small formats like `text`, `params`, `plural`, `match`, and `number`. - **Tree-shakeable**. Import only the formats your app uses. +- **SSR-ready**. Use `@nano_kit/query` for cached translation loading and dehydration. ## Installation diff --git a/packages/next-router/README.md b/packages/next-router/README.md index 1d222e92..6dc05c3e 100644 --- a/packages/next-router/README.md +++ b/packages/next-router/README.md @@ -151,17 +151,15 @@ Use `virtualNavigation` and `dehydrate` in `getServerSideProps` to prefetch data // pages/characters.tsx import type { GetServerSideProps } from 'next' import { dehydrate, provide } from '@nano_kit/store' -import { Location$, Navigation$, virtualNavigation } from '@nano_kit/router' +import { LocationNavigation$, virtualNavigation } from '@nano_kit/router' import { routes } from '@/stores/router' import { CharactersPage, Stores$ } from '@/ui/pages/Characters' export const getServerSideProps: GetServerSideProps = async (context) => { - const [$location, navigation] = virtualNavigation(context.resolvedUrl, routes) const dehydrated = await dehydrate( Stores$, [ - provide(Location$, $location), - provide(Navigation$, navigation) + provide(LocationNavigation$, virtualNavigation(context.resolvedUrl, routes)) ] ) diff --git a/packages/svelte-kit/README.md b/packages/svelte-kit/README.md index e19fbd32..877f0d95 100644 --- a/packages/svelte-kit/README.md +++ b/packages/svelte-kit/README.md @@ -45,8 +45,7 @@ If your stores use navigation, set up server navigation once in the root server // src/routes/+layout.server.ts import { provide } from '@nano_kit/store' import { - Location$, - Navigation$, + LocationNavigation$, serverNavigation, setDehydrationContext } from '@nano_kit/svelte-kit' @@ -54,11 +53,8 @@ import { routes } from '$lib/routes' import type { LayoutServerLoad } from './$types' export const load: LayoutServerLoad = () => { - const [location, navigation] = serverNavigation(routes) - const contextRef = setDehydrationContext([ - provide(Location$, location), - provide(Navigation$, navigation) + provide(LocationNavigation$, serverNavigation(routes)) ]) return { @@ -74,8 +70,7 @@ Set up browser navigation and hydration in the root layout: diff --git a/website/astro.config.js b/website/astro.config.js index 4252ed80..a05bc9f4 100644 --- a/website/astro.config.js +++ b/website/astro.config.js @@ -123,6 +123,12 @@ export default defineConfig({ directory: 'router' } }, + { + label: 'Internationalization', + autogenerate: { + directory: 'intl' + } + }, { label: 'SSR', autogenerate: { diff --git a/website/src/content/docs/examples/rick-and-morty.mdx b/website/src/content/docs/examples/rick-and-morty.mdx index 4211ce48..db8cb3a7 100644 --- a/website/src/content/docs/examples/rick-and-morty.mdx +++ b/website/src/content/docs/examples/rick-and-morty.mdx @@ -5,7 +5,7 @@ sidebar: order: 4 --- -import { Tabs, TabItem } from '@astrojs/starlight/components' +import { Aside, Tabs, TabItem } from '@astrojs/starlight/components' This example shows a larger encyclopedia app built around routing, data loading, and server-side rendering. @@ -49,8 +49,10 @@ Compare the tabs to see the same application model running with React SSR, Svelt [View source on GitHub](https://github.com/TrigenSoftware/nano_kit/tree/main/examples/rick-and-morty/svelte-kit-nano_kit-ssr) + +