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: avoid circular references and infinitely recursive types #6736

Merged
merged 1 commit into from
Jun 30, 2023

Conversation

pcattori
Copy link
Contributor

@pcattori pcattori commented Jun 30, 2023

Fixes #6701 , #6693

Reverts "pretty" types for useLoaderData, useActionData, etc...

Pretty types relied on the ability to eagerly evaluate types, but this can cause infinite recursion or errors with circular referenced types.

Tested in Typescript playground

Also tested locally

Screenshot 2023-06-30 at 2 15 46 PM

@changeset-bot
Copy link

changeset-bot bot commented Jun 30, 2023

🦋 Changeset detected

Latest commit: 64988d1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 18 packages
Name Type
@remix-run/server-runtime Patch
@remix-run/cloudflare Patch
@remix-run/deno Patch
@remix-run/dev Patch
@remix-run/node Patch
@remix-run/react Patch
@remix-run/cloudflare-pages Patch
@remix-run/cloudflare-workers Patch
create-remix Patch
@remix-run/architect Patch
@remix-run/express Patch
@remix-run/netlify Patch
@remix-run/serve Patch
@remix-run/testing Patch
@remix-run/vercel Patch
remix Patch
@remix-run/css-bundle Patch
@remix-run/eslint-config 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

@pcattori pcattori merged commit f0b3a3c into release-next Jun 30, 2023
9 checks passed
@pcattori pcattori deleted the pedro/fix-loader-types-hotfix branch June 30, 2023 18:26
@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version 1.18.1-pre.2 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version 1.18.1 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@kentcdodds
Copy link
Member

Bummer 😕

@pcattori
Copy link
Contributor Author

pcattori commented Jul 1, 2023

Bummer 😕

Yep, its too bad. You can do this in user-land via something like this, but that will expand things all the way down, which isn't great DX in many cases either.

I wish there was some way to give hints to TS about which things to evaluate for displaying types and which things not too. Or like a way to click into types interactively to evaluate them on-demand for debugging purposes.

@afoures
Copy link

afoures commented Jul 1, 2023

I tried something in #6746 to fix this, maybe it can help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants