Skip to content

fix: improve binding validation#1739

Merged
midhunadarvin merged 16 commits intoBuilderIO:mainfrom
liamdebeasi:ENG-8931
Jun 27, 2025
Merged

fix: improve binding validation#1739
midhunadarvin merged 16 commits intoBuilderIO:mainfrom
liamdebeasi:ENG-8931

Conversation

@liamdebeasi
Copy link
Contributor

@liamdebeasi liamdebeasi commented Apr 1, 2025

Description

The invalid binding detection misses code that is valid JS but is not a valid binding such as export default foo. This PR improves the detection by checking if the code can be used as a binding when passed into babel.

I'm also using the parseCode util now because it has presets that are needed to parse JSX/TSX.

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 Apr 1, 2025

🦋 Changeset detected

Latest commit: 520005a

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 Apr 1, 2025

View your CI Pipeline Execution ↗ for commit 520005a.

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

☁️ Nx Cloud last updated this comment at 2025-06-27 16:22:32 UTC

@liamdebeasi liamdebeasi marked this pull request as ready for review April 1, 2025 14:58
@liamdebeasi liamdebeasi requested a review from samijaber as a code owner April 1, 2025 14:58
@liamdebeasi liamdebeasi marked this pull request as draft April 1, 2025 17:17
@midhunadarvin midhunadarvin marked this pull request as ready for review June 24, 2025 13:30
Copy link
Contributor Author

@liamdebeasi liamdebeasi left a comment

Choose a reason for hiding this comment

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

overall looks good! a few small comments. you'll need to get an approval from someone other than me since I'm the PR author

@midhunadarvin midhunadarvin enabled auto-merge (squash) June 27, 2025 16:15
@midhunadarvin midhunadarvin merged commit 314b396 into BuilderIO:main Jun 27, 2025
7 checks passed
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