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

feat: add typescript support for useStore<T> #1555

Merged
merged 9 commits into from
Sep 30, 2024

Conversation

nmerget
Copy link
Contributor

@nmerget nmerget commented Sep 6, 2024

Description

Please provide the following information:

Add TypeScript support for useStore<T> for those generators:

  • React
  • Angular
  • Vue

The implementation should work for other generators as well, but I'm not into most outputs. typeParameter is provided for useStore correctly, so it might work (Vue works out of the box, because of the correct implementation)

closes #1112

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 Sep 6, 2024

🦋 Changeset detected

Latest commit: c7397d0

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 Sep 6, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit c7397d0. 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.

@nmerget nmerget marked this pull request as ready for review September 9, 2024 14:15
Copy link
Contributor

@samijaber samijaber left a comment

Choose a reason for hiding this comment

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

Awesome! I'm requesting changes to the React generator because the any default is bad, but otherwise LGTM 👍🏽

packages/core/src/__tests__/test-generator.ts Show resolved Hide resolved
packages/core/src/generators/react/state.ts Outdated Show resolved Hide resolved
@samijaber samijaber merged commit 068efab into BuilderIO:main Sep 30, 2024
6 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.

Preserve or generate the return types of state methods
2 participants