Skip to content
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

fix: async functions in store are preserved #1612

Merged
merged 16 commits into from
Oct 28, 2024
Merged

Conversation

liamdebeasi
Copy link
Contributor

@liamdebeasi liamdebeasi commented Oct 28, 2024

Description

Async arrow functions in state currently cause Mitosis to crash. Similarly, async methods cause Mitosis to crash.

I fixed this by accounting for async when creating the function expression. I needed to add a separate code path here, but that is documented in the code.

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 Oct 28, 2024

🦋 Changeset detected

Latest commit: 2a39680

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 Oct 28, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 2a39680. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 4 targets

Sent with 💌 from NxCloud.

Copy link

cloudflare-workers-and-pages bot commented Oct 28, 2024

Deploying mitosis with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2a39680
Status: ✅  Deploy successful!
Preview URL: https://1dd75769.mitosis-9uh.pages.dev
Branch Preview URL: https://ld-async-store-function.mitosis-9uh.pages.dev

View logs

@liamdebeasi liamdebeasi changed the title test: add failing test fix: respect async with anonymous arrow function in state Oct 28, 2024
@liamdebeasi liamdebeasi marked this pull request as ready for review October 28, 2024 22:27
@liamdebeasi liamdebeasi marked this pull request as draft October 28, 2024 22:31
@liamdebeasi liamdebeasi marked this pull request as ready for review October 28, 2024 22:51
@liamdebeasi liamdebeasi changed the title fix: respect async with anonymous arrow function in state fix: async functions in store are preserved Oct 28, 2024
@steve8708 steve8708 merged commit 5e2cf3c into main Oct 28, 2024
13 checks passed
@steve8708 steve8708 deleted the ld/async-store-function branch October 28, 2024 23:04
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