Repository navigation
feat: ship "use client" on stateful components - #66
Merged
TheGreatAxios merged 1 commit intoSep 27, 2026
Conversation
TheGreatAxios
force-pushed
the
cl-9103-react-ui-ship-use-client-directives-on-stateful-components
branch
2 times, most recently
from
September 25, 2026 21:55
9d39c69 to
b4e1795
Compare
TheGreatAxios
changed the base branch from
main
to
cl-9080-react-ui-move-dark-mode-paragraphs-from-quickstart-to-a
September 25, 2026 21:55
TheGreatAxios
force-pushed
the
cl-9103-react-ui-ship-use-client-directives-on-stateful-components
branch
from
September 26, 2026 01:32
b4e1795 to
c5ab71f
Compare
TheGreatAxios
force-pushed
the
cl-9103-react-ui-ship-use-client-directives-on-stateful-components
branch
from
September 26, 2026 01:37
c5ab71f to
b4e2bc2
Compare
Component modules that call a hook, create a context, or import a Radix dialog, dropdown-menu or tooltip, or sonner, start with the directive; SWC keeps it in dist. dep-guard fails when a component's directive does not match what it does.
TheGreatAxios
force-pushed
the
cl-9103-react-ui-ship-use-client-directives-on-stateful-components
branch
from
September 26, 2026 01:56
b4e2bc2 to
e6ef9ca
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #69. Merge after it.
ui/andblocks/modules start with"use client": the ones that call a hook, create a context, define an inline event handler, or import an optional peer. SWC keeps the directive indist/, so a React Server Components app imports them without its own client wrapper. Outside RSC the directive is a no-op. Vite logs the same "module level directives" warning it logs for Radix.dep-guardrule 3 fails when a component's directive does not match what it does. It builds the peer pattern fromOPTIONAL_PEERS, ignores comments, and catches generic hook calls (useState<T>(). After a build it also fails when a marked module'sdist/file lost the directive, andbun run buildnow ends withdep-guard.dep-guardflags them.Verification
typecheck,lint,dep-guard,bun testandbun run buildpass. Deleting the directive from a builtdist/ui/switch.jsmakesdep-guardfail. A Vite production build and the Playwright suite pass against the packed tarball of the merged stack.Closes CL-9103