Skip to content

chore(react): remove clsx dependency (KNO-13814)#1020

Closed
kylemcd wants to merge 1 commit into
mainfrom
kyle-kno-13814-remove-the-clsx-dependency-from-knocklabsreact-native
Closed

chore(react): remove clsx dependency (KNO-13814)#1020
kylemcd wants to merge 1 commit into
mainfrom
kyle-kno-13814-remove-the-clsx-dependency-from-knocklabsreact-native

Conversation

@kylemcd

@kylemcd kylemcd commented Jun 17, 2026

Copy link
Copy Markdown
Member

Description

Removes the clsx runtime dependency from @knocklabs/react. Every call site was the simple "merge a static class with the incoming className prop" pattern (e.g. clsx("knock-guide-banner", className)), so all ~29 sites across the guide components now compose className natively:

className={["knock-guide-banner", className].filter(Boolean).join(" ")}

No cx/clsx helper is vendored — zero added utility code, one fewer runtime dependency.

What changed

  • Banner.tsx, Card.tsx, Modal.tsx in the guide module — replaced every clsx(...) call with native composition.
  • Dropped clsx from packages/react/package.json and updated the lockfile.

clsx still appears in the lockfile, but only as a transitive dependency of the @telegraph/* packages — it is no longer a direct dependency of ours.

Why: Part of the npm supply chain hardening effort — fewer third-party runtime dependencies in our (and our consumers') install graphs.

Linear: KNO-13814


Stack (bottom → top) — npm supply chain hardening:

  1. chore(react): remove clsx dependency (KNO-13814) #1020 — remove clsx from @knocklabs/react ◀ this PR
  2. chore(client): internalize jwt-decode (KNO-13812) #1021 — internalize jwt-decode in @knocklabs/client
  3. chore(react): internalize lodash.debounce (KNO-13811) #1022 — internalize lodash.debounce in @knocklabs/react
  4. chore(react-core): internalize fast-deep-equal (KNO-13810) #1023 — internalize fast-deep-equal in @knocklabs/react-core

Checklist

  • Pure refactor with no behavior change; existing guide tests and the full suite pass (yarn test).

@linear-code

linear-code Bot commented Jun 17, 2026

Copy link
Copy Markdown

KNO-13814

@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
javascript-ms-teams-connect-example Ready Ready Preview, Comment Jun 17, 2026 2:24pm
javascript-nextjs-example Ready Ready Preview, Comment Jun 17, 2026 2:24pm
javascript-slack-connect-example Ready Ready Preview, Comment Jun 17, 2026 2:24pm
javascript-slack-kit-example Ready Ready Preview, Comment Jun 17, 2026 2:24pm

Request Review

kylemcd commented Jun 17, 2026

Copy link
Copy Markdown
Member Author

@changeset-bot

changeset-bot Bot commented Jun 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d8d7d22

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@knocklabs/react Patch
ms-teams-connect-example Patch
nextjs-app-dir-example Patch
slack-connect-example Patch
slack-kit-example Patch

Not sure what this means? Click here to learn what changesets are.

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

@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 46.84685% with 59 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.44%. Comparing base (24a8bb2) to head (d8d7d22).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...react/src/modules/guide/components/Modal/Modal.tsx 0.00% 34 Missing ⚠️
...s/react/src/modules/guide/components/Card/Card.tsx 57.77% 19 Missing ⚠️
...act/src/modules/guide/components/Banner/Banner.tsx 81.25% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1020      +/-   ##
==========================================
- Coverage   63.55%   63.44%   -0.12%     
==========================================
  Files         208      208              
  Lines        9924    10000      +76     
  Branches     1280     1280              
==========================================
+ Hits         6307     6344      +37     
- Misses       3592     3631      +39     
  Partials       25       25              
Files with missing lines Coverage Δ
...act/src/modules/guide/components/Banner/Banner.tsx 75.95% <81.25%> (+1.42%) ⬆️
...s/react/src/modules/guide/components/Card/Card.tsx 58.20% <57.77%> (+0.16%) ⬆️
...react/src/modules/guide/components/Modal/Modal.tsx 20.76% <0.00%> (-2.35%) ⬇️

@kylemcd

kylemcd commented Jun 17, 2026

Copy link
Copy Markdown
Member Author

Combined into #1024.

@kylemcd kylemcd closed this Jun 17, 2026
@kylemcd kylemcd deleted the kyle-kno-13814-remove-the-clsx-dependency-from-knocklabsreact-native branch June 17, 2026 14:51
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