Skip to content

Conversation

@midhunadarvin
Copy link
Contributor

@midhunadarvin midhunadarvin commented Jun 19, 2025

Description

Please provide the following information:

  • What changes you made:

    • Correctly convert For loop in Mitosis JSX to repeat.collection in Builder JSON
  • Why you made them, and:

    • Mitosis JSX

      <For each={[1,2,3]}>
        <div>Hello</div>
      </For>
      

      Currently the For loop in Mitosis JSX is converted to the following in Builder JSON

      Builder JSON within a builder block

      "repeat": {
          "collection": "[1, 2, 3]"
       },
      

      Which is not valid builder JSON, and it should be assigned a value in the data.state object in Builder JSON. This PR corrects the conversion so that the repeat.collection property is populated correctly.

  • Any other useful context:

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.

@midhunadarvin midhunadarvin requested a review from samijaber as a code owner June 19, 2025 17:53
@changeset-bot
Copy link

changeset-bot bot commented Jun 19, 2025

🦋 Changeset detected

Latest commit: 9a0ffe8

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 Jun 19, 2025

View your CI Pipeline Execution ↗ for commit 9a0ffe8.

Command Status Duration Result
nx run-many --target test ✅ Succeeded 5m 14s View ↗
nx e2e @builder.io/e2e-app ✅ Succeeded 1m 17s View ↗
nx run-many --target build --exclude @builder.i... ✅ Succeeded 3m 47s View ↗
nx build @builder.io/mitosis-site ✅ Succeeded 2m 25s View ↗

☁️ Nx Cloud last updated this comment at 2025-06-24 16:00:48 UTC

Copy link
Contributor

@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.

Good to merge once final comment is resolved. good job!

@midhunadarvin midhunadarvin merged commit 22ba7c0 into BuilderIO:main Jun 24, 2025
7 checks passed
@midhunadarvin midhunadarvin deleted the ENG-9092 branch June 24, 2025 16:05
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.

2 participants