Skip to content

Releases: mjackson/remix-the-web

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.

headers v0.9.0

20 Dec 15:32
Compare
Choose a tag to compare

This release tightens up the type safety and brings SuperHeaders more in line with the built-in Headers interface.

  • BREAKING CHANGE: The mutation methods headers.set() and headers.append() no longer accept anything other than a string as the 2nd arg. This follows the native Headers interface more closely.
// before
let headers = new SuperHeaders();
headers.set('Content-Type', { mediaType: 'text/html' });

// after
headers.set('Content-Type', 'text/html');

// if you need the previous behavior, use the setter instead of set()
headers.contentType = { mediaType: 'text/html' };

Similarly, the constructor no longer accepts non-string values in an array init value.

// before
let headers = new SuperHeaders([['Content-Type', { mediaType: 'text/html' }]]);

// after
let headers = new SuperHeaders([['Content-Type', 'text/html']]);

// if you need the previous behavior, use the object init instead
let headers = new SuperHeaders({ contentType: { mediaType: 'text/html' } });
  • BREAKING CHANGE: headers.get() returns null for uninitialized custom header values instead of undefined. This follows the native Headers interface more closely.
// before
let headers = new SuperHeaders();
headers.get('Host'); // null
headers.get('Content-Type'); // undefined

// after
headers.get('Host'); // null
headers.get('Content-Type'); // null
  • BREAKING CHANGE: Removed ability to initialize AcceptLanguage with undefined weight values.
// before
let h1 = new AcceptLanguage({ 'en-US': undefined });
let h2 = new AcceptLanguage([['en-US', undefined]]);

// after
let h3 = new AcceptLanguage({ 'en-US': 1 });
  • All setters now also accept undefined | null in addition to string and custom object values. Setting a header to undefined | null is the same as using headers.delete().
let headers = new SuperHeaders({ contentType: 'text/html' });
headers.get('Content-Type'); // 'text/html'

headers.contentType = null; // same as headers.delete('Content-Type');
headers.get('Content-Type'); // null
  • Allow setting date headers (date, expires, ifModifiedSince, ifUnmodifiedSince, and lastModified) using numbers.
let ms = new Date().getTime();
let headers = new SuperHeaders({ lastModified: ms });
headers.date = ms;
  • Added AcceptLanguage.prototype.accepts(language), AcceptLanguage.prototype.getWeight(language),
    AcceptLanguage.prototype.getPreferred(languages)
import { AcceptLanguage } from '@mjackson/headers';

let header = new AcceptLanguage({ 'en-US': 1, en: 0.9 });

header.accepts('en-US'); // true
header.accepts('en-GB'); // true
header.accepts('en'); // true
header.accepts('fr'); // false

header.getWeight('en-US'); // 1
header.getWeight('en-GB'); // 0.9

header.getPreferred(['en-GB', 'en-US']); // 'en-US'
  • Added Accept support
import { Accept } from '@mjackson/headers';

let header = new Accept({ 'text/html': 1, 'text/*': 0.9 });

header.accepts('text/html'); // true
header.accepts('text/plain'); // true
header.accepts('text/*'); // true
header.accepts('image/jpeg'); // false

header.getWeight('text/html'); // 1
header.getWeight('text/plain'); // 0.9

header.getPreferred(['text/html', 'text/plain']); // 'text/html'
  • Added Accept-Encoding support
import { AcceptEncoding } from '@mjackson/headers';

let header = new AcceptEncoding({ gzip: 1, deflate: 0.9 });

header.accepts('gzip'); // true
header.accepts('deflate'); // true
header.accepts('identity'); // true
header.accepts('br'); // false

header.getWeight('gzip'); // 1
header.getWeight('deflate'); // 0.9

header.getPreferred(['gzip', 'deflate']); // 'gzip'
  • Added SuperHeaders.prototype (getters and setters) for:
    • accept
    • acceptEncoding
    • acceptRanges
    • connection
    • contentEncoding
    • contentLanguage
    • etag
    • host
    • location
    • referer

multipart-parser v0.7.2

12 Dec 19:25
Compare
Choose a tag to compare
  • Fix dependency on headers in package.json

form-data-parser v0.5.1

12 Dec 19:27
Compare
Choose a tag to compare
  • Fix dependency on headers in package.json

node-fetch-server v0.5.0

09 Dec 19:36
Compare
Choose a tag to compare
  • Expose createHeaders(req: http.IncomingMessage): Headers API for creating headers from the headers of incoming request objects.
  • Update sendResponse to use an object to add support for libraries such as express while maintaining node:http and node:https compatibility.

multipart-parser v0.7.1

07 Dec 07:15
Compare
Choose a tag to compare
  • Re-export everything from multipart-parser/node. If you're using multipart-parser/node, you should import everything from there. Don't import anything from multipart-parser.

tar-parser v0.1.0

06 Dec 19:19
Compare
Choose a tag to compare
  • Initial release

node-fetch-server v0.4.1

04 Dec 00:21
Compare
Choose a tag to compare
  • Fix low-level API example in the README