Skip to content

Conversation

@midhunadarvin
Copy link
Contributor

@midhunadarvin midhunadarvin commented Nov 3, 2025

Description

  • support components starting with number for builder json

Loom: https://www.loom.com/share/6dafaca96a96456cb71bc21a0dc54cb7

Make sure to follow the PR preparation steps in CONTRIBUTING.md before submitting your PR:

  • format the codebase: from the root, run yarn fmt:prettier.
  • update all snapshots (in core & CLI): from the root, run yarn test:update
  • add Changeset entry: from the root, run yarn g:changeset and follow the CLI instructions. Alternatively, use the Changeset Github Bot to create the file.

@changeset-bot
Copy link

changeset-bot bot commented Nov 3, 2025

🦋 Changeset detected

Latest commit: c04abac

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

This PR includes changesets to release 2 packages
Name Type
@builder.io/mitosis Patch
@builder.io/mitosis-cli 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

@nx-cloud
Copy link

nx-cloud bot commented Nov 3, 2025

View your CI Pipeline Execution ↗ for commit c04abac

Command Status Duration Result
nx run-many --target test ✅ Succeeded 5m 7s View ↗
nx e2e @builder.io/e2e-app ✅ Succeeded 1m 27s View ↗
nx run-many --target build --exclude @builder.i... ✅ Succeeded 1s View ↗
nx build @builder.io/mitosis-site ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-11-03 16:01:25 UTC

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;
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@liamdebeasi
Copy link
Contributor

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.

@midhunadarvin
Copy link
Contributor Author

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

@midhunadarvin
Copy link
Contributor Author

Closing this PR. As a workaround for the customer, we are disabling the Assistant Tab in the Content Editor for the customer.

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.

4 participants