Skip to content

docs: Add file download/blob examples for RestEndpoint.parseResponse#3818

Merged
ntucker merged 1 commit intomasterfrom
docs/file-download-parseresponse
Mar 25, 2026
Merged

docs: Add file download/blob examples for RestEndpoint.parseResponse#3818
ntucker merged 1 commit intomasterfrom
docs/file-download-parseresponse

Conversation

@ntucker
Copy link
Collaborator

@ntucker ntucker commented Mar 25, 2026

Motivation

There was no documentation showing how to use RestEndpoint for non-JSON responses like file downloads. Users had to piece together the parseResponse override pattern themselves. This is a common use case (downloading PDFs, images, exports) that deserves first-class documentation.

Solution

Added file download / blob response documentation in three places with progressive disclosure:

  • docs/rest/api/RestEndpoint.md (parseResponse section): Added a "File downloads" subsection with a simple blob example and a full example extracting filename from Content-Disposition header. Links to the guide for complete usage.
  • docs/rest/guides/network-transform.md: Added a "File download" section with the complete pattern including endpoint definition and a DownloadButton React component showing browser download trigger via URL.createObjectURL.
  • .cursor/skills/data-client-rest/SKILL.md: Added non-JSON response pattern under lifecycle methods with a concise example and link to the full guide reference. Updated skill description with trigger terms (file download, blob, parseResponse).

Open questions

N/A

Made with Cursor


Note

Low Risk
Low risk: documentation-only changes with no runtime code modifications. Main risk is minor doc inaccuracies or link/anchor mismatches.

Overview
Documents how to handle non-JSON/binary responses (file downloads) with @data-client/rest by overriding RestEndpoint.parseResponse() to use response.blob()/response.arrayBuffer(), and recommending schema: undefined plus dataExpiryLength: 0 to avoid normalization and blob caching.

Adds progressively more complete examples across the RestEndpoint API docs, the network-transform guide (including a browser download trigger snippet), and the .cursor skill guide, with cross-links via the #file-download anchors.

Written by Cursor Bugbot for commit acc5f5e. This will update automatically on new commits. Configure here.

Document how to override parseResponse for binary responses (blob,
arrayBuffer) including Content-Disposition header parsing and browser
download trigger pattern.

Made-with: Cursor
@changeset-bot
Copy link

changeset-bot bot commented Mar 25, 2026

⚠️ No Changeset found

Latest commit: acc5f5e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Mar 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs-site Ignored Ignored Mar 25, 2026 10:04pm

@codecov
Copy link

codecov bot commented Mar 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.06%. Comparing base (ff6c764) to head (acc5f5e).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3818   +/-   ##
=======================================
  Coverage   98.06%   98.06%           
=======================================
  Files         151      151           
  Lines        2843     2843           
  Branches      556      556           
=======================================
  Hits         2788     2788           
  Misses         11       11           
  Partials       44       44           

☔ 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.

@ntucker ntucker merged commit 68e3884 into master Mar 25, 2026
23 checks passed
@ntucker ntucker deleted the docs/file-download-parseresponse branch March 25, 2026 22:18
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.

1 participant