Skip to content

Introduce inferrable TConfig - #4262

Closed
Andarist wants to merge 14 commits into
nextfrom
tconfig
Closed

Andarist wants to merge 14 commits into
nextfrom
tconfig

Conversation

@Andarist

@Andarist Andarist commented Sep 8, 2023

Copy link
Copy Markdown
Collaborator

No description provided.

@changeset-bot

changeset-bot Bot commented Sep 8, 2023 •

Copy link
Copy Markdown

⚠️ 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

codesandbox-ci Bot commented Sep 8, 2023 •

Copy link
Copy Markdown

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
Copy Markdown
Collaborator Author

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

@Andarist

Copy link
Copy Markdown
Collaborator 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
Copy Markdown
Collaborator 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