static-middleware@0.2.0
Breaking Changes📦 remixView on GitHub →
⚠ 2 breaking✨ 3 features🔧 5 symbols
Summary
This release introduces a configurable 'index' option for serving directory files and updates internal dependencies to use @remix-run/fs. It also improves middleware compatibility by changing how the request method is accessed.
⚠️ Breaking Changes
- The request method is now read from context.method instead of context.request.method. This may affect custom middleware that relies on the previous property location.
- Internal imports shifted from @remix-run/lazy-file/fs to @remix-run/fs, requiring the latter to be installed as a peer dependency.
Migration Steps
- Install @remix-run/fs as a peer dependency in your project.
- If using custom middleware that modifies the request method, ensure it sets context.method.
✨ New Features
- Added 'index' option to staticFiles to configure directory index files (e.g., index.html).
- Added support for boolean shortcuts in 'index' option: true for defaults, false to disable.
- Improved compatibility with method-override middleware by reading method from context.method.
🔧 Affected Symbols
staticFilescontext.methodcontext.request.method@remix-run/fs@remix-run/lazy-file/fs