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(next): ensure registry:ui components don't depend on themselves #1490

Merged
merged 7 commits into from
Nov 15, 2024

Conversation

ieedan
Copy link
Contributor

@ieedan ieedan commented Nov 15, 2024

fixes #1489

Previously if a component in the registry had a reference to itself it could add itself to its own registryDependencies. If not resolved correctly by the CLI this would result in stack overflows because of a circular dependency.

This PR fixes the CLI's handling of these circular dependencies as well as prevents them from being built into the registry by simply removing the component from it's own dependency array if it exists.

Copy link

changeset-bot bot commented Nov 15, 2024

⚠️ No Changeset found

Latest commit: 1702d88

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@ieedan ieedan changed the title fix(next): ensures registry:ui components don't depend on themselves fix(next): ensure registry:ui components don't depend on themselves Nov 15, 2024
Copy link
Contributor

github-actions bot commented Nov 15, 2024

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
shadcn-svelte ✅ Ready (View Log) Visit Preview 1702d88

@AdrianGonz97
Copy link
Collaborator

This is more so an error in the component itself rather than in the CLI. No components should ever have a reference to itself. Pushing a fix momentarily

@ieedan
Copy link
Contributor Author

ieedan commented Nov 15, 2024

This is more so an error in the component itself rather than in the CLI. No components should ever have a reference to itself. Pushing a fix momentarily

Wouldn't it still be a good thing to check since this is an easy mistake to make? Maybe instead of ignoring it would give an error while building?

@AdrianGonz97
Copy link
Collaborator

I guess we could add a an error for it in the build script so we can catch it early on

@ieedan
Copy link
Contributor Author

ieedan commented Nov 15, 2024

I guess we could add a an error for it in the build script so we can catch it early on

I think instead of removing it from the map it just reports an error and tries and help you along.

Would you like to add it or should I give it a shot?

@ieedan
Copy link
Contributor Author

ieedan commented Nov 15, 2024

haha guess we caught a few more!

@AdrianGonz97
Copy link
Collaborator

alright i think that's all of them

@AdrianGonz97 AdrianGonz97 merged commit a817cfb into huntabyte:next Nov 15, 2024
4 checks passed
@ieedan ieedan deleted the cli-stack-overflow branch November 15, 2024 17:02
@huntabyte
Copy link
Owner

Studs!

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.

3 participants