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

Introduce inferrable TConfig #4262

Closed
wants to merge 14 commits into from
Closed

Introduce inferrable TConfig #4262

wants to merge 14 commits into from

Conversation

Andarist
Copy link
Member

@Andarist Andarist commented Sep 8, 2023

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Sep 8, 2023

⚠️ No Changeset found

Latest commit: c4cad26

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 8, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit c4cad26:

Sandbox Source
XState Example Template Configuration
XState React Template Configuration

@Andarist
Copy link
Member Author

Unfortunately, it deoptimizes when typed invokes are involved. I prepared a minimal repro case here: TS playground

@Andarist
Copy link
Member Author

Ok, so I couldn't resist and I peeked under the hood to see what is being inferred in the first pass internally. It seems that we run into the same problem as we were running before. The problem was just more apparent before because we ended up with a visible error. Now the problem is still there but it gets somewhat swallowed. The invoke.src property widens to string within the inferred TConfig and then it fails the constraint check. We can observe the error if we provide the computed inference candidates directly as type arguments here: TS playground

And this is actually fixable using the trick that I applied in one of those previous PRs: TS playground.

I'm ready to get back in the game

(but I still think this is a post-release item)

@Andarist
Copy link
Member Author

Superseded by #4498

@Andarist Andarist closed this Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant