Skip to content

docs: use cleaner imports in examples and add read more links to config#4200

Merged
pi0 merged 2 commits intomainfrom
docs/improvements
Apr 10, 2026
Merged

docs: use cleaner imports in examples and add read more links to config#4200
pi0 merged 2 commits intomainfrom
docs/improvements

Conversation

@RihanArfan
Copy link
Copy Markdown
Member

🔗 Linked issue

❓ Type of change

  • 📖 Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Switches imports to import { defineConfig } from 'nitro' rather than import { defineNitroConfig } from 'nitro/config', and adds read more links in the config page to link to the dedicated docs pages.

📝 Checklist

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

RihanArfan and others added 2 commits April 10, 2026 17:19
- `defineNitroConfig` → `defineConfig` with import from `"nitro"`
- `defineNitroErrorHandler` → `defineErrorHandler`
- `defineCachedEventHandler` → `defineCachedHandler`
- `eventHandler` from `"h3"` → `defineHandler` from `"nitro"`
- Fix stale `/guide/` url to `/docs/configuration`
- Update migration guide to reflect `defineConfig` from `"nitro"`

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace inline "[Read more]" links with `:read-more` component at the
end of each config section for storage, database, renderer, assets,
plugins, tasks, routing, route rules, and hooks.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@RihanArfan RihanArfan requested a review from pi0 as a code owner April 10, 2026 16:28
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 10, 2026

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

Project Deployment Actions Updated (UTC)
nitro.build Ready Ready Preview, Comment Apr 10, 2026 4:28pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 10, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR updates documentation and example files across the Nitro project to reflect API naming changes. It replaces defineNitroConfig with defineConfig, defineNitroErrorHandler with defineErrorHandler, defineCachedEventHandler with defineCachedHandler, and eventHandler with defineHandler throughout code snippets and configuration examples.

Changes

Cohort / File(s) Summary
Quick Start & Routing Docs
docs/1.docs/2.quick-start.md, docs/1.docs/5.routing.md
Updated imports and config function names; also corrected caching wrapper reference from defineCachedEventHandler to defineCachedHandler.
Configuration Examples
docs/1.docs/4.renderer.md, docs/1.docs/6.server-entry.md, docs/1.docs/7.cache.md, docs/1.docs/8.storage.md, docs/1.docs/50.assets.md, docs/1.docs/50.configuration.md, docs/1.docs/50.database.md, docs/1.docs/50.lifecycle.md, docs/1.docs/50.plugins.md, docs/1.docs/50.tasks.md
Consistently replaced defineNitroConfig from nitro/config with defineConfig from nitro in all configuration example snippets.
Migration & Deployment Docs
docs/1.docs/99.migration.md, docs/2.deploy/0.index.md, docs/2.deploy/20.providers/aws-amplify.md, docs/2.deploy/20.providers/aws.md, docs/2.deploy/20.providers/cloudflare.md, docs/2.deploy/20.providers/iis.md, docs/2.deploy/20.providers/vercel.md, docs/2.deploy/20.providers/zephyr.md
Updated import sources and config helper function names across all deployment and migration guide examples.
API Reference & Examples
docs/3.config/0.index.md
Updated configuration examples to use defineConfig and defineErrorHandler; adjusted documentation links and route rule caching description.
Example Code & Documentation
docs/4.examples/plugins.md, examples/plugins/README.md, examples/plugins/server.ts
Replaced eventHandler from h3 with defineHandler from nitro in handler definitions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title follows conventional commits format with 'docs:' prefix and clearly describes the documentation changes made.
Description check ✅ Passed The description is directly related to the changeset, explaining the switch from 'defineNitroConfig' to 'defineConfig' imports and the addition of read-more links.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/improvements

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.

Copy link
Copy Markdown
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 b17d7b8 into main Apr 10, 2026
8 of 9 checks passed
@pi0 pi0 deleted the docs/improvements branch April 10, 2026 16:31
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.

2 participants