Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(shadcn): fix transformRsc to account for ' #5518

Merged
merged 3 commits into from
Oct 23, 2024

Conversation

bcorbold
Copy link
Contributor

For external registry files that use single quote formatting, the 'use client' directive will not be removed for projects with rsc: false configured due to the transformRsc util

This PR updates the equality check to a regex to fix this use case

Sandbox env

https://codesandbox.io/p/devbox/dark-hill-lht8mm

  1. Run pnpx shadcn@latest add http://localhost:3000/registry/custom-button.json
  2. Output custom-button.tsx will still have the directive even though rsc is set to false in the components.json

Copy link

vercel bot commented Oct 23, 2024

@bcorbold is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Collaborator

@shadcn shadcn left a comment

Choose a reason for hiding this comment

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

Looks good. Thank you.

@shadcn shadcn added bug Something isn't working area: shadcn labels Oct 23, 2024
Copy link

vercel bot commented Oct 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
ui ⬜️ Ignored (Inspect) Visit Preview Oct 23, 2024 7:31am

@shadcn shadcn merged commit bf5a79c into shadcn-ui:main Oct 23, 2024
5 checks passed
@bcorbold bcorbold deleted the fix-single-quote-directive branch October 23, 2024 16:50
niktekusho pushed a commit to niktekusho/shadcnui that referenced this pull request Nov 21, 2024
* fix(shadcn): fix transformRsc to account for '

* chore: add changeset

---------

Co-authored-by: shadcn <m@shadcn.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: shadcn bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants