Minor Changes
-
Add a
@remix-run/form-data-middleware/futureentrypoint whoseformData()middleware parses requests with@remix-run/form-data-parser/future, so file uploads stream to youruploadHandlerinstead of being buffered in memory. Future APIs are not stable and may change in any release, but they are a good indication of where this package will land in its next major release. (#12030)In our benchmarks, parsing a request with a 100 MiB file through the future parser takes 37 ms instead of 68 ms and grows peak memory by 29 MiB instead of 396 MiB. See the
@remix-run/form-data-parserchangelog for the full comparison.import { formData } from '@remix-run/form-data-middleware/future' let middleware = formData({ async uploadHandler(fileUpload) { let storageKey = crypto.randomUUID() await fileStorage.set(storageKey, fileUpload) return storageKey }, })
If your app handles file uploads, please give
@remix-run/form-data-middleware/futurea try and tell us how it goes in GitHub Discussions. We'd especially like to hear about anything that breaks, behaves unexpectedly, or feels awkward, since that feedback will shape the next major release.
Patch Changes
- Bumped
@remix-run/*dependencies: