Skip to content

docs(readme): clarify prefetch via client bundle#465

Merged
antfu merged 3 commits into
nuxt:mainfrom
onmax:docs/issue-99-prefetch
Feb 24, 2026
Merged

docs(readme): clarify prefetch via client bundle#465
antfu merged 3 commits into
nuxt:mainfrom
onmax:docs/issue-99-prefetch

Conversation

@onmax

@onmax onmax commented Feb 22, 2026

Copy link
Copy Markdown
Contributor

Fixes #99

Clarifies in README.md how to prefetch icons with clientBundle:

  • explicit icons via clientBundle.icons
  • static extraction via clientBundle.scan
  • optional provider: 'none' for no runtime fetching

@coderabbitai

coderabbitai Bot commented Feb 22, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

Two new README.md sections were added under Client Bundle configuration: "Disabling Runtime Fetching" (showing provider: 'none') and "Prefetch (Preload) Icons". The Prefetch section documents two approaches for clientBundle preloading: explicit pre-bundling with scan: false and static scanning with scan: true plus an icons list, and notes that static scanning only detects literal icon names. The Prefetch guidance and code samples were added in two places, resulting in duplication. No public API or exported signatures were changed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: clarifying prefetch documentation via clientBundle in the README.
Description check ✅ Passed The description is directly related to the changeset, explaining the three prefetch approaches documented in README.md updates.
Linked Issues check ✅ Passed The PR addresses issue #99 by documenting three prefetch approaches: explicit icons via clientBundle.icons, static extraction via clientBundle.scan, and provider: 'none' option.
Out of Scope Changes check ✅ Passed The changes are limited to README.md documentation and are directly aligned with the issue #99 requirement to clarify icon prefetching.
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 unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
README.md (2)

487-502: Redundant provider: 'none' example — already documented at lines 231–243.

Lines 231–243 already show this exact pattern:

icon: {
  provider: 'none',
  clientBundle: { scan: true, /* ...or other bundle options */ }
}

The new block at lines 489–502 repeats the same guidance. Consider replacing it with a brief cross-reference (e.g., > See also [Custom Local Collections](#custom-local-collections) for the \provider: 'none'` pattern.`) or consolidating the examples.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 487 - 502, Remove the duplicated example that sets
provider: 'none' with a clientBundle block and instead replace that block with a
brief cross-reference to the existing "Custom Local Collections" section (which
already shows icon: { provider: 'none', clientBundle: {...} }); update the new
example location to a single line like "> See also [Custom Local
Collections](`#custom-local-collections`) for the provider: 'none' + clientBundle
pattern" so the README only documents provider: 'none' once while preserving
discoverability of clientBundle usage.

504-507: TIP duplicates the existing tip under "Scan Components" (lines 559–570).

The "Scan Components" subsection already contains a [!TIP] with the same message and a concrete Vue template example illustrating literal vs. dynamic name patterns. The new tip (lines 504–507) repeats only the prose without the example, offering less context. Consider removing the new tip and pointing readers to the existing, richer one:

-> [!TIP]
-> Static scanning relies on literal values. Dynamically generated icon names are not reliably detected, so add them explicitly in `clientBundle.icons`.
-> This is also useful for component-test setups documented in [Rendering Icons in Component Tests](`#rendering-icons-in-component-tests`).
+> [!TIP]
+> Static scanning only detects literal icon names. See [Scan Components](`#scan-components`) for details, and [Rendering Icons in Component Tests](`#rendering-icons-in-component-tests`) for test-environment setup.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 504 - 507, Remove the duplicated [!TIP] block at the
earlier location (the one advising to add icon names to clientBundle.icons) and
replace it with a short cross-reference to the existing "Scan Components"
subsection that already contains the full tip and Vue template example;
specifically, delete the redundant tip text and add a sentence linking readers
to "Scan Components" for the richer guidance and example demonstrating literal
vs dynamic icon name patterns (mentioning clientBundle.icons as the
configuration key).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@README.md`:
- Around line 449-507: The inserted "Prefetch (Preload) Icons" subsection left
the full clientBundle options block (the code example that shows icons, scan,
includeCustomCollections, sizeLimitKb) orphaned and visually nested; add a short
heading such as "#### Available Options" immediately before that full-options
code block to re-anchor it as the canonical reference under the broader Client
Bundle section so readers can clearly distinguish the prefetch examples from the
comprehensive configuration example.

---

Nitpick comments:
In `@README.md`:
- Around line 487-502: Remove the duplicated example that sets provider: 'none'
with a clientBundle block and instead replace that block with a brief
cross-reference to the existing "Custom Local Collections" section (which
already shows icon: { provider: 'none', clientBundle: {...} }); update the new
example location to a single line like "> See also [Custom Local
Collections](`#custom-local-collections`) for the provider: 'none' + clientBundle
pattern" so the README only documents provider: 'none' once while preserving
discoverability of clientBundle usage.
- Around line 504-507: Remove the duplicated [!TIP] block at the earlier
location (the one advising to add icon names to clientBundle.icons) and replace
it with a short cross-reference to the existing "Scan Components" subsection
that already contains the full tip and Vue template example; specifically,
delete the redundant tip text and add a sentence linking readers to "Scan
Components" for the richer guidance and example demonstrating literal vs dynamic
icon name patterns (mentioning clientBundle.icons as the configuration key).

Comment thread README.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 `@README.md`:
- Line 487: Add a named HTML anchor immediately above the code block that shows
the provider: 'none' example (the specific snippet referenced in the README) and
update the existing cross-reference link text on line 487 to point to that new
anchor instead of `#custom-local-collections`; locate the provider: 'none' code
block in README.md, insert something like <a name="provider-none"></a> directly
above it, and change the link target from (`#custom-local-collections`) to
(`#provider-none`) so users land directly on the relevant example.

Comment thread README.md Outdated
@antfu
antfu merged commit b45023d into nuxt:main Feb 24, 2026
2 checks passed
@onmax
onmax deleted the docs/issue-99-prefetch branch February 24, 2026 09:55
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.

[ nuxt-icon module ] How to prefetch my icons?

2 participants