docs: add examples and docs for SSE support#3657
docs: add examples and docs for SSE support#3657malcolm-kee wants to merge 6 commits intohey-api:mainfrom
Conversation
|
|
@malcolm-kee is attempting to deploy a commit to the Hey API Team on Vercel. A member of the Team first needs to authorize it. |
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3657 +/- ##
=======================================
Coverage 38.99% 38.99%
=======================================
Files 515 515
Lines 18901 18901
Branches 5591 5591
=======================================
Hits 7370 7370
Misses 9326 9326
Partials 2205 2205
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@hey-api/codegen-core
@hey-api/json-schema-ref-parser
@hey-api/nuxt
@hey-api/openapi-ts
@hey-api/shared
@hey-api/spec-types
@hey-api/types
@hey-api/vite-plugin
commit: |
There was a problem hiding this comment.
Low urgency. One inaccurate interceptor claim in the ofetch docs. The rest of the PR is solid — the docs, example, and spec are well-structured and consistent with the actual generated code.
ec56b63 to
461b1e8
Compare
Cover missing SSE scenarios: path parameter (/stock/{symbol}/watch),
query parameter (interval), and non-200 error response (404).
https://claude.ai/code/session_015wYib3JNLu2XuN6LrJtFED
- Next.js: use client component with useState/useRef, add createUseSse hook factory - Angular: use @Injectable service with signals, add RxJS Observable alternative - Nuxt: use <script setup> with ref/onUnmounted, add custom composable pattern https://claude.ai/code/session_015wYib3JNLu2XuN6LrJtFED
Improve examples
- Angular: show generated @Injectable service with inject(), provideHeyApiClient, and instance method pattern (this.#stockService.watchStockPrices) - Nuxt: add composable caveat (SSE ignores composable option), show #hey-api auto-imports, demonstrate Vue ref auto-unwrapping for parameters - Next.js: add tip that caching options don't apply to SSE streams https://claude.ai/code/session_015wYib3JNLu2XuN6LrJtFED
docs: fix SSE examples to use actual client-specific features

Docs update and examples to clarify SSE support. This is mainly driven by Claude, I'm just verifying the types from the generated code in the example. If the type is correct, I assume the docs should be correct.
Partially resolves #2891