-
Notifications
You must be signed in to change notification settings - Fork 627
feat: support components starting with number for builder json #1786
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
Conversation
🦋 Changeset detectedLatest commit: c04abac The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
|
View your CI Pipeline Execution ↗ for commit c04abac
☁️ Nx Cloud last updated this comment at |
| let nodeName = block.component?.name?.replace(/[^a-z0-9]/gi, ''); | ||
| // Handle component names starting with numbers (invalid in most frameworks) | ||
| if (block.component?.name && nodeName && /^\d/.test(nodeName)) { | ||
| dataAttributes['data-builder-originalName'] = block.component?.name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this get used anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is being used to support component names that have a colon in them.
Code pointer : https://github.com/BuilderIO/mitosis/blob/main/packages/core/src/generators/builder/generator.ts#L143-L145
https://github.com/BuilderIO/mitosis/blob/main/packages/core/src/parsers/builder/builder.ts#L813
|
is the use case for this feature documented somewhere? a component name that starts with a number is invalid in most JS frameworks (as noted in your PR), so I'm not sure why we would want to support this. |
This came as a support request for a customer who has this as a go live blocker , slack thread : https://builder-internal.slack.com/archives/C02BYBATRFE/p1761918133106149 |
|
Closing this PR. As a workaround for the customer, we are disabling the Assistant Tab in the Content Editor for the customer. |
Description
Loom: https://www.loom.com/share/6dafaca96a96456cb71bc21a0dc54cb7
Make sure to follow the PR preparation steps in CONTRIBUTING.md before submitting your PR:
yarn fmt:prettier.yarn test:updateyarn g:changesetand follow the CLI instructions. Alternatively, use the Changeset Github Bot to create the file.