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

feat(trpc): allow install of superjson version 2.2.1 and newer #793

Merged
merged 1 commit into from
Dec 30, 2023

Conversation

jeremyhofer
Copy link
Contributor

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 superjson 1.x version >= 1.12.3 may be installed. Latest superjson version is 2.2.1, which - minus them internally changing to an esmodule package format - is backwards compatible with v1.

Releases: https://github.com/blitz-js/superjson/releases

Closes #

What is the new behavior?

Adds support for installing latest 2.x versions >= 2.2.1 in addition to 1.x versions.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

[optional] What gif best describes this PR or how it makes you feel?

Copy link

netlify bot commented Dec 12, 2023

Deploy Preview for analog-blog ready!

Name Link
🔨 Latest commit 8fb6159
🔍 Latest deploy log https://app.netlify.com/sites/analog-blog/deploys/658c3a8554aa010008dc5b49
😎 Deploy Preview https://deploy-preview-793--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 configuration.

Copy link

netlify bot commented Dec 12, 2023

Deploy Preview for analog-docs ready!

Name Link
🔨 Latest commit 8fb6159
🔍 Latest deploy log https://app.netlify.com/sites/analog-docs/deploys/658c3a8572a65b0008069d73
😎 Deploy Preview https://deploy-preview-793--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 configuration.

@jeremyhofer jeremyhofer changed the title feat(trpc): allow install of superjson vesions 2.2.1 and newer feat(trpc): allow install of superjson version 2.2.1 and newer Dec 12, 2023
Copy link

netlify bot commented Dec 12, 2023

Deploy Preview for analog-app ready!

Name Link
🔨 Latest commit 8fb6159
🔍 Latest deploy log https://app.netlify.com/sites/analog-app/deploys/658c3a850502c200084b5c74
😎 Deploy Preview https://deploy-preview-793--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 configuration.

@jeremyhofer
Copy link
Contributor Author

@goetzrobin @brandonroberts following up on this PR. Any concerns with this change?

@goetzrobin
Copy link
Member

@jeremyhofer @brandonroberts I believe we can simply migrate to this new version instead of allowing both the old and the new. Thoughts?

@jeremyhofer
Copy link
Contributor Author

Updating solely to the 2.x version would work as well. I went with this approach initially since superjson is defined as a peer dependency and there are no compatibility issues between the 1.x and 2.x versions today. It would probably be more correct to allow any compatible 2.x version instead of requiring a version >=2.2.1, but that's the only 2.x version I've explicitly tested and know works.

Brings the question - if we change to a 2.x version only do we want to consider changing superjson to be an actual dependency instead of a peer? Peer makes me think full flexibility and allow any versions that are compatible. If we change to a dependency then we can remove the overhead of maintaining the version in a project's package.json.

@brandonroberts
Copy link
Member

I'm good with bumping to v2 if it's fully compatible. I think keeping it as a peer dep is fine and more generally preferred

@jeremyhofer jeremyhofer force-pushed the trpc-allow-superjson-v2 branch from e1d244a to 5ab2ef6 Compare December 20, 2023 14:54
@jeremyhofer
Copy link
Contributor Author

Just updated the branch to fully switch to v2.

@brandonroberts
Copy link
Member

We should add a packageJsonUpdates migration to the newer version also. Similar to here

https://github.com/analogjs/analog/blob/main/packages/content/migrations/migration.json#L4

@jeremyhofer
Copy link
Contributor Author

👍 Will get this added!

@jeremyhofer jeremyhofer force-pushed the trpc-allow-superjson-v2 branch from 5ab2ef6 to 8fb6159 Compare December 27, 2023 14:53
@brandonroberts brandonroberts merged commit 4dffaf3 into analogjs:main Dec 30, 2023
16 checks passed
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.

3 participants