Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/blog/14.nuxt-on-the-edge.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const { data } = await useFetch('/api/hello')
</template>
```

One important thing to note when we created [useFetch](/docs/api/composables/use-fetch) and [$fetch](/docs/api/utils/dollarfetch) is that during server-side rendering, if you call your API routes, it will emulate the request and call the function code directly: **avoiding an HTTP request and reducing page’s rendering time**.
One important thing to note when we created [useFetch](/docs/api/composables/use-fetch) and [$fetch](/docs/api/utils/$fetch) is that during server-side rendering, if you call your API routes, it will emulate the request and call the function code directly: **avoiding an HTTP request and reducing page’s rendering time**.

In terms of developer experience, you will notice that when creating server files, the Nuxt server keeps running without rebuilding the Vue app. **This is because Nuxt 3 supports Hot Module Replacement (HMR) when creating API and server routes.**

Expand Down
16 changes: 12 additions & 4 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,10 @@ export default defineNuxtConfig({
'/docs/3.x/api/composables': { redirect: '/docs/3.x/api/composables/use-app-config', prerender: false },
'/docs/4.x/api/composables': { redirect: '/docs/4.x/api/composables/use-app-config', prerender: false },
'/docs/5.x/api/composables': { redirect: '/docs/5.x/api/composables/use-app-config', prerender: false },
'/docs/api/utils': { redirect: '/docs/api/utils/dollarfetch', prerender: false },
'/docs/3.x/api/utils': { redirect: '/docs/3.x/api/utils/dollarfetch', prerender: false },
'/docs/4.x/api/utils': { redirect: '/docs/4.x/api/utils/dollarfetch', prerender: false },
'/docs/5.x/api/utils': { redirect: '/docs/5.x/api/utils/dollarfetch', prerender: false },
'/docs/api/utils': { redirect: '/docs/api/utils/$fetch', prerender: false },
'/docs/3.x/api/utils': { redirect: '/docs/3.x/api/utils/$fetch', prerender: false },
'/docs/4.x/api/utils': { redirect: '/docs/4.x/api/utils/$fetch', prerender: false },
'/docs/5.x/api/utils': { redirect: '/docs/5.x/api/utils/$fetch', prerender: false },
'/docs/api/kit': { redirect: '/docs/api/kit/modules', prerender: false },
'/docs/3.x/api/kit': { redirect: '/docs/3.x/api/kit/modules', prerender: false },
'/docs/4.x/api/kit': { redirect: '/docs/4.x/api/kit/modules', prerender: false },
Expand All @@ -338,6 +338,14 @@ export default defineNuxtConfig({
'/docs/4.x/examples': { redirect: { to: '/docs/examples/hello-world', statusCode: 301 }, prerender: false },
'/docs/5.x/examples': { redirect: { to: '/docs/examples/hello-world', statusCode: 301 }, prerender: false },
'/docs/examples': { redirect: '/docs/examples/hello-world', prerender: false },
// comark-content 0.6 keeps `$` in paths instead of spelling it out (`$fetch.md` was `dollarfetch`)
'/docs/2.x/api/internals/dollarnuxt': { redirect: { to: '/docs/2.x/api/internals/$nuxt', statusCode: 301 }, prerender: false },
'/docs/3.x/api/utils/dollarfetch': { redirect: { to: '/docs/3.x/api/utils/$fetch', statusCode: 301 }, prerender: false },
'/docs/4.x/api/utils/dollarfetch': { redirect: { to: '/docs/4.x/api/utils/$fetch', statusCode: 301 }, prerender: false },
'/docs/5.x/api/utils/dollarfetch': { redirect: { to: '/docs/5.x/api/utils/$fetch', statusCode: 301 }, prerender: false },
// Their Markdown, as `llms.txt` used to list it (only the versions served as raw Markdown)
'/raw/docs/3.x/api/utils/dollarfetch.md': { redirect: { to: '/raw/docs/3.x/api/utils/$fetch.md', statusCode: 301 }, prerender: false },
'/raw/docs/4.x/api/utils/dollarfetch.md': { redirect: { to: '/raw/docs/4.x/api/utils/$fetch.md', statusCode: 301 }, prerender: false },
'/docs/examples/features': { redirect: '/docs/examples/features/auto-imports', prerender: false },
'/docs/examples/routing': { redirect: '/docs/examples/routing/middleware', prerender: false },
'/docs/examples/advanced': { redirect: '/docs/examples/advanced/config-extends', prerender: false },
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"botid": "^1.5.12",
"chat": "^4.44.0",
"cobe": "2.0.1",
"comark-content": "^0.5.1",
"comark-content": "^0.6.0",
"date-fns": "^4.4.0",
"drizzle-orm": "^0.45.4",
"eve": "^0.91.0",
Expand Down
11 changes: 5 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ minimumReleaseAgeExclude:
- nuxt-auth-utils@0.6.1
- '@comark/vue@0.9.0 || 0.9.1'
- comark@0.9.0
- comark-content@0.5.1
- comark-content@0.5.1 || 0.6.0

permissions:
'@nuxtjs/sitemap':
Expand Down
2 changes: 1 addition & 1 deletion server/utils/content/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function cacheAvailable(): boolean {
/**
* Bump when content parser/plugin changes (TODO: automate this)
*/
export const CONTENT_PARSER_VERSION = 'v10'
export const CONTENT_PARSER_VERSION = 'v11'

/**
* Driver backing one instance's manifest, parsed bodies and snapshot artifacts.
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/l10n/docs/4.api/2.composables/use-fetch.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ links:
size: xs
---

This composable provides a convenient wrapper around [`useAsyncData`](/docs/api/composables/use-async-data) and [`$fetch`](/docs/api/utils/dollarfetch).
This composable provides a convenient wrapper around [`useAsyncData`](/docs/api/composables/use-async-data) and [`$fetch`](/docs/api/utils/$fetch).
It automatically generates a key for the request, provides type hints for request url based on server routes, and infers API response type.

::note
Expand Down
4 changes: 2 additions & 2 deletions test/unit/docs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ describe('docsLinks', () => {
it('versions the Nuxt 2 docs links, `$nuxt` slug included', () => {
const { nodes } = rewrite('2.x', [
['a', { href: '/docs/guide/concepts/views' }],
['read-more', { to: '/docs/api/internals/dollarnuxt' }]
['read-more', { to: '/docs/api/internals/$nuxt' }]
])
expect(nodes[0]![1]).toEqual({ href: '/docs/2.x/guide/concepts/views' })
expect(nodes[1]![1]).toEqual({ to: '/docs/2.x/api/internals/dollarnuxt' })
expect(nodes[1]![1]).toEqual({ to: '/docs/2.x/api/internals/$nuxt' })
})
})

Expand Down
Loading