github remix-run/remix @remix-run/fs@0.4.0
@remix-run/fs v0.4.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

  • BREAKING CHANGE: Renamed openFile() to openLazyFile(), removed getFile()

    Since LazyFile no longer extends File, the function name now explicitly reflects the return type. The getFile() alias has also been removed—use openLazyFile() instead.

    Migration:

    import { openLazyFile } from '@remix-run/fs'
    
    let lazyFile = openLazyFile('./document.pdf')
    
    // Streaming
    let response = new Response(lazyFile.stream())
    
    // For non-streaming APIs that require a complete File (e.g. FormData)
    formData.append('file', await lazyFile.toFile())

    Note: .toFile() and .toBlob() read the entire file into memory. Only use these for non-streaming APIs that require a complete File or Blob (e.g. FormData). Always prefer .stream() if possible.

Don't miss a new remix release

NewReleases is sending notifications on new releases.