Skip to content

Conversation

@markdalgleish
Copy link
Member

This PR removes subclassing from LazyFile/LazyBlob to fix compatibility issues with Bun's native optimizations and updates all consumers to use the new APIs.

  • @remix-run/lazy-file no longer extends native File/Blob. Instead, LazyFile and LazyBlob implement the same interface as standalone classes. Users must now call .stream() for Response bodies or .toFile()/.toBlob() for APIs requiring native types (e.g. FormData).
  • @remix-run/fs has renamed openFile() to openLazyFile() and removed the getFile() alias to explicitly reflect that it returns a LazyFile, not a native File.
  • @remix-run/response now accepts any file-like object via a generic FileLike interface, supporting both native File and LazyFile.
  • @remix-run/file-storage and @remix-run/static-middleware have been updated to use the new openLazyFile() API.

@markdalgleish markdalgleish changed the title Convert LazyFile/LazyBlob to standalone classes Convert LazyFile/LazyBlob to standalone classes Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants