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

Add second generic to UIMatch for handle field #7464

Merged
merged 1 commit into from
Sep 18, 2023

Conversation

brophdawg11
Copy link
Contributor

Add second handle generic to UIMatch to match the React Router version

Closes: #7438

@changeset-bot
Copy link

changeset-bot bot commented Sep 18, 2023

🦋 Changeset detected

Latest commit: 6d44e50

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

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

@brophdawg11 brophdawg11 merged commit 566d3ab into dev Sep 18, 2023
5 checks passed
@brophdawg11 brophdawg11 deleted the brophdawg11/uimatch-handle branch September 18, 2023 18:56
@github-actions github-actions bot added the awaiting release This issue has been fixed and will be released soon label Sep 18, 2023
@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version v0.0.0-nightly-fccadba-20230919 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 2.0.1-pre.0 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 2.0.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!

@github-actions github-actions bot removed the awaiting release This issue has been fixed and will be released soon label Sep 21, 2023
@lensbart
Copy link
Contributor

lensbart commented Sep 21, 2023

I just tried it out in v2.0.1, but it doesn’t work entirely satisfactory with things like remix-typedjson.

Since this is typed as export type UIMatch<D = AppData, H = RouteHandle> = UIMatchRR<SerializeFrom<D>, H>, it imposes SerializeFrom whereas people using remix-typedjson would want to use RemixSerializedType instead.

Would it be possible to just reexport UIMatch from @remix-run/router instead?

Thanks!

@lensbart lensbart mentioned this pull request Sep 22, 2023
1 task
@kiliman
Copy link
Collaborator

kiliman commented Sep 23, 2023

Since remix-typedjson changes the data that is returned, in addition to the types, it's possible some of the utility functions/types will need to be added to my package.

@brophdawg11
Copy link
Contributor Author

Would it be possible to just reexport UIMatch from @remix-run/router instead?

If you need that to bypass the Remix typings - you can import that directly from @remix-run/router, but I believe the current Remix type is correct for the majority of Remix use cases.

@lensbart
Copy link
Contributor

lensbart commented Sep 25, 2023

@brophdawg11 that works for me. Thanks for your advice. (Still, I wonder if my use case (using remix-typedjson and typing the export const handle using the loader type) is exceptional enough to be okay with these ergonomics. Either way, I’m fine with it, just some food for thought.)

See also #7518 (comment)

@kiliman
Copy link
Collaborator

kiliman commented Sep 25, 2023

@lensbart can you add an issue in remix-typedjson with an example that's failing?

Thanks!

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.

type { UIMatch } from '@remix-run/router' is different from type { UIMatch } from '@remix-run/react'
3 participants