feat: Next 13 app Dir fetch support! - #315
Conversation
🦋 Changeset detectedLatest commit: f5240f0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
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 |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov Report
@@ Coverage Diff @@
## main #315 +/- ##
==========================================
- Coverage 74.23% 74.15% -0.08%
==========================================
Files 21 22 +1
Lines 586 592 +6
Branches 151 152 +1
==========================================
+ Hits 435 439 +4
- Misses 123 124 +1
- Partials 28 29 +1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
Kudos, SonarCloud Quality Gate passed!
|
oliverbutler
left a comment
There was a problem hiding this comment.
LGTM! Spotted an issue in example-microservice/web-app (type error) but this seems to be an existing problem not caused by you
oliverbutler
left a comment
There was a problem hiding this comment.
LGTM! Spotted an issue in example-microservice/web-app (type error) but this seems to be an existing problem not caused by you








Fetch Cache Feature
Since cache is officially supported by the Mozilla spec, and Nodejs now also supports the fetch AP, we can add the cache property to our core client.
Nextjs Fetch Feature
TLDR; Nextjs 13.x App Dir
fetchfeatures aren't currently supported in the@ts-rest/nextpackage. These are the features:This basic PR enables that by adding a
initNextClientfunction for consuming clients in@ts-rest/next!Now users will be able to consume other APIs in a ts-rest safe way with full fetch support, eg:
This PR is designed to only enable this for
initNextClientand not the regularinitClient. This type is inferred through theFrameworkgeneric.Let me know on any feedback you may have! Happy to make any needed changes!
I'll make some documentation after feedback is collected and this PR is merged.