-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
docs: improve explanation of global middleware #32855
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
Conversation
…ware is executed automatically on initial page load This is an improvement to the statement: "Nuxt automatically executes global middleware for first time enter to the application" which is not very clear or grammatically correct.
|
WalkthroughThe change updates the documentation in the Nuxt lifecycle guide to clarify the timing of global middleware execution. The phrase "first time enter to the application" was replaced with "initial page load (both on server and client)" to specify that global middleware runs on the initial page load on both server and client sides, and then again before any client-side navigation. The explanation regarding the execution of named and anonymous middleware remains unchanged, and no code or public API alterations are present. Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 (1)
docs/2.guide/1.concepts/10.nuxt-lifecycle.md (1)
71-71
: Minor wording & spacing tweaks for smoother readingA couple of small editorial issues remain:
- Missing space before the parenthesis – should be “entry (initial …)”.
- “first-time entry” reads a little awkward; “first entry” or “initial entry” is more idiomatic.
- “page(route)” is missing a space.
Suggested patch:
-Nuxt automatically executes global middleware for first-time entry(initial page load) to the application and every time before route navigation. Named and anonymous middleware are executed only on the routes specified in the middleware property of the page(route) meta defined in the corresponding page components. +Nuxt automatically executes global middleware on first entry (initial page load) to the application, and before every subsequent route navigation. Named and anonymous middleware are executed only on the routes specified in the `middleware` property of the page (route) meta defined in the corresponding page components.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/2.guide/1.concepts/10.nuxt-lifecycle.md
(1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: Tofandel
PR: nuxt/nuxt#0
File: :0-0
Timestamp: 2024-11-11T12:34:22.648Z
Learning: Ensure that AI-generated summaries accurately reflect the key changes in the PR, focusing on notable changes such as the removal of unused imports and variables starting with underscores.
📚 Learning: in `packages/nuxt/src/app/components/nuxt-root.vue`, when optimizing bundle size by conditionally im...
Learnt from: huang-julien
PR: nuxt/nuxt#29366
File: packages/nuxt/src/app/components/nuxt-root.vue:16-19
Timestamp: 2024-12-12T12:36:34.871Z
Learning: In `packages/nuxt/src/app/components/nuxt-root.vue`, when optimizing bundle size by conditionally importing components based on route metadata, prefer using inline conditional imports like:
```js
const IsolatedPage = route?.meta?.isolate ? defineAsyncComponent(() => import('#build/isolated-page.mjs')) : null
```
instead of wrapping the import in a computed property or importing the component unconditionally.
Applied to files:
docs/2.guide/1.concepts/10.nuxt-lifecycle.md
📚 Learning: ensure that ai-generated summaries accurately reflect the key changes in the pr, focusing on notable...
Learnt from: Tofandel
PR: nuxt/nuxt#0
File: :0-0
Timestamp: 2024-11-11T12:34:22.648Z
Learning: Ensure that AI-generated summaries accurately reflect the key changes in the PR, focusing on notable changes such as the removal of unused imports and variables starting with underscores.
Applied to files:
docs/2.guide/1.concepts/10.nuxt-lifecycle.md
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.
thank you! ❤️
…eware is executed automatically on initial page load
This is an improvement to the statement: "Nuxt automatically executes global middleware for first time enter to the application" which is not very clear or grammatically correct.
🔗 Linked issue
📚 Description