Skip to content
This repository has been archived by the owner on Sep 29, 2022. It is now read-only.

Modernizing to tRPC v10 #24

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Modernizing to tRPC v10 #24

wants to merge 9 commits into from

Conversation

zomars
Copy link
Collaborator

@zomars zomars commented Jul 12, 2022

refs trpc/trpc#2118

  • Adds turborepo
  • Upgrades tRPC to v10
  • Replaces some scripts for turbo repo pipelines
  • Fixes wrong import for expo
  • Adds type safety for next.config.js

@juliusmarminge
Copy link
Member

juliusmarminge commented Jul 12, 2022

I have a repo you could look at for reference: https://github.com/juliusmarminge/turbo-expo-next-starter

@zomars zomars requested a review from KATT July 18, 2022 19:07
@zomars zomars marked this pull request as ready for review July 18, 2022 19:07
@zomars zomars changed the title WIP: Modernizing to tRPC v10 Modernizing to tRPC v10 Jul 18, 2022
@zomars
Copy link
Collaborator Author

zomars commented Jul 18, 2022

Please let me know if I've missed anything @KATT 🙏🏽

Copy link
Member

@KATT KATT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On my phone, excited to try this out ASAP 😋

@@ -31,5 +128,3 @@ export type inferMutationOutput<
export type inferMutationInput<
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add the remaining three inference helpers?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which helpers do you mean? @juliusmarminge

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are changing with the new major

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll do something like this instead:

import { inferProcedureOutput } from '@trpc/server';

type PostByIdOutput = inferProcedureOutput<AppRouter['post']['byId']>;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh thats nice. No need for the helpers then. When will this be a thing?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a thing in V10 already

@zomars zomars requested a review from KATT July 20, 2022 00:14
@@ -1 +1 @@
export * from '@zart/react/trpc';
export * from '@zart/react-native/trpc';
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was causing an error when running expo

@zomars
Copy link
Collaborator Author

zomars commented Jul 20, 2022

I'm trying to incorporate solito as well, should I try to upgrade expo as well? @KATT

@KATT
Copy link
Member

KATT commented Jul 20, 2022

I'm trying to incorporate solito as well, should I try to upgrade expo as well? @KATT

I would be careful about expo upgrades. Make sure the app works before and after :D

@zomars
Copy link
Collaborator Author

zomars commented Jul 20, 2022

I'm trying to incorporate solito as well, should I try to upgrade expo as well? @KATT

I would be careful about expo upgrades. Make sure the app works before and after :D

Maybe I can try on a follow up Pr

@juliusmarminge
Copy link
Member

I'm trying to incorporate solito as well, should I try to upgrade expo as well? @KATT

I would be careful about expo upgrades. Make sure the app works before and after :D

Maybe I can try on a follow up Pr

Expo just launched v46 beta with React 18 so I would hold off until thats stable

@KATT
Copy link
Member

KATT commented Jul 20, 2022

Is it working in expo now? Could you update the readme if something has changed in how you use it?

@zomars
Copy link
Collaborator Author

zomars commented Jul 20, 2022

Is it working in expo now? Could you update the readme if something has changed in how you use it?

It should be working yeah. Nothing has changed AFAIK

@Norfeldt
Copy link

Norfeldt commented Aug 5, 2022

Expo has released 46 now 🙂

@johann-taberlet
Copy link

Hey there, any news on this?
I can't wait to have a try on it 😊

@juliusmarminge
Copy link
Member

A bit of self-promotion for a more minimal setup: create-t3-turbo

@zomars
Copy link
Collaborator Author

zomars commented Aug 23, 2022

Hey there, any news on this?
I can't wait to have a try on it 😊

__

Im afraid my expo knowledge is limited, anyone feel free to take over my work on this PR. It's on a mergeable state if you ask me. Maybe upgrading expo can be a follow up.

@elevyg
Copy link

elevyg commented Sep 1, 2022

I was wondering why it is necessary to have the react-native/trpc.ts file and the react/trpc.ts file when only the latter is used.

@zomars
Copy link
Collaborator Author

zomars commented Sep 1, 2022

TBH I just kept what was already there

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants