Skip to content

build: replace cnfast with cn - #820

Open
mattrothenberg wants to merge 2 commits into
mainfrom
codex/migrate-to-cn
Open

mattrothenberg wants to merge 2 commits into
mainfrom
codex/migrate-to-cn

Conversation

@mattrothenberg

@mattrothenberg mattrothenberg commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • replace cnfast with cn@0.4.0
  • keep Kumo's internal cn API unchanged
  • update the styling vendor chunk match and add a patch changeset

Follow-up to #775.

Validation

  • git diff --check

  • dependency installation is expected to fail temporarily because cn@0.4.0 has not yet aged past the repository's minimum-release-age cutoff

  • Reviews

  • bonk has reviewed the change

  • automated review not possible because: no automated review was available before opening the pull request

  • Tests

  • Tests included/updated

  • Automated tests not possible - manual testing has been completed as follows: not applicable

  • Additional testing not necessary because: the existing cn utility suite covers the unchanged class merging API and will run after the release-age gate passes

@pkg-pr-new

pkg-pr-new Bot commented Sep 22, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/@cloudflare/kumo@820

commit: 8963139

@ask-bonk

ask-bonk Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

LGTM!

Review notes
  • Confirming the checked-out PR target and reviewing its diff, package guidance, dependency lockfile changes, and prior reviews before assessing behavior.
  • PR build: replace cnfast with cn #820 is open at the requested head SHA 89631392d18bc60b85f4e3bac43b7e10e61d2896; no prior reviews exist. The local checkout lacks origin/main, so I will compare the single PR commit with its parent and validate the replacement package's exported behavior from the installed dependency.
  • The one-commit diff cleanly replaces cnfast with cn@0.3.0, updates the bundle split matcher, lockfile, and patch changeset. The workspace toolchain is not installed (pnpm is unavailable), so I am inspecting the utility's existing compatibility tests and both package distributions directly rather than running them.
  • The updated package exposes the same named cn export, is ESM/CJS-compatible, and requires Node 20+, which is within Kumo's Node 24+ policy. Existing tests cover the changed utility's documented class-merge cases, including conditional and nested inputs; next I am comparing both implementations against that suite in memory and checking package declarations/source for unsupported API differences.
  • cnfast@0.0.8 passes all 13 existing utility cases when evaluated directly from its published distribution. The initial equivalent check for cn@0.3.0 could not run because its ESM entry has relative chunks and no local install; I am resolving those published chunks in memory, then will compare the public type contracts and Kumo call sites.
  • The Kumo cn re-export is public from both the root package entry and @cloudflare/kumo/utils. The new package's declared cn function supports ordinary clsx-style values, while the prior dependency also exposed a tagged-template overload; I am verifying whether that supported form is documented or used and checking its runtime behavior before deciding whether it is a compatibility finding.
  • Completed the compatibility check: the published cn@0.3.0 implementation passes all 13 existing cases, including nested conditional inputs, and produces the same tagged-template output as cnfast@0.0.8. No repository call sites use tagged templates. git diff --check passed; package unit tests could not run because this read-only checkout has no installed workspace dependencies or pnpm binary.

github run

@github-actions

Copy link
Copy Markdown
Contributor

📐 Bundle Size

Consumer fixtures bundled against packages/kumo/dist (peers external, minified ESM).

Fixture Raw Gzip Brotli
Button (root) 165.2 KB 50.5 KB 43.8 KB
Button (components/button) 165.1 KB 50.5 KB 43.8 KB
Button + Dialog + Select (root) 290.1 KB 86.4 KB 72.5 KB
Button + Dialog + Select (component subpaths) 290.0 KB 86.4 KB 72.6 KB
Chart (root) 237.7 KB 71.7 KB 61.5 KB
Chart (components/chart) 237.7 KB 71.7 KB 61.6 KB
Badge (components/badge) 35.4 KB 12.3 KB 10.8 KB
Flow (components/flow) 199.6 KB 58.9 KB 51.4 KB
Button (primitives/button) 12.2 KB 4.4 KB 3.9 KB
Primitives barrel 635.8 KB 176.9 KB 139.3 KB
Code highlighting (code) 2.07 MB 468.6 KB 349.9 KB

npm tarball: 544 files, 1.49 MB packed, 6.90 MB unpacked.

⚠️ 23 flagged files in tarball (tests / raw scripts)
  • dist/blocks-source/resource-list/resource-list.test.tsx
  • scripts/component-registry/cache.ts
  • scripts/component-registry/discovery.ts
  • scripts/component-registry/example-cleanup.ts
  • scripts/component-registry/index.test.ts
  • scripts/component-registry/index.ts
  • scripts/component-registry/markdown-generator.ts
  • scripts/component-registry/metadata.ts
  • scripts/component-registry/props-filter.ts
  • scripts/component-registry/schema-generator.ts
  • scripts/component-registry/sub-components.ts
  • scripts/component-registry/types.ts
  • scripts/component-registry/utils.ts
  • scripts/component-registry/variant-parser.ts
  • scripts/css-build.ts
  • scripts/generate-globe-land-mask.mjs
  • scripts/generate-primitives.ts
  • scripts/theme-generator/config.ts
  • scripts/theme-generator/generate-css.test.ts
  • scripts/theme-generator/generate-css.ts
  • scripts/theme-generator/index.ts
  • scripts/theme-generator/migrate.ts
  • scripts/theme-generator/types.ts

Report-only: no size thresholds are enforced yet.

Commit: 89631392

@github-actions

github-actions Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Visual contracts

Linux Chromium references exercised by the PR's visual-contracts job.

1 curated contract

truncating text trigger

truncating text trigger

@mattrothenberg mattrothenberg self-assigned this Sep 22, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Failed ❌

View logs ↗
3ef6dc1 2026-09-22T13:56:04.692Z View logs ↗

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