Skip to content

chore: replace astro-icon with nimbus-docs Icon component - #32647

Open
mvvmm wants to merge 6 commits into
productionfrom
chore/nimbus-icon-replacement
Open

chore: replace astro-icon with nimbus-docs Icon component#32647
mvvmm wants to merge 6 commits into
productionfrom
chore/nimbus-icon-replacement

Conversation

@mvvmm

@mvvmm mvvmm commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

What

Replaces astro-icon with the built-in icon system from cloudflare/nimbus#76 (commit acfac20).

Changes

  • Removed astro-icon from package.json, astro.config.ts, and all 53 component/page files
  • Replaced all importsimport { Icon } from "astro-icon/components"import Icon from "@cloudflare/nimbus-docs/components/Icon.astro"
  • Collapsed AstroIcon aliasIcon and AstroIcon were the same component; merged all usage to Icon
  • Updated virtual modulevirtual:astro-iconvirtual:nimbus/icons in directory.astro
  • Removed @ts-expect-error — the nimbus integration injects types for virtual:nimbus/icons

Why

astro-icon stamps a lastModified timestamp into its virtual module on every build, invalidating Astro's incremental build cache for thousands of pages. The package hasn't had a commit in 2+ years. Nimbus#76 replaces it with a built-in Vite plugin that omits lastModified, making the cache stable.

The nimbus PR also includes a workaround for the css-tree createRequire bug (svgo#2149) that breaks Vite prerendering — it redirects css-tree and csso to their browser bundles which have JSON data inlined.

Verification

  • pnpm run check — 0 errors, 0 warnings, 0 hints
  • pnpm run lint — clean
  • pnpm run format:core:check — clean

After merge of nimbus#76

Revert the @cloudflare/nimbus-docs dependency to the published version (remove the pkg.pr.new URL).

Tests the astro-icon replacement PR in cloudflare/nimbus#76.
Uses pkg.pr.new preview build from commit acfac20.
@mvvmm
mvvmm requested review from a team as code owners August 10, 2026 20:21
@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review

Reviewing new changes (commit f10afdc)…


⚠️ 2 warnings found in commit 84574ab.

👉 Fix in your agent 👈
Fix the following review findings in PR #32647 (https://github.com/cloudflare/cloudflare-docs/pull/32647).

Before making changes, review each finding and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification
- If you disagree (e.g. the fix requires disproportionate effort for minimal benefit,
  or the finding is factually incorrect), explain why
- If you need clarification before deciding, ask those questions
- Then share your plan for which issues to tackle and in what order

After triaging, follow this order:
1. Post a comment on this PR for any findings you are skipping, with the finding ID and your reasoning.
2. Then commit the fixes for the legitimate findings.

The comment must come before the commit — the bot reads PR comments when a new
push triggers a review, so skip comments posted after the push will be missed.

---

## Code Review

### Warnings (2)

#### CR-4fac1dfab0a3 · Unstable dependency source
- **File:** `package.json` line 56
- **Issue:** @cloudflare/nimbus-docs is resolved from https://pkg.pr.new/@cloudflare/nimbus-docs@76, a PR preview build, instead of a pinned npm registry version.
- **Fix:** Use a published, semver-pinned npm release of @cloudflare/nimbus-docs for production, or keep this change only as a temporary local/CI testing branch and do not merge it to production.

#### CR-f3a1cb31c3e5 · Supply chain risk
- **File:** `package.json` line 56
- **Issue:** Using a third-party PR preview service (pkg.pr.new) for a core framework dependency bypasses npm registry integrity checks and may pull in unreviewed or changing code every install.
- **Fix:** Consume @cloudflare/nimbus-docs from the npm registry with a pinned version and integrity hash so installs are reproducible and verified.

Code Review

This code review is in beta and may not always be helpful — use your judgment.

Warnings (2)
File Issue
package.json line 56 Unstable dependency source — @cloudflare/nimbus-docs is resolved from https://pkg.pr.new/@cloudflare/nimbus-docs@76, a PR preview build, instead of a pinned npm registry version. Fix: Use a published, semver-pinned npm release of @cloudflare/nimbus-docs for production, or keep this change only as a temporary local/CI testing branch and do not merge it to production.
package.json line 56 Supply chain risk — Using a third-party PR preview service (pkg.pr.new) for a core framework dependency bypasses npm registry integrity checks and may pull in unreviewed or changing code every install. Fix: Consume @cloudflare/nimbus-docs from the npm registry with a pinned version and integrity hash so installs are reproducible and verified.

Conventions

No convention issues found.

Style Guide Review

No style-guide issues found.

Commands

Only codeowners can run commands. Post a comment with the command to trigger it.

Command Description
/review Runs a review now. Incremental if a prior review exists, full if not.
/full-review Re-reviews the entire PR diff from scratch, ignoring incremental history. Useful after a rebase, when you want a fresh review, or if the bot gets out of sync and reports issues that no longer exist.
/ignore-review-limit Permanently lifts the 2-review automatic limit for this PR. Future pushes will trigger reviews as normal.
/disable-auto-review Stops automatic reviews from triggering on future pushes to this PR. Codeowners can still run /review or /full-review manually.
/rebase Rebases the PR branch against production. On conflict, attempts to resolve automatically using AI. Stops with an explanation if confidence is not high enough.

@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
*.ts @cloudflare/content-engineering, @kodster28
package.json @cloudflare/content-engineering
* @cloudflare/product-owners
*.astro @cloudflare/content-engineering, @kodster28
/src/components/agent-setup @cloudflare/product-owners, @cloudflare/ai-agents, @cloudflare/dev-plat-leads
/src/components/models/ @mchenco, @superhighfives, @ethulia, @kflansburg, @cloudflare/content-engineering, @cloudflare/product-owners, @kodster28
/src/content/docs/browser-run/ @mchenco, @cloudflare/product-owners, @celso, @kathayl, @meddulla, @simonabadoiu, @jonnyparris, @ruifigueira, @Refaerds, @omarmosid
/src/content/docs/style-guide/ @cloudflare/product-owners
/src/pages/agent-setup @cloudflare/product-owners, @cloudflare/ai-agents, @cloudflare/dev-plat-leads

@mvvmm
mvvmm marked this pull request as draft August 10, 2026 20:30
@mvvmm mvvmm changed the title chore: test nimbus-docs PR #76 (astro-icon replacement) chore: replace astro-icon with nimbus-docs Icon component Aug 10, 2026
@mvvmm
mvvmm force-pushed the chore/nimbus-icon-replacement branch from 94e2d42 to ae599f2 Compare August 10, 2026 20:37
- Replace all astro-icon imports with @cloudflare/nimbus-docs/components/Icon.astro
- Collapse AstroIcon alias to Icon (they were the same component)
- Update virtual:astro-icon to virtual:nimbus/icons in directory.astro
- Remove astro-icon from astro.config.ts and package.json
- Point @cloudflare/nimbus-docs at PR #76 preview build
@mvvmm
mvvmm force-pushed the chore/nimbus-icon-replacement branch from ae599f2 to 7850a5d Compare August 10, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant