-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: add api functionality docs (#30436) #30437
docs: add api functionality docs (#30436) #30437
Conversation
Run & review this pull request in StackBlitz Codeflow. |
Warning Rate limit exceeded@danielroe has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 33 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThe pull request introduces comprehensive documentation updates for Nuxt rendering modes, focusing on deployment configurations and rendering strategies. The changes provide detailed guidance on handling Single-Page Application (SPA) mode, static client-rendered applications, and hybrid rendering approaches. The documentation elaborates on critical deployment considerations, such as the implications of using Additionally, a new warning regarding the limitations of Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
docs/2.guide/1.concepts/3.rendering.md (3)
95-97
: Enhance the explanation of API functionalityThe warning about API functions being removed is crucial, but it would be more helpful to explain:
- Why
npm run generate
removes the server API functions- What are the implications for different deployment scenarios
- How to properly configure the server when using
npm run build
Consider expanding the section with this additional context:
-Deploying Nuxt using `npm run generate` with `ssr:false` removes the `~/server/api` functions. Consider using `npm run build` for `~/server/api` endpoints to work correctly. +Deploying Nuxt using `npm run generate` with `ssr:false` removes the `~/server/api` functions because it generates a static site without a server component. If your application requires API functionality: + +1. Use `npm run build` instead, which preserves the server runtime +2. Deploy to a hosting platform that supports server-side functionality +3. Ensure your deployment process includes starting the Nitro server
98-108
: Clarify the purpose of prerendered routes in SPA modeThe configuration example would be more helpful with explanations of why each route is necessary:
Consider expanding the section with this additional context:
-If running your app in `npm run build` mode with `ssr:false`, remember to add `["200.html", "404.html" "/" ]` to your `nitro.prerender` configuration to ensure your app functions work in Single-Page Application (SPA) mode. +If running your app in `npm run build` mode with `ssr:false`, you need to prerender specific routes for proper SPA functionality: + +- `200.html`: Serves as the default success page for client-side routing +- `404.html`: Handles non-existent routes gracefully +- `/`: Ensures the root route is properly handled + +Add these routes to your `nitro.prerender` configuration:
230-238
: Fix grammatical and formatting issues in example descriptionsThe word "todos" should be hyphenated as "to-dos" for correct grammar.
Apply these corrections:
- title: Nuxt Todos Edge + title: Nuxt To-dos Edge --- - A todos application with user authentication, SSR and SQLite. + A to-dos application with user authentication, SSR and SQLite.🧰 Tools
🪛 Markdownlint (0.37.0)
231-231: Expected: atx; Actual: setext
Heading style(MD003, heading-style)
🪛 LanguageTool
[grammar] ~232-~232: It appears that a hyphen is missing in the plural noun “to-dos”?
Context: ...on: i-simple-icons-github title: Nuxt Todos Edge to: https://github.com/atinux/nu...(TO_DO_HYPHEN)
[grammar] ~238-~238: It appears that a hyphen is missing in the plural noun “to-dos”?
Context: ...: text-black dark:text-white --- A todos application with user authentication, S...(TO_DO_HYPHEN)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/2.guide/1.concepts/3.rendering.md
(3 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/2.guide/1.concepts/3.rendering.md
[uncategorized] ~109-~109: Loose punctuation mark.
Context: ....html", "404.html"], } }, }) ``` ::tip{to="https://www.youtube.com/watch?v...
(UNLIKELY_OPENING_PUNCTUATION)
[grammar] ~232-~232: It appears that a hyphen is missing in the plural noun “to-dos”?
Context: ...on: i-simple-icons-github title: Nuxt Todos Edge to: https://github.com/atinux/nu...
(TO_DO_HYPHEN)
[grammar] ~238-~238: It appears that a hyphen is missing in the plural noun “to-dos”?
Context: ...: text-black dark:text-white --- A todos application with user authentication, S...
(TO_DO_HYPHEN)
🪛 Markdownlint (0.37.0)
docs/2.guide/1.concepts/3.rendering.md
198-198: Expected: atx; Actual: setext
Heading style
(MD003, heading-style)
231-231: Expected: atx; Actual: setext
Heading style
(MD003, heading-style)
243-243: Expected: atx; Actual: setext
Heading style
(MD003, heading-style)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
docs/2.guide/1.concepts/3.rendering.md (2)
104-106
: Important clarification about server endpoints!The warning effectively communicates the limitations of prerendering commands. Consider enhancing it with a code example demonstrating a typical server endpoint that wouldn't work with prerendering.
Here's a suggested addition:
If you prerender your app with the `nuxi generate` or `nuxi build --prerender` commands, then you will not be able to use any server endpoints as no server will be included in your output folder. If you need server functionality, use `nuxi build` instead. + +For example, this server endpoint would not work with prerendering: +```ts +// server/api/hello.ts +export default defineEventHandler(() => { + return { message: 'Hello from the server!' } +}) +```🧰 Tools
🪛 LanguageTool
[uncategorized] ~105-~105: Loose punctuation mark.
Context: ...unctionality, usenuxi build
instead. :: If you are using purely client-side r...(UNLIKELY_OPENING_PUNCTUATION)
95-95
: Remove extra blank lineThere are multiple consecutive blank lines here. Please remove one blank line to maintain consistent formatting throughout the documentation.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~95-~95: Loose punctuation mark.
Context: ...n/nuxt-config#spaloadingtemplate"} :: ::tip{to="https://www.youtube.com/watch?v...(UNLIKELY_OPENING_PUNCTUATION)
🪛 Markdownlint (0.37.0)
95-95: Expected: 1; Actual: 2
Multiple consecutive blank lines(MD012, no-multiple-blanks)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/2.guide/1.concepts/3.rendering.md
(2 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/2.guide/1.concepts/3.rendering.md
[uncategorized] ~95-~95: Loose punctuation mark.
Context: ...n/nuxt-config#spaloadingtemplate"} :: ::tip{to="https://www.youtube.com/watch?v...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~105-~105: Loose punctuation mark.
Context: ...unctionality, use nuxi build
instead. :: If you are using purely client-side r...
(UNLIKELY_OPENING_PUNCTUATION)
🪛 Markdownlint (0.37.0)
docs/2.guide/1.concepts/3.rendering.md
95-95: Expected: 1; Actual: 2
Multiple consecutive blank lines
(MD012, no-multiple-blanks)
🔇 Additional comments (1)
docs/2.guide/1.concepts/3.rendering.md (1)
95-95
: Excellent addition of multimedia learning resource!The video reference is well-placed and provides valuable supplementary content for developers learning about SPA development with Nuxt.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~95-~95: Loose punctuation mark.
Context: ...n/nuxt-config#spaloadingtemplate"} :: ::tip{to="https://www.youtube.com/watch?v...(UNLIKELY_OPENING_PUNCTUATION)
🪛 Markdownlint (0.37.0)
95-95: Expected: 1; Actual: 2
Multiple consecutive blank lines(MD012, no-multiple-blanks)
🔗 Linked issue
resolves #30436
📚 Description
Adds documentation around the use of
ssr:false
andserver/api
. This provides a better understading on what deployment strategy should be used for your app usingssr:false