Immutable
release. Only release title and notes can be modified.
Minor Changes
- cd93019: Add first-class NestJS support (#95). New
files-sdk/nestjssubpath exports a dynamicFilesModule(forRoot()/forRootAsync()) that configures the gateway, mounts it at a configurablepath(default/api/files) through Nest's middleware layer, and shares theFilesinstance via DI —@InjectFiles()/FILEStoken, with the configured router underFILES_API. Works on both the Express adapter (create the app withbodyParser: false) and the Fastify adapter (no parser configuration needed — middleware runs before body parsing).@nestjs/commonis a new optional peer dependency. - 38317d8: Lightweight
aws4fetch-powered engine for Cloudflare R2 (#76).r2({ client: "fetch" })runs the HTTP adapter on a SigV4-signedfetchcore (~2.5 KB gzipped, Web Crypto only) instead of@aws-sdk/client-s3— no@aws-sdk/*installs needed. It covers upload, download (+ ranges), head, exists, delete, list (+ delimiter), server-side copy, presignedurl(), andsignedUploadUrl(); multipart/resumable uploads throw with guidance to the default"aws-sdk"client, and stream bodies are buffered before the single PUT. Hybrid binding mode (binding + HTTP credentials) now signsurl()/signedUploadUrl()through the same fetch core unconditionally, so binding and hybrid Workers never pull the AWS SDK into their bundle. Addsaws4fetchas a regular (tree-shaken, ~2.5 KB) dependency. - 8e6fee9: React Native / Expo support for
files-sdk/clientand the framework hooks.upload()now accepts aNativeFileRef({ uri, name, type, size }— the shape Expo pickers return): presigned-POST targets stream the descriptor through React Native'sFormData, and every other path resolves theurito a Blob automatically.download()falls back to buffering viaarrayBuffer()on runtimes whosefetchnever exposesResponse.body(React Native), instead of returning an empty stream. Byte-body uploads fall back to sending raw bytes when the runtime'sBlobcannot be constructed fromArrayBufferparts. Adds a React Native docs page under UI → Client.
Patch Changes
- 8992d9a:
FilesModule.forRootAsync(): theuseFactoryreturn type now excludesglobal(newFilesModuleFactoryResulttype). Aglobalreturned from the factory was silently ignored — theDynamicModuleneeds it before the factory runs, so it only takes effect onFilesModuleAsyncOptionsitself. Returning it from the factory is now a type error instead of a no-op. - 8992d9a:
r2()binding mode:url()andsignedUploadUrl()reject again instead of throwing synchronously on misconfiguration (no hybrid credentials,responseContentDispositionwithout signing). A refactor had made these the only adapter methods that could throw before a.catchhandler was attached, breaking direct/plugin adapter callers. Also corrects theR2BindingOptions.bucketdoc comment — it is required for hybrid signing, not an error label. - 8992d9a:
StoredFile.blob()now works on React Native. RN'sBlobcannot be constructed from raw bytes, soblob()on a downloaded file threw at Blob construction — the exact platform the RN client work targets. On runtimes without byte-part Blobs,blob()now consumes the response's nativeResponse.blob()instead, and latertext()/arrayBuffer()calls read back through that Blob (viaBlob#arrayBuffer()orFileReader). If bytes were already materialized first,blob()throws a clearFilesErrorexplaining the ordering instead of an opaque platform error. - 8992d9a: The
fetchS3 client (r2({ client: "fetch" })and hybrid binding signing) now fails closed on keys containing.or..path segments. WHATWGURL— used by both the SigV4 signer andfetchitself — collapses dot segments (even percent-encoded ones) before signing, so such keys were silently signed and sent for a different, normalized key, and under path-style addressing a..segment could escape the bucket entirely. These keys now throw a permanentProvidererror with guidance to use theaws-sdkclient, which addresses them literally. - 8992d9a: The
fetchS3 client now maps post-dispatch failures toFilesErrorlike everything else: a download/list/lazy-body read dying mid-stream, and signing errors inurl()/signedUploadUrl()(e.g. an invalidcontentTypeheader value), previously escaped as raw runtimeTypeErrors when the adapter was used directly. - 5d83642: Fix
useFilesrecreating its internal store on every render. The store is now initialized lazily once (matching the abort-controller ref pattern), avoiding the wastedcreateStore()call and throwaway allocation on each render.