Skip to content

fix: improve binding validation #1739

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

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

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.

Copy link

changeset-bot bot commented Apr 1, 2025

🦋 Changeset detected

Latest commit: 13896d5

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

Copy link

nx-cloud bot commented Apr 1, 2025

View your CI Pipeline Execution ↗ for commit 13896d5.

Command Status Duration Result
nx run-many --target test ❌ Failed 5m 8s View ↗
nx run-many -t test:update ✅ Succeeded 5m 2s View ↗
nx e2e @builder.io/e2e-app ✅ Succeeded 1m 5s View ↗
nx run-many --target build --exclude @builder.i... ✅ Succeeded 3m 48s View ↗
nx build @builder.io/mitosis-site ✅ Succeeded 2m 21s View ↗

☁️ Nx Cloud last updated this comment at 2025-04-18 17:33:39 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
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.

1 participant