Skip to content

Releases: mjackson/remix-the-web

node-fetch-server v0.5.1

25 Jan 17:48
Compare
Choose a tag to compare
  • Iterate manually over response bodies in sendResponse instead of using for await...of. This seems to avoid an issue where the iterator tries to read from a stream after the lock has been released.

lazy-file v3.3.1

25 Jan 17:50
Compare
Choose a tag to compare
  • Handle stream errors in lazy-file/fs' writeFile. When there is an error in the stream, call writeStream.end() on the underlying file stream before rejecting the promise.

form-data-parser v0.7.0

25 Jan 18:57
Compare
Choose a tag to compare
  • BREAKING CHANGE: Override parseFormData signature so the upload handler is always last in the argument list. parserOptions are now an optional 2nd arg.
import { parseFormData } from '@mjackson/form-data-parser';

// before
await parseFormData(
  request,
  (fileUpload) => {
    // ...
  },
  { maxFileSize },
);

// after
await parseFormData(request, { maxFileSize }, (fileUpload) => {
  // ...
});
  • Upgrade multipart-parser to v0.8 to fix an issue where errors would crash the process when maxFileSize was exceeded (see #28)
  • Add an example of how to use form-data-parser together with file-storage to handle multipart uploads on Node.js
  • Expand FileUploadHandler interface to support returning Blob from the upload handler, which is the superclass of File

file-storage v0.5.0

25 Jan 19:34
Compare
Choose a tag to compare
  • Add fileStorage.put(key, file) method as a convenience around fileStorage.set(key, file) + fileStorage.get(key), which is a very common pattern when you need immediate access to the file you just put in storage
// before
await fileStorage.set(key, file);
let newFile = await fileStorage.get(key)!;

// after
let newFile = await fileStorage.put(key, file);

tar-parser v0.2.1

24 Jan 01:12
Compare
Choose a tag to compare
  • Add support for environments that do not support ReadableStream.prototype[Symbol.asyncIterator] (i.e. Safari), see #46

multipart-parser v0.8.0

24 Jan 19:34
Compare
Choose a tag to compare

This release improves error handling and simplifies some of the internals of the parser.

  • BREAKING CHANGE: Change parseMultipartRequest and parseMultipart interfaces from for await...of to await + callback API.
import { parseMultipartRequest } from '@mjackson/multipart-parser';

// before
for await (let part of parseMultipartRequest(request)) {
  // ...
}

// after
await parseMultipartRequest(request, (part) => {
  // ...
});

This change greatly simplifies the implementation of parseMultipartRequest/parseMultipart and fixes a subtle bug that did not properly catch parse errors when maxFileSize was exceeded (see #28).

  • Add MaxHeaderSizeExceededError and MaxFileSizeExceededError to make it easier to have finer-grained error handling.
import * as http from 'node:http';
import {
  MultipartParseError,
  MaxFileSizeExceededError,
  parseMultipartRequest,
} from '@mjackson/multipart-parser/node';

const tenMb = 10 * Math.pow(2, 20);

const server = http.createServer(async (req, res) => {
  try {
    await parseMultipartRequest(req, { maxFileSize: tenMb }, (part) => {
      // ...
    });
  } catch (error) {
    if (error instanceof MaxFileSizeExceededError) {
      res.writeHead(413);
      res.end(error.message);
    } else if (error instanceof MultipartParseError) {
      res.writeHead(400);
      res.end('Invalid multipart request');
    } else {
      console.error(error);
      res.writeHead(500);
      res.end('Internal Server Error');
    }
  }
});

form-data-parser v0.6.0

15 Jan 03:43
Compare
Choose a tag to compare
  • Allow upload handlers to run in parallel. Fixes #44

file-storage v0.4.1

10 Jan 21:57
Compare
Choose a tag to compare
  • Fix missing types for file-storage/local in npm package

file-storage v0.4.0

08 Jan 01:57
Compare
Choose a tag to compare
  • Fixes race conditions with concurrent calls to set
  • Shards storage directories for more scalable file systems

tar-parser v0.2.0

07 Jan 16:46
Compare
Choose a tag to compare
  • Fixed a bug that hangs the process when trying to read zero-length entries.