Skip to content

feat: refactor useCustomFetch to use createUseFetch#207

Open
maximepvrt wants to merge 2 commits intonuxt:mainfrom
maximepvrt:update-custom-fetch
Open

feat: refactor useCustomFetch to use createUseFetch#207
maximepvrt wants to merge 2 commits intonuxt:mainfrom
maximepvrt:update-custom-fetch

Conversation

@maximepvrt
Copy link
Copy Markdown
Contributor

@maximepvrt maximepvrt commented Apr 22, 2026

use the new createUseFetch

🔗 Linked issue

📚 Description

@maximepvrt maximepvrt requested a review from danielroe as a code owner April 22, 2026 21:20
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 22, 2026

@maximepvrt is attempting to deploy a commit to the Nuxt Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 87952a8a-8d18-48b3-b088-0a4c6965531e

📥 Commits

Reviewing files that changed from the base of the PR and between 1d24122 and e561a7f.

📒 Files selected for processing (1)
  • examples/advanced/use-custom-fetch-composable/composables/useCustomFetch.ts
✅ Files skipped from review due to trivial changes (1)
  • examples/advanced/use-custom-fetch-composable/composables/useCustomFetch.ts

📝 Walkthrough

Walkthrough

Refactors the custom fetch composable: replaces the explicit useCustomFetch<T>(url, options) function with a useCustomFetch created via createUseFetch, merging caller options and injecting $fetch as useNuxtApp().$customFetch. Removes UseFetchOptions import and the direct useFetch call. Updates dependency versions: root package.json resolutions pins @nuxt/kit and nuxt to 4.4.2, and shared/package.json bumps nuxt to ^4.4.2 and @nuxt/ui to 4.6.1.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and clearly describes the main change: refactoring useCustomFetch to use the new createUseFetch API, which aligns with the file-level changes shown in the summary.
Description check ✅ Passed The description mentions 'use the new createUseFetch', which relates to the changeset's main objective of refactoring useCustomFetch. Though minimal, it is not off-topic or completely unrelated.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch update-custom-fetch

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

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@examples/advanced/use-custom-fetch-composable/composables/useCustomFetch.ts`:
- Around line 1-4: The factory callback in useCustomFetch currently spreads
callerOptions into the returned object which allows a caller-provided $fetch to
override the intended useNuxtApp().$customFetch; update the callback for
createUseFetch (in useCustomFetch) to return only $fetch:
useNuxtApp().$customFetch (and any other fixed defaults) and remove the
...callerOptions spread so $customFetch is enforced via the callback override
mechanism (keep callerOptions passed to createUseFetch as-is but do not merge it
into the factory return), ensuring plugins/customFetch.ts auth/401 handling
remains in effect.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9f8f0b69-f8b7-46d2-8e88-d970edb0031c

📥 Commits

Reviewing files that changed from the base of the PR and between 891eedf and 1d24122.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • examples/advanced/use-custom-fetch-composable/composables/useCustomFetch.ts
  • package.json
  • shared/package.json

Comment thread examples/advanced/use-custom-fetch-composable/composables/useCustomFetch.ts Outdated
@maximepvrt maximepvrt changed the title udpate custom fetch feat: refactor useCustomFetch to use createUseFetch Apr 22, 2026
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.

1 participant