Skip to content

Add interceptor indexes #2029

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

Merged
merged 9 commits into from
May 26, 2025
Merged

Conversation

henry-encord
Copy link
Contributor

Solves #2018

  • Adds indexes (ids) to interceptors so they can be accessed by id rather than reference.
  • Updates the docs for affected parts

Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

changeset-bot bot commented May 9, 2025

🦋 Changeset detected

Latest commit: 1f99066

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

This PR includes changesets to release 10 packages
Name Type
@hey-api/client-fetch Patch
@hey-api/client-next Patch
@example/openapi-ts-fastify Patch
@example/openapi-ts-fetch Patch
@example/openapi-ts-sample Patch
@example/openapi-ts-tanstack-angular-query-experimental Patch
@example/openapi-ts-tanstack-react-query Patch
@example/openapi-ts-tanstack-svelte-query Patch
@example/openapi-ts-tanstack-vue-query Patch
@example/openapi-ts-next 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

Copy link

vercel bot commented May 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hey-api-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 26, 2025 9:34pm

Copy link
Member

@mrlubos mrlubos left a comment

Choose a reason for hiding this comment

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

Broadly agree with the changes! I understand you prefer the Axios-like syntax. My only ask is to preserve the current behaviour so it doesn't break for people

@henry-encord
Copy link
Contributor Author

@mrlubos I've made additional changes, but the failing test fails for me on Main as well as the branch. How would you prefer to proceed?

@henry-encord henry-encord marked this pull request as ready for review May 12, 2025 11:19
@mrlubos
Copy link
Member

mrlubos commented May 12, 2025

Thanks! I'll have a look at the failing test

Copy link
Member

@mrlubos mrlubos left a comment

Choose a reason for hiding this comment

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

I believe to make your tests pass... build each touched client, i.e. pnpm client fetch build, pnpm client custom build, and seems you want to also do pnpm client next build. After that, update actual tests with pnpm openapi-ts-tests test:update

@henry-encord henry-encord force-pushed the add-interceptor-indexes branch from f84bab2 to a8d5ed3 Compare May 26, 2025 09:09
@henry-encord henry-encord force-pushed the add-interceptor-indexes branch from a8d5ed3 to 98c2474 Compare May 26, 2025 09:13
Copy link

pkg-pr-new bot commented May 26, 2025

Open in StackBlitz

@hey-api/client-axios

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/client-axios@2029

@hey-api/client-fetch

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/client-fetch@2029

@hey-api/client-next

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/client-next@2029

@hey-api/client-nuxt

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/client-nuxt@2029

@hey-api/nuxt

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/nuxt@2029

@hey-api/openapi-ts

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/openapi-ts@2029

@hey-api/vite-plugin

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/vite-plugin@2029

commit: 1f99066

Copy link

codecov bot commented May 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 22.54%. Comparing base (33a417f) to head (1f99066).
Report is 10 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2029   +/-   ##
=======================================
  Coverage   22.54%   22.54%           
=======================================
  Files         258      258           
  Lines       22761    22761           
  Branches      820      820           
=======================================
  Hits         5132     5132           
  Misses      17623    17623           
  Partials        6        6           
Flag Coverage Δ
unittests 22.54% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@henry-encord
Copy link
Contributor Author

@mrlubos I've built the clients and updated the tests. Everything is passing, is there anything else I need to do to get these changes merged?

Copy link
Member

@mrlubos mrlubos left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

@mrlubos mrlubos merged commit 743b1e2 into hey-api:main May 26, 2025
17 checks passed
@github-actions github-actions bot mentioned this pull request May 26, 2025
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.

2 participants