github remix-run/remix @remix-run/response@0.3.0
@remix-run/response v0.3.0

latest releases: remix@3.0.0-alpha.0, @remix-run/static-middleware@0.4.1, @remix-run/file-storage@0.13.1...
8 hours ago

Minor Changes

  • createFileResponse() is now generic and accepts any file-like object

    The function now accepts any object satisfying the FileLike interface, which includes both native File and LazyFile from @remix-run/lazy-file. This change supports the updated LazyFile class which no longer extends native File.

    The generic type flows through to the digest callback in options, so you get the exact type you passed in:

    // With native File - digest receives File
    createFileResponse(nativeFile, request, {
      digest: async (file) => {
        /* file is typed as File */
      },
    })
    
    // With LazyFile - digest receives LazyFile
    createFileResponse(lazyFile, request, {
      digest: async (file) => {
        /* file is typed as LazyFile */
      },
    })
  • Add redirect export which is a shorthand alias for createRedirectResponse

Patch Changes

  • Update @remix-run/headers peer dependency to use the new header parsing methods.

Don't miss a new remix release

NewReleases is sending notifications on new releases.