Skip to content

v0.3.4

Latest

Choose a tag to compare

@rhengles rhengles released this 06 Nov 00:35

Added

  • @arijs/frontend/universal/loaders/ajax: one import that resolves to the browser
    loader (browser condition, and by default) or to the Node loader (node), so
    code that renders on both sides makes a single call. Browser builds no longer
    resolve http/https.
  • server/loaders/ajax-net accepts url (alias of req), and exports parseResponse.
  • AjaxError, formatError and the response pipeline are shared by both loaders
    (isomorphic/loaders/ajax-common): errors from either side pass the same instanceof.

Fixed

  • server/loaders/ajax-net ignored method and headers: a POST with a string req
    went out as a GET with no headers. Both are applied now; headers may be a
    { name, value } list (as in the browser loader) or a plain object.
  • server/loaders/ajax-net always used https; the protocol now comes from the URL
    (apiProtocol still forces it).
  • server/loaders/ajax-net resolved loadAjaxPromise when validate failed, the
    Content-Type did not match typeExpect, or the body did not parse. It now rejects,
    as the browser loader does.
  • server/loaders/ajax-net sends Content-Length for string/Buffer bodies instead of
    chunked encoding.
  • asBuffer: true threw on every chunk.
  • A finished request no longer leaves its timeout armed.

Build

  • Babel 8.1, and dev dependencies with no open audit alerts. The compiled lib/ is unchanged.

Calls that pass req keep working. On the server, requests whose validate, type
check or parsing fails now reject instead of resolving.