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(trpc): remove hard coded superjson transformer in favor of trpc client options & add e2e tests #378

Merged
merged 2 commits into from
May 8, 2023

Conversation

goetzrobin
Copy link
Member

@goetzrobin goetzrobin commented May 8, 2023

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

Which package are you modifying?

  • vite-plugin-angular
  • vite-plugin-nitro
  • astro-angular
  • create-analog
  • router
  • platform
  • content
  • nx-plugin
  • trpc

What is the current behavior?

Currently the tRPC client had a hardcoded transformer with superjson.
It would be better to leave the transformation up to the user.

Issue Number: N/A

What is the new behavior?

Instead of hardcoding the superjson transformer into our trpc client I removed it and in favor of allowing the default trpc clients options object to be passed in and forwarded to said trpc client. this allows users to pass in whatever transformers they want and also additional links. I also added e2e tests for the trpc-app that ensures a basic insert, read, and delete functionality works!

We now accept the same options as the tRPC client.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@netlify
Copy link

netlify bot commented May 8, 2023

Deploy Preview for analog-blog ready!

Name Link
🔨 Latest commit c2d88b0
🔍 Latest deploy log https://app.netlify.com/sites/analog-blog/deploys/6459592dbea1f40008b2f68e
😎 Deploy Preview https://deploy-preview-378--analog-blog.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented May 8, 2023

Deploy Preview for analog-docs ready!

Name Link
🔨 Latest commit c2d88b0
🔍 Latest deploy log https://app.netlify.com/sites/analog-docs/deploys/6459592d2cc99b0008e0c2a6
😎 Deploy Preview https://deploy-preview-378--analog-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented May 8, 2023

Deploy Preview for analog-app ready!

Name Link
🔨 Latest commit c2d88b0
🔍 Latest deploy log https://app.netlify.com/sites/analog-app/deploys/6459592d28fe7c0008ec18ac
😎 Deploy Preview https://deploy-preview-378--analog-app.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@goetzrobin
Copy link
Member Author

Not sure why the e2e tests fail on the CI...
This is what it looks like locally:
image

…options & add e2e tests

instead of hardcoding the superjson transformer into our trpc client I removed
it and in favor of allowing the default trpc clients options object to be
passed in and forwarded to said trpc client. this allows users to pass in
whatever transformers they want and also additional links. I also added e2e
tests for the trpc-app that ensures a basic insert, read, and delete
functionality works!
@goetzrobin
Copy link
Member Author

I think e2e tests fail due to nitro showing a reloading server page and the FE already sending the request expecting a JSON response for the tRPC client

@goetzrobin goetzrobin requested review from gergobergo and brandonroberts and removed request for gergobergo May 8, 2023 20:33
@brandonroberts brandonroberts changed the title fix: remove hard coded superjson transformer in favor of trpc client … fix(trpc): remove hard coded superjson transformer in favor of trpc client options & add e2e tests May 8, 2023
@brandonroberts brandonroberts merged commit 6ee5a75 into main May 8, 2023
15 checks passed
@brandonroberts brandonroberts deleted the remove-superjson-transform branch May 8, 2023 20:56
Villanuevand pushed a commit to Villanuevand/analog that referenced this pull request Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants