Skip to content

Conversation

@DACONLEEHANGYU
Copy link

@DACONLEEHANGYU DACONLEEHANGYU commented Jan 25, 2026

Fixes #9740

Added rollup onwarn handler to suppress UNUSED_EXTERNAL_IMPORT warnings for @tanstack/query-core imports. These warnings are false positives as the imports (notifyManager, replaceEqualDeep) are actually used in the compiled code but Rollup's tree-shaking analysis fails to detect this in Svelte 5's runes context ($effect, $state, $derived).

The warning appeared during SvelteKit project builds mentioning:

  • notifyManager (used in createMutation.svelte.ts)
  • replaceEqualDeep (used in useMutationState.svelte.ts)

🎯 Changes

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Chores
    • Updated build configuration to suppress false-positive warnings during the build process, resulting in cleaner build output.

✏️ Tip: You can customize this high-level summary in your review settings.

Fixes TanStack#9740

Added rollup onwarn handler to suppress UNUSED_EXTERNAL_IMPORT warnings
for @tanstack/query-core imports. These warnings are false positives as
the imports (notifyManager, replaceEqualDeep) are actually used in the
compiled code but Rollup's tree-shaking analysis fails to detect this
in Svelte 5's runes context ($effect, $state, $derived).

The warning appeared during SvelteKit project builds mentioning:
- notifyManager (used in createMutation.svelte.ts)
- replaceEqualDeep (used in useMutationState.svelte.ts)
@changeset-bot
Copy link

changeset-bot bot commented Jan 25, 2026

⚠️ No Changeset found

Latest commit: ebb6ecf

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 25, 2026

📝 Walkthrough

Walkthrough

A build.rollupOptions.onwarn handler was added to the Vite configuration for svelte-query. The handler filters out false-positive warnings from Rollup when external imports from @tanstack/query-core are flagged as unused, while preserving all other warnings in the build process.

Changes

Cohort / File(s) Summary
Build configuration warning suppression
packages/svelte-query/vite.config.ts
Added build.rollupOptions.onwarn handler to suppress UNUSED_EXTERNAL_IMPORT warnings from @tanstack/query-core during Rollup bundling; all other warnings pass through unchanged

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • TkDodo

Poem

🐰 A bundle of joy, no warnings in sight,
Query imports now flow without fright,
Rollup's false alarms we gently suppress,
Svelte builds clean—pure success! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is incomplete: the 'Changes' section header is present but empty with only a placeholder comment, and neither checklist item nor release impact option is checked. Fill in the Changes section with details about the vite.config.ts modifications and check relevant checklist/release impact items to indicate completion status.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: suppressing false positive unused import warnings in svelte-query.
Linked Issues check ✅ Passed The PR directly addresses issue #9740 by implementing the rollup onwarn handler to suppress UNUSED_EXTERNAL_IMPORT warnings for @tanstack/query-core, meeting the stated requirement.
Out of Scope Changes check ✅ Passed All changes are scoped to the stated objective: only vite.config.ts was modified to add the warning suppression handler targeting @tanstack/query-core imports.
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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Query V6 for Svelte warning on building

1 participant