-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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(remix-server-runtime): add "jump to definition" support to useActionData
/useLoaderData
/SerializeFrom
#4689
feat(remix-server-runtime): add "jump to definition" support to useActionData
/useLoaderData
/SerializeFrom
#4689
Conversation
|
Hi @sachinraja, Welcome, and thank you for contributing to Remix! Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once. You may review the CLA and sign it by adding your name to contributors.yml. Once the CLA is signed, the If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at hello@remix.run. Thanks! - The Remix team |
Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incredible! 🤩
useActionData
/useLoaderData
useActionData
/useLoaderData
useActionData
/useLoaderData
/SerializeFrom
useActionData
/useLoaderData
/SerializeFrom
useActionData
/useLoaderData
/SerializeFrom
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sachinraja, this is really awesome! 🤩
Since we want to move to type-fest
's Jsonify
type at some point in the future, you might want to add these changes there as well.
@sachinraja thanks for working on this! 🙏 I saw on your twitter that microsoft/TypeScript#51650 potentially address this as a TS fix rather than something we need to do in our own types within Remix. Am I interpreting that correctly? |
Bumping this. Why hasn't this been merged yet? It's incredible |
Please, this one results on a very useful feature. |
@sachinraja Could you please rebase on latest |
@MichaelDeBoey I don't think we can use the type-fest type because of |
@sachinraja I'm not talking about using |
Looks like microsoft/TypeScript#51650 got merged. Anyone want to look into whether its already released or when it will be released as part of TypeScript? |
microsoft/TypeScript#51650 with microsoft/TypeScript#53207 should be a part of |
@sachinraja Now that "jump to definition" is fixed, can the types be simplified again or did you extract some things for other reasons as well? Would love to merge this as the changes you did for |
Closing this since TS 5.0.4 fixes it and we are already looking into swapping out our custom JSON serialize/deserialize types in favor of |
These changes are upstreamed from work I did for tRPC.
For data inferred from
useLoaderData
, properties do not have jump to definition. This is becauseserialize.ts
uses key remapping which breaks jump to definition support for TS (see microsoft/TypeScript#47813). I changed it to use a different strategy for filtering that keeps jump to definition.Testing Strategy: used the playground and attempted to jump to definition on a property from
useLoaderData
Before this PR:
before.mp4
After this PR:
jump-to-definition.mp4