Skip to content

Conversation

@danielroe
Copy link
Member

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)

πŸ“š Description

spotted some references to passing in an event.

also added subpath import

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroe danielroe requested a review from pi0 as a code owner December 18, 2025 12:16
@vercel
Copy link

vercel bot commented Dec 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
nitro.build Ready Ready Preview, Comment Dec 18, 2025 0:17am

@coderabbitai
Copy link

coderabbitai bot commented Dec 18, 2025

πŸ“ Walkthrough

Walkthrough

Documentation examples updated across two files to reflect a change in the useRuntimeConfig() API, replacing useRuntimeConfig(event) calls with useRuntimeConfig() without the event parameter. An import statement for useRuntimeConfig from nitro/runtime-config is also added.

Changes

Cohort / File(s) Summary
useRuntimeConfig API usage update
docs/1.docs/50.configuration.md, docs/2.deploy/20.providers/cloudflare.md
Updated code examples to call useRuntimeConfig() instead of useRuntimeConfig(event). Added import for useRuntimeConfig from nitro/runtime-config. Narrative adjusted to reflect the simplified API usage pattern.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

  • Straightforward documentation updates reflecting a consistent API usage pattern change across two files
  • No logic changes or complex reasoning required; primarily cosmetic updates to code examples

Pre-merge checks and finishing touches

βœ… Passed checks (3 passed)
Check name Status Explanation
Title check βœ… Passed The title 'docs: update runtime config usage' follows conventional commits format with 'docs:' scope prefix and clearly describes the documentation update about runtime configuration usage.
Description check βœ… Passed The description is related to the changeset, mentioning corrected references to passing an event and adding a subpath import, which aligns with the documentation changes made.
Docstring Coverage βœ… Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/runtime-config

πŸ“œ Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between ced5469 and e630ccd.

πŸ“’ Files selected for processing (2)
  • docs/1.docs/50.configuration.md (1 hunks)
  • docs/2.deploy/20.providers/cloudflare.md (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
πŸ“š Learning: 2025-12-03T19:09:13.905Z
Learnt from: medz
Repo: nitrojs/nitro PR: 3834
File: src/presets/cloudflare/server-entry.ts:63-63
Timestamp: 2025-12-03T19:09:13.905Z
Learning: In the Nitro Cloudflare preset (src/presets/cloudflare/server-entry.ts), native errors from oxc-parser and Node.js readFile operations should be allowed to bubble up naturally without wrapping, as their native error messages are more user-friendly and provide better diagnostic information.

Applied to files:

  • docs/2.deploy/20.providers/cloudflare.md
⏰ 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). (3)
  • GitHub Check: tests-rollup (ubuntu-latest)
  • GitHub Check: tests-rollup (windows-latest)
  • GitHub Check: tests-rolldown (windows-latest)
πŸ”‡ Additional comments (3)
docs/1.docs/50.configuration.md (2)

60-69: Documentation updates are consistent and clear.

The narrative, import, and example have been updated consistently to reflect the new API pattern. The example is concise and correctly demonstrates accessing the runtime config without the event parameter.


64-67: No issues foundβ€”documentation accurately reflects the API.

Verification of the Nitro source code confirms that useRuntimeConfig() indeed takes no parameters. The actual function signature is export function useRuntimeConfig(): NitroRuntimeConfig, which matches the documentation example exactly. The import path and code sample are correct.

docs/2.deploy/20.providers/cloudflare.md (1)

170-180: Consistent API usage update.

The changes mirror the updates in the configuration documentation file, correctly removing the event parameter from useRuntimeConfig() calls. The example appropriately shows accessing runtime config within the request event lifecycle while demonstrating the new API pattern.


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.

❀️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 18, 2025

Open in StackBlitz

npm i https://pkg.pr.new/nitrojs/nitro@3885

commit: e630ccd

Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thnx ❀️

@pi0 pi0 merged commit 0dfa69c into main Dec 18, 2025
12 checks passed
@pi0 pi0 deleted the docs/runtime-config branch December 18, 2025 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants