Skip to content

Latest commit

 

History

History
1352 lines (790 loc) · 69.4 KB

CHANGELOG.md

File metadata and controls

1352 lines (790 loc) · 69.4 KB

Changelog

3.29.2 (2025-01-23)

Fixed

3.29.1 (2025-01-23)

Fixed

  • to release process, update upload artifact (#1092) (fb5d25f)

3.29.0 (2025-01-23)

Added

  • Blob support for fetch API (#1070) (56aa96d)
  • Fanout update to redirect_to_grip_proxy_v2 passing request handle (#1079) (baf0a6e)
  • support --env option for the runtime build (#1090) (e81d252)

Fixed

3.28.0 (2024-12-09)

Added

  • configureConsole function for configuring log prefixing and stderr (#1065) (9ed80ee)
  • StarlingMonkey update (#1067) (857f6fa)

Fixed

  • do not throw uninitialized for KV (#1064) (c160c4a)
  • KVStore lookup fix for if-generation-match option (#1069) (9e4c795)

3.27.3 (2024-12-03)

Fixed

3.27.2 (2024-11-09)

Fixed

  • docs build, ensuring compute-file-server-cli for publish (#1044) (40de0b8)

3.27.1 (2024-11-09)

Fixed

3.27.0 (2024-11-07)

Added

  • --enable-aot AOT compilation flag; no longer experimental. (#1033) (8128c4d)

Fixed

  • ensure headers are set on first commit (#1036) (d622799)
  • fixup compute-file-server-cli dependency build (#1037) (206a60e)

3.26.0 (2024-10-31)

Added

Fixed

3.25.0 (2024-10-22)

Added

  • support backend property on both Request and Response, as a Backend instance (#1019) (4e3b93d)

Fixed

  • set SSL properly for created dynamic backends (#1016) (616e898)

3.24.3 (2024-10-16)

Fixed

3.24.2 (2024-10-16)

Fixed

3.24.1 (2024-10-16)

Fixed

3.24.0 (2024-10-15)

Added

  • default enable allowDynamicBackends with better unsupported errors (#995) (bb858fe)
  • setDefaultDynamicBackendConfig with all backend configuration options (#993) (1847924)
  • support backend property hostcalls (#1002) (1d9f91a)

3.23.0 (2024-09-18)

Added

Fixed

  • never error for missing client data, return null instead (#979) (7068321)
  • null return instead of an error for missing geo data (d4c9b69)
  • simple cache getOrSet inner rejections to reject outer promise (#981) (c1fdc49)

3.22.4 (2024-09-13)

Fixed

3.22.3 (2024-09-12)

Fixed

3.22.2 (2024-09-12)

Fixed

3.22.1 (2024-09-12)

Fixed

3.22.0 (2024-09-11)

Added

Fixed

  • passing direct response body to requests in streaming (#954) (6bf90b9)

3.21.4 (2024-09-05)

Fixed

  • --experimental-top-level-await support (#945) (edd8ada)

3.21.3 (2024-09-04)

Fixed

3.21.2 (2024-08-27)

Fixed

  • revert documentation website refactoring (#915) (ba1eb66)

3.21.1 (2024-08-27)

Fixed

  • missing publish file, parallel publish build (#912) (91ae54c)

3.21.0 (2024-08-27)

Added

  • ship --debug-build CLI flag as public (#907) (2728141)
  • support getSetCookie on new StarlingMonkey headers implementation (#844) (c102521)

3.20.0 (2024-08-08)

Added

  • Add new CLI name of js-compute which matches the published package name @fastly/js-compute (#869) (60d1d20)

Fixed

  • core-cache headers case (#889) (3f2db5c)
  • ensure we throw an error if FastlyBody.prototype.read is called with a value which is not coercible to a finite positive integer (#877) (1633e02)
  • perf: Use wasm-opt -O3 when making a release build (#870) (dd91fa5)
  • When constructing an EdgeRateLimiter, retrieve the PenaltyBox instance's name using PenaltyBox::get_name (#866) (9222f1d)

Changed

  • only time the fetch event when debug logging is enabled (#873) (e4ddf8a)
  • re-order the http methods so the most often requested is first and the least requested is last (#874) (6af7626)
  • Use MOZ_ASSERT instead of MOZ_RELEASE_ASSERT as these methods are already guarded correctly where they are being called (#876) (f089616)

3.19.0 (2024-07-29)

Added

  • Add FetchEvent.server object which contains information about the server which received the incoming HTTP request from the client. (#855) (538ed9c)
  • use StarlingMonkey by default, --disable-starlingmonkey flag (#861) (475cdf9)

Fixed

  • Correct Class name for the ClientInfo class (#854) (efb5694)
  • correct spelling in CLI error message (#849) (38b558c)

3.18.1 (2024-07-18)

Fixed

  • add type definitions of Performance APIs (#841) (fd95aae)

3.18.0 (2024-07-16)

Added

  • support for Response.prototype.ip and port via get_addr_dest_ip & get_addr_dest_port (#817) (391b3d8)
  • Update to SpiderMonkey v127.0.2 (#826) (5341f67)

3.17.3 (2024-07-16)

Fixed

  • Remove accidentally commited debug messages which write to stderr (#838) (040ea8b)

3.17.2 (2024-07-13)

Fixed

  • add documentation for the sdkVersion property (29361ad)
  • correct the documentation for the fastly:logger module (#834) (2790cb9)

3.17.1 (2024-07-11)

Fixed

3.17.0 (2024-07-11)

Added

  • Include in the wasm metadata whether we are using StarlingMonkey and/or PBL (#828) (00b971b)

Fixed

  • keep sdkVersion property always up-to-date with the correct version of the SDK (#829) (ae42634)

3.16.2 (2024-07-10)

Fixed

  • use same rust version that StarlingMonkey uses so that we can publish (#823) (f0d9ab0)

3.16.1 (2024-07-09)

Fixed

  • CLI to allow commands/args in spawnSync() to contain whitespace (#821) (68d77fb)
  • debug build & tests (#818) (3d9a8da)

3.16.0 (2024-06-21)

Added

  • add out-of-memory callback with stderr log (#805) (a1bd16c)
  • Allow early logger initialization (#804) (514d014)

Fixed

  • Fix string formatting for limit-exceeded errors (#802) (56f5214)
  • Fix uses of cabi_realloc that were discarding their results (#811) (4e16641)

3.15.0 (2024-06-03)

Added

  • dynamic backends clientCertificate with SecretStore fromBytes, rawbytes (#796) (7d2b7b7)
  • support default timeout configurations for dynamic backends (#792) (4dfa8d7)

3.14.2 (2024-05-21)

Fixed

3.14.1 (2024-05-17)

Fixed

3.14.0 (2024-05-16)

Added

Fixed

3.13.1 (2024-04-12)

Fixed

  • remove debugging message which got commited (4219a0a)

3.13.0 (2024-04-11)

Added

  • Add KVStore.prototype.delete method (578d858)

Changed

  • Update to SpiderMonkey 124.0.2 (e32632e) This release includes: - An optimization for functions that only use arguments.length to avoid allocating the arguments object. - An optimization for Object.HasOwn which for small numbers of atoms just unrolls the loop.

Fixed

  • Correct type definition for the global BackendConfiguration type - there is no checkCertificate field (62fd0ea)
  • Improve our console.log output for functions (9a97fc1)
  • Refactor our async task implementation to be a generic AsyncTask class instead of separate implementations for each async operation (68dfec7)

3.12.1 (2024-04-05)

Changed

3.12.0 (2024-03-28)

Changed

  • update to SpiderMonkey 123.0.1 (#744) (32bf617) This update brings with it the below changes:
    • Performance improvements for JSON.stringify()
    • An optimisation for Object.keys() to take advantage of cached for-in iterators if available.
    • Optimisations for Object.assign()
    • RegExp v flag support
    • Improved JSON parsing to help avoid garbage collection time when parsing very large files
    • The String.prototype.isWellFormed() and String.prototype.toWellFormed() methods respectively can be used to check if a string contains well-formed Unicode text (i.e. contains no lone surrogates) and sanitise an ill-formed string to well-formed Unicode text.
    • The Object.groupBy() and Map.groupBy() static methods for grouping the elements of an iterable are now supported
    • Date.parse() now accepts several additional date formats:
      • Year > 9999 for YYYY-MMM-DD format (e.g. 19999-Jan-01)
      • MMM-DD-YYYY (e.g. Jan-01-1970)
      • Milliseconds for non-ISO date formats (e.g. Jan 1 1970 10:00:00.050)
      • Day of week at the beginning of formats which were being rejected, such as:
        • Wed, 1970-01-01
        • Wed, 1970-Jan-01
      • The day of week does not need to be correct, or a day of week at all; for example, foo 1970-01-01 works.
      • Numeric dashed dates which do not meet the formal ISO standard are now accepted, including:
        • "01-12-1999" (month first)
        • "1999-1-5" (single-digit month or day)
        • "10000-01-12" (year > 9999)
        • "99-01-05" or "01-05-99" (2-digit year, year must be >31 if it comes first)
        • "1999-01-05 10:00:00" (space between date and time). These dates will be parsed with behavior typical of other non-ISO dates, such as local time zone and month rollover (April 31 rolls over to May 1 since April 31 doesn’t exist).
      • Requirements for characters directly following numbers have been loosened to accept new formats, including:
        • "DDMonYYYY"
        • "Mon.DD.YYYY"
        • "DD.Mon.YYYY"
        • "YYYY.MM.DD"
        • "Mon DD YYYY hh:mmXm" (am/pm directly following time)
      • Timezone 'Z' is now accepted for non-ISO formats (e.g. Jan 1 1970 10:00Z)
    • Other Date.parse() fixes:
      • YYYY-M-DD and YYYY-MM-D are no longer assumed GMT as an ISO date YYYY-MM-DD would be.
      • Milliseconds for all formats are truncated after 3 digits, rather than being rounded.
    • The Promise.withResolvers() static method is now supported. This exposes the resolve and reject callback functions in the same scope as the returned Promise, allowing code that resolves or rejects the promise to be defined after its construction.
    • The ArrayBuffer.prototype.transfer() and ArrayBuffer.prototype.transferToFixedLength() methods can now be used to transfer ownership of memory from one ArrayBuffer to another. After transfer, the original buffer is detached from its original memory and hence unusable; the state can be checked using ArrayBuffer.prototype.detached.

3.11.0 (2024-03-14)

Added

  • add new flag --experimental-enable-top-level-await (#742) (437a20d)

Fixed

  • correct type definition of Headers.prototype.values() to indicate it returns an IterableIterator<string> (#740) (8959e79)

3.10.0 (2024-03-09)

Added

  • add fastly:device module which allows applications to detect a device based on a user-agent (#738) (5274fd5)

Fixed

  • correct title for the CoreCache.transactionLookup documentation page (9892d90)

3.9.1 (2024-03-04)

Fixed

  • ensure we associate correct memory for the user_metadata attached to a cache item (#734) (550c4f5)

3.9.0 (2024-03-02)

Added

  • Add a EdgeRateLimiter JavaScript Class which enables edge-rate-limiting by utilising a RateCounter and a PenaltyBox instance (#732) (4e81fc7)
  • Add a PenaltyBox JavaScript Class which can be used standalone for adding and checking if an entry is in the penalty-box (#731) (bfe1e15)
  • Add a RateCounter JavaScript Class which can be used standalone for counting and rate calculations (#730) (0f6036f)
  • implement and expose JavaScript classes for Fastly's Compute Core Cache feature set (#566) (94f4038)

Fixed

  • disable the portable-baseline-tier for async functions for now (#733) (4928243)

3.8.3 (2024-02-21)

Fixed

  • do not use colon character in types for windows support (#726) (25bf1a2)

3.8.2 (2024-01-25)

Fixed

  • ensure we honor first-byte-timeout and between-bytes-timeout for dynamically registered backends (#719) (2851507)
  • If request does not have a static backend defined, return undefined for the Request.prototype.backend getter (#722) (251c037)

3.8.1 (2024-01-17)

Fixed

  • parse latin-1 encoded field values correctly (#715) (9ebb524)

3.8.0 (2024-01-11)

Added

  • Add manualFramingHeaders on RequestInit and ResponseInit, and add Request.prototype.setManualFramingHeaders and Response.prototype.setManualFramingHeaders (#705)
  • Add Request.prototype.backend getter to return the name of the backend assigned to the request (9c750e5)
  • Allow URL as input on fetch() on TypeScript typings for compat with Node.js (#707) (4f39943)

3.7.3 (2023-11-02)

Fixed

  • Make the underlying KVStore.prototype.get implementation be async (a6a5035)

3.7.2 (2023-10-25)

Fixed

  • Make Response.redirect headers be immutable (3527eaf)
  • Return correct error type (TypeError or RangeError instead of Error) in Request and Response methods (4ea7de7)

3.7.1 (2023-10-24)

Added

  • Add type defintions for the recently added Backend methods (#698) (24f1ba7)

3.7.0 (2023-10-14)

Added

This release of @fastly/js-compute includes 4 new methods to the Backend class, which enable the Fastly Service to retrieve information about any backend, this is particularly useful for checking if the backend is “healthy”. (#523) (08f816a)

The new methods are:

  • Backend.exists(name) - Check whether a backend with the given name exists for the Fastly Service.
  • Backend.fromName(name) - Check whether a backend with the given name exists for the Fastly Service and if it does, then returns an instance of Backend for the given name.
  • Backend.health(name) - Returns the health of the backend with the given name.
  • Backend.prototype.toName() - Return the name for the Backend instance.

Fixed

  • bring back support for build-time env vars (#691) (c044ac4)
  • raise an error during wizening for async functions given to addEventListener (#689) (e6747a2)

3.6.2 (2023-10-05)

Fixed

  • improve fetch error messages (58ddb20)

3.6.1 (2023-09-27)

Fixed

  • ensure we throw an error when trying to base64 decode _ via atob (1b2b2f9)

3.6.0 (2023-09-22)

Added

  • add support for ECDSA keys to be used with SubtleCrypto.prototype.sign and SubtleCrypto.prototype.verify (#667) (51bb170)

3.5.0 (2023-09-19)

Added

JavaScript dependencies can now target our JavaScript runtime for Fastly Compute explicitly via the recently added “fastly” WinterCG Runtime Key This release updates our internal bundling system to include this functionality Note: If you are using a custom bundling system for your JavaScript projects and want this functionality, you will need to update/configure your bundling system

3.4.0 (2023-09-13)

Added

  • add ability to import ECDSA JWK keys via crypto.subtle.importKey (#639) (c16b001)

3.3.5 (2023-09-11)

Changed

  • use new host_api implementation for transactional lookups and inserts (#651) (8c29246)

3.3.4 (2023-09-07)

Fixed

  • Fix SimpleCache API by reverting host_api implementation of the underlying cache apis (4340375)

3.3.3 (2023-09-05)

Fixed

  • remove unused lines of code from docs for SimpleCache/get.mdx (51fd4af)
  • update to latest version of gecko-dev which fixes a bug with the default ecma262 sorting algorithm (#643) (64323e3)

3.3.2 (2023-08-31)

Added

  • Add documentation for Request.prototype.clone() (9d12321)

3.3.1 (2023-08-24)

Changed

  • update to spidermonkey which includes async resume support when using pbl (#634) (1dea60f)

3.3.0 (2023-08-22)

Added

3.2.1 (2023-08-16)

Fixed

  • Add documentation and type definitions for the new event.client.* fields (#625) (a6f557b)

3.2.0 (2023-08-10)

Added

  • add ability to automatically decompress gzip responses returned from fetch (#497) (e08d060)

Changed

  • use spidermonkey version 115 (4a4716d)
  • reduce memory usage by caching client getters when they are first called (87ee0cb)
  • update to latest url crate which passes some more wpt url tests (f0a42fd)

3.1.1 (2023-07-14)

Fixed

  • Request.prototype.clone - Do not create a body on the new request if the request instance being cloned does not contain a body (5debe80)

3.1.0 (2023-07-12)

Added

  • Add ability to disable connection-pooling behavior for Dynamic Backends (#574) (718bea8)

Changed

  • Deprecate SimpleCache.set and recommend SimpleCache.getOrSet as the alternative (bff1bf5)

3.0.0 (2023-07-08)

Changed

⚠ BREAKING CHANGE

  • Rename SimpleCache.delete to SimpleCache.purge and require purge options to be supplied as the second parameter

We are renaming because "purge" is already a well-known and documented concept for removing content from Fastly's cache.

The new addition of a second argument allows the caller to decide what scope to purge the content from, currently they can choose to purge from all of Fastly ("global") or from the POP that contains the currently executing instance ("pop"). We do not provide a default option right now, in the future we may provide a default option, if we discover a common pattern is being used.

Here is an example of migrating an application using SimpleCache.delete to SimpleCache.purge with the same behaviour:

/// <reference types="@fastly/js-compute" />

import { SimpleCache } from 'fastly:cache';

addEventListener('fetch', event => event.respondWith(app(event)));

async function app(event) {
  const url = new URL(event.request.url);
  const path = url.pathname;
  if (url.searchParams.has('delete')) {
-    SimpleCache.delete(path);
+    SimpleCache.purge(path, { scope: "global" });
    return new Response(page, { status: 204 });
  }

  let page = SimpleCache.getOrSet(path, async () => {
    return {
      value: await render(path),
      // Store the page in the cache for 1 minute.
      ttl: 60
    }
  });
  return new Response(page, {
    headers: {
      'content-type': 'text/plain;charset=UTF-8'
    }
  });
}

async function render(path) {
  // expensive/slow function which constructs and returns the contents for a given path
  await new Promise(resolve => setTimeout(resolve, 10_000));
  return path;
}

Added

  • add event.client.tlsCipherOpensslName (49b0c99)
  • add event.client.tlsClientCertificate (cf93b62)
  • add event.client.tlsClientHello (3d87cb2)
  • add event.client.tlsJA3MD5 (2ecf4af)
  • add event.client.tlsProtocol (4c91142)
  • Rename SimpleCache.delete to SimpleCache.purge and require purge options to be supplied as the second parameter (20113c1)

2.5.0 (2023-07-05)

Added

  • add DOMException class (58b8086)
  • Add support for HMAC within SubtleCrypto implementation (96ac02d)

Changed

  • update types for SubtleCrypto to show we support a subset of importKey/sign/verify (#568) (329b733)

2.4.0 (2023-06-22)

Changed

  • Update to SpiderMonkey version 114.0.1 (#563) (03e2254)

2.3.0 (2023-06-12)

Added

  • implement web performance api (ddfe11e)

2.2.1 (2023-06-09)

Fixed

  • only apply our pipeTo/pipeThrough optimisations to TransformStreams who have no transformers (IdentityStreams). (#556) (a88616c)

2.2.0 (2023-06-08)

Added

  • Implement SimpleCache.getOrSet method (a1f4517)

2.1.0 (2023-06-02)

Added

2.0.2 (2023-06-01)

Fixed

  • add fastly:secret-store types (3805238)

  • update to the latest wizer which brings support for prebuilt linux s390x and aarch64 wizer binaries (69484c2)

2.0.1 (2023-05-24)

Fixed

  • When using implicit backends with https protocol, use the hostname for the sni hostname value to match fetch behaviour in browsers and other runtimes (84fb6a2)

2.0.0 (2023-05-15)

Changed

  • Object Store renamed to KV Store (#476)

We have renamed the ObjectStore class to KVStore, and the module name from fastly:object-store to fastly:kv-store.

You will need to update your code to use the new class name and module name.

Below is the change that would need to be made for the imported module name:

- import { ObjectStore } from 'fastly:object-store';
+ import { KVStore } from 'fastly:kv-store';

And this is the change that would need to be made for constructing an instance of the class:

- const store = new ObjectStore('my-store');
+ const store = new KVStore('my-store');

Here is a full example of migrating an application from ObjectStore to KVStore:

/// <reference types="@fastly/js-compute" />

- import { ObjectStore } from 'fastly:object-store';
+ import { KVStore } from 'fastly:kv-store';

async function app(event) {
-   const files = new ObjectStore('files');
+   const files = new KVStore('files');

  await files.put('hello', 'world')

  const entry = await files.get('hello')

  return new Response(await entry.text())
}

addEventListener("fetch", (event) => event.respondWith(app(event)))

1.13.0 (2023-05-11)

Added

  • Implement all the web console methods (#522) (a12a1d3)

1.12.0 (2023-05-11)

Added

  • Implement Fanout for JS SDK (5198884)

1.11.2 (2023-04-27)

Fixed

  • Add TypeScript definitions for Response.redirect() and Response.json() (#512) (ebe429f)

1.11.1 (2023-04-26)

Fixed

  • TextDecoder: add (nearly) full support for TextDecoder and TextEncoder (#501) (a4c312e)

1.11.0 (2023-04-25)

Added

  • implement Response.json static method (#499) (780067d)

1.10.1 (2023-04-24)

Fixed

  • Fix for ReferenceError: pattern is not defined (#506) (107c9be)

1.10.0 (2023-04-21)

Added

  • Add MD5 support into crypto.subtle.digest (9c8efab)
  • implement Response.redirect static method and Response.prototype.redirected getter (1623d74)

1.9.0 (2023-04-15)

Added

  • Implement subset of crypto.subtle.importKey which can import a JSONWebKey using RSASSA-PKCS1-v1_5 (b66bf50)
  • Implement subset of crypto.subtle.sign which can sign data with a JSONWebKey using RSASSA-PKCS1-v1_5 (800fb66)
  • Implement subset of crypto.subtle.verify which can verify a signature with a JSONWebKey using RSASSA-PKCS1-v1_5 (077adfd)

Fixed

  • free buf if an error has occured (bfa84cc)

1.8.1 (2023-04-12)

Fixed

1.8.0 (2023-04-12)

Added

  • Add high-resolution timing function "fastly.now()" behind feature flag "--enable-experimental-high-resolution-time-methods" (f090838)

Changed

  • replace tree-sitter with acorn + magic string (08a0695)

1.7.1 (2023-04-11)

Fixed

  • Lower the supported NodeJS version from 18 or greater to only 18 (5cc1cd6)
  • When converting a URL to a string, do not add a ? if there are no query string parameters (73cdc27)

1.7.0 (2023-04-11)

Added

  • BYOB streams, basic usage, pending WPT (ab97e75)
  • Implement subset of crypto.subtle.importKey which can import a JSONWebKey using RSASSA-PKCS1-v1_5 (#472) (110e7f4)

1.6.0 (2023-03-28)

Added

  • Implement JS CryptoKey Interface (adb31f7)

1.5.2 (2023-03-23)

Fixed

  • Add documentation for FetchEvent, FetchEvent.prototype.respondWith, and FetchEvent.prototype.waitUntil (78e6d92)
  • fix typo in geolocation example (f53a06e)

1.5.1 (2023-03-10)

Fixed

  • handle fallthrough of regex parser bugs (#447) (8f38980)

1.5.0 (2023-03-10)

Added

  • support unicode patterns via precompilation (87a0dce)

1.4.2 (2023-03-09)

Fixed

  • console logging support improvements (#434) (7a74d76)

1.4.1 (2023-03-01)

Changed

1.4.0 (2023-02-27)

Added

  • implement fastly:secret-store package (cde22e3)

Changed

  • Bump to spidermonkey 110, and viceroy 0.3.5 (#420) (e17cdfd)

1.3.4 (2023-02-09)

Changed

  • add custom error message when making a request to a backend which does not exist (#412) (486aed1)

1.3.3 (2023-02-08)

Changed

  • Remove error codes from external error messaging as these codes are not documented anywhere and subject to change (8f8f0ef)

1.3.2 (2023-01-30)

Changed

  • allow a downstream response to contain lots of headers with the same name without crashing (ba1f0e6)

1.3.1 (2023-01-26)

Changed

  • ensure CacheOverride bitflags are the same value as defined in c-at-e (#386) (8a1c215)

1.3.0 (2023-01-24)

Added

  • implement SubtleCrypto.prototype.digest method (#372) (bbe1754)

1.2.0 (2023-01-17)

Added

  • implement Request.prototype.clone (3f3a671)

1.1.0 (2023-01-06)

Added

  • add crypto.randomUUID function (2c32b42)

Changed

  • check that setTimeout/setInterval handler is an object before casting to an object (62476f5)
  • ensure retrieving the property definitions of ObjectStoreEntry.prototype.body and ObjectStoreEntry.bodyUsed do not cause panics by ensuring we have a valid entry in their Slots (311b84c)
  • error message is latin1, we need to use JS_ReportErrorLatin1 to convert the message from latin1 to UTF8CharsZ, otherwise a panic occurs (f1a22a4)

1.0.1 (2022-12-16)

Changed

  • do not free the method_str.ptr as we still require the memory (17c5049), closes #352

1.0.0 (2022-12-14)

Added

  • implement validation for backend cipher definitions (157be64)

0.7.0 (2022-12-10)

Added

BREAKING CHANGES

  • compute runtime component build (#326)

Changed

  • Limit to node 16/17/18 as some dependencies do not work on node19 yet (0d48f77)

0.6.0 (2022-12-09)

Added

  • Disable JS iterator helpers as the feature is at Stage 3 and we should only enable by default Stage 4 features (c90c145)

Changed

  • Throw TypeErrors in config-store if supplied with invalid parameters or the config-store does not exist (6b70180)

Removed

  • Disable JS iterator helpers as the feature is at Stage 3 and we should only enable by default Stage 4 features

0.5.15 (2022-12-08)

Added

  • add allowDynamicBackends function to fastly:experimental module (83a003e)
  • upgrade from SpiderMonkey 96 to SpiderMonkey 107 (#330)

0.5.14 (2022-12-07)

Changed

  • when appending headers, if the set-cookie header is set then make sure that each cookie value is sent as a separate set-cookie header to the host (f6cf559)

0.5.13 (2022-12-02)

Changed

  • implement validation for Dictionary names and keys (c0b0822)
  • fix: When streaming a response to the host, do not close the response body if an error occurs (8402ecf)

0.5.12 (2022-11-30)

Added

  • add fastly:experimental module which contains all our experimental functions such as includeBytes and enableDebugLogging (5c6a5d7)

0.5.11 (2022-11-30)

Changed

  • update nodejs supported versions to 16 - 19 and npm supported version to only 8 (5ec70b9)

0.5.10 (2022-11-30)

Changed

  • ensure custom cache keys are uppercased (f37920d), closes #318

0.5.9 (2022-11-29)

Added

  • add fastly:cache-override module (f433464)
  • add geo ip lookup function to fastly:geolocation (24601e5)
  • Add Logger constructor to "fastly:logger" module (b4818a2)
  • expose fastly loggers via fastly:logger module (2d0bcfe)
  • expose the fastly features via 'fastly:' namespaced modules (c06cd16)
  • move env function into fastly:env (327b344)

Changed

  • Add types for setTimeout, clearTimeout, setInterval, clearInterval (c1ed00c)

0.5.8 (2022-11-28)

Changed

  • Allow process.execPath to contain whitespace (caefe51)

0.5.7 (2022-11-24)

Changed

  • add missing shebang and executable bit to the binary file (3f0cd69)

0.5.6 (2022-11-24)

Added

  • implement setTimeout, setInterval, clearTimeout, and clearInterval (128bca9)

0.5.5 (2022-11-23)

Added

  • implement Request.prototype.setCacheKey (457eabe)
  • implement support in Response.json/text/arrayBuffer methods for guest provided streams (50cdc44)

Changed

  • respond with 500 Internal Server Error when an unhandled error has occured and no response has already been sent to the client (e5982d8)

0.5.4 (2022-09-28)

Added

  • Add ConfigStore class (#270)
  • Add Dynamic Backends support (#250)
  • Improved performance when constructing a ObjectStore instance (#272

Dynamic Backend support

Note: This feature is disabled by default for Fastly Services. Please contact Fastly Support to request the feature be enabled on the Fastly Services which require Dynamic Backends.

This feature makes it possible to use the standard fetch within JavaScript applications.

Dynamic Backends is a new feature which enables JavaScript applications to dynamically create new backend server definitions without having to deploy a new version of their Fastly Service. These backends function exactly the same as existing backends, and can be configured in all the same ways as existing backends can via the Fastly Service configuration.

By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. To enable Dynamic Backends the application will need to set fastly.allowDynamicBackends is to true.

There are two ways to make use of Dynamic Backends within JavaScript projects:

The first way is by omitting the backend property definition on the Request instance. The JavaScript Runtime will then create a Dynamic Backend definition using default configuration options. This approach is useful for JavaScript applications as it means that a standard fetch call will now be possible, which means libraries that use the standard fetch will begin to work for applications deployed to Fastly.

Below is as an example JavaScript application using the default Dynamic Backend option:

// Enable dynamic backends -- warning, this is potentially dangerous as third-party dependencies could make requests to their own backends, potentially including your sensitive/secret data
fastly.allowDynamicBackends = true;

// For any request, return the fastly homepage -- without defining a backend!
addEventListener("fetch", event => {
  event.respondWith(fetch('https://www.fastly.com/'));
});

The second way is by creating a new Dynamic Backend using the new Backend class. This approach is useful for JavaScript applications that want to have full control over the configuration of the new backend defintion, such as only allowing TLS 1.3 and disallowing older versions of TLS for requests made to the new backend.

E.G.

// Enable dynamic backends -- warning, this is potentially dangerous as third-party dependencies could make requests to their own backends, potentially including your sensitive/secret data
fastly.allowDynamicBackends = true;

// For any request, return the fastly homepage -- without defining a backend!
addEventListener("fetch", event => {
  // We are not defining all the possible fields here, the ones which are not defined will use their default value instead.
  const backend = new Backend({
    name: 'fastly',
    target: 'fastly.com',
    hostOverride: "www.fastly.com",
    sslMinVersion: 1.3,
    sslMaxVersion: 1.3,
    sniHostname: "www.fastly.com",
  });
  event.respondWith(fetch('https://www.fastly.com/', {
    backend // Here we are configuring this request to use the newly defined backend from above.
  }));
});

Config-store support and Dictionary deprecated

We have renamed the Dictionary class to ConfigStore, the old name Dictionary still exists but is now deprecated. We recommend replacing Dictionary with ConfigStore in your code to avoid having to migrate in the future when Dictionary is fully removed.

Below is an example application using the ConfigStore class:

async function app(event) {
  const store = new ConfigStore('example')
  
  // Retrieve the contents of the 'hello' key
  const hello = await store.get('hello')
  
  return new Response(hello)
}

addEventListener("fetch", event => {
  event.respondWith(app(event))
})

0.5.3 (2022-09-16)

Security

  • CVE-2022-39218: Fixed Math.random and crypto.getRandomValues methods to always use sufficiently random values. The previous versions would use a PRNG (pseudorandom number generator) which we would seed with a random value however due to our use of Wizer, the initial value to seed the PRNG was baked-in to the final WebAssembly module meaning the sequence of numbers generated was predictable for that specific WebAssembly module. The new implementations of both Math.random and crypto.getRandomValues do not use a PRNG and instead pull random values from WASI (WebAssembly System Interface) libc’s random_get function, which is always a sufficiently random value.

    An attacker with access to the same WebAssembly module that calls the affected methods could use the fixed seed to predict random numbers generated by these functions. This information could be used to bypass cryptographic security controls, for example to disclose sensitive data encrypted by functions that use these generators.

    Developers should update affected modules after applying this patch. Any secrets generated using affected versions should be rotated. Any sensitive ciphertext generated using affected versions should be considered unsafe, e.g. and be deleted or re-generated.

Fixed

  • Updated the Typescript definitions for the console methods to indicate that they now accept any number of objects. (#258)

  • Store the Object-Store key string into a native object to avoid it becoming garbage collected before being used within ObjectStore.prototype.get or ObjectStore.prototype.put ((381242)

0.5.2 (2022-09-02)

Fixed

  • Explicitly declare void as the return type for functions which return nothing - this allows our package to work with typescript's strict:true option (#253)

  • Declare ambient types for our npm package instead of exports as we do not yet export anything from the package (#252)

0.5.1 (2022-08-31)

Fixed

  • Removed type: "module" from the @fastly/js-compute package.json file as the package still uses require

0.5.0 (2022-08-30)

Added

  • Implemented ObjectStore and ObjectStoreEntry classes for interacting with Fastly ObjectStore (#110)
  • add btoa and atob native implementations (#227) (8b8c31f)

Object-store support

This release adds support for Fastly Object-store, which is globally consistent key-value storage accessible across the Fastly Network. This makes it possible for your Fastly Compute application to read and write from Object-stores.

We've added two classes, ObjectStore, and ObjectStoreEntry. ObjectStore is used to interact with a particular Object-store and ObjectStoreEntry is a particular value within an Object-store. We've made ObjectStoreEntry have a similar API as Response to make it simpler to read and write from Object-stores. I.e. ObjectStoreEntry has a body property which is a ReadableStream and has arrayBuffer/json/text methods - just like Response.

The way to use these classes is best shown with an example:

async function app(event) {
  // Create a connection the the Object-store named 'example-store'
  const store = new ObjectStore('example-store')
  
  // Create or update the 'hello' key with the contents 'world'
  await store.put('hello', 'world')
  
  // Retrieve the contents of the 'hello' key
  // Note: Object-stores are eventually consistent, this means that the updated contents associated may not be available to read from all
  // Fastly edge locations immediately and some edge locations may continue returning the previous contents associated with the key.
  const hello = await store.get('hello')
  
  // Read the contents of the `hello` key into a string
  const hellotext = await hello.text()
  return new Response(hellotext)
}

addEventListener("fetch", event => {
  event.respondWith(app(event))
})

Added btoa and atob global functions

These two functions enable you to encode to (btoa) and decode from (atob) Base64 strings. They follow the same specification as the atob and btoa functions that exist in web-browsers.

addEventListener("fetch", event => {
  event.respondWith(new Response(atob(btoa('hello from fastly'))))
})

Improved Console Support

Previously our console methods only supported a single argument and would convert the argument to a string via String(argument), this unfortunately made it difficult to log out complex objects such as Request objects or similar.

We've updated our console methods and they now support any number of arguments. As well as supporting any number of arguments, we've also changed the implementation to have better support for logging out complex objects.

This is a before and after example of what happens when logging a Request with our console methods.

Before:

const request = new Request('https://www.fastly.com', {body:'I am the body', method: 'POST'});
console.log(request); // outputs `[object Object]`.

After:

const request = new Request('https://www.fastly.com', {body:'I am the body', method: 'POST'});
console.log(request); // outputs `Request: {method: POST, url: https://www.fastly.com/, version: 2, headers: {}, body: null, bodyUsed: false}`.

Changed

  • Improved console output for all types (#204)

0.4.0 (2022-07-28)

Added

  • Implement the DecompressionStream builtin #160
  • Improve performace of Regular Expression literals via precompilation #146

Fixed

  • Calling tee on the client request no longer causes the application to hang #156

0.3.0 (2022-06-29)

Added

  • Implement the CompressionStream builtin #84

Changed

  • Removed the requirement for a fastly.toml file to be present when using js-compute-runtimes CLI to compile a WASM file
  • Breaking change: Removed --skip-pkg argument from js-compute-runtime's CLI #108
  • Breaking change: Removed console.trace method

Fixed

  • Fix the response error message text
  • Throw an error if constructors are called as plain functions
  • Fix the behavior of console.debug
  • Allow builtin classes to be extended

0.2.5 (2022-04-20)

Changed

  • Updated the js-compute-runtime to 0.2.5 : Increased max uri length to 8k, and properly forwards http headers to upstream requests even if the headers aren't ever read from

0.2.4 (2022-02-09)

Changed

  • Support streaming upstream request bodies

0.2.2 (2022-02-03)

Added

  • Add full support for TransformStreams
  • Support directly piping Request/Response bodies to other Requests/Responses instead of manually copying every chunk
  • Add support for the queueMicrotask global function
  • Add support for the structuredClone global function
  • Add support for the location global object as an instance of WorkerLocation
  • Support BigUint64Array and BigInt64Array in crypto.getRandomValues
  • Enable class static blocks syntax
  • Returned the exit code from the JS Compute Runtime, by passing it up through our CLI

Changed

  • Increase max supported header size from 4096 bytes to 69000 bytes
  • Update to SpiderMonkey 96 beta

Fixed

  • Avoid waiting for async tasks that weren't passed to FetchEvent#waitUntil
  • Significantly improve spec-compliance of Request and Response builtins

0.2.1 (2021-11-10)

Added

  • Updated the js-compute-runtime to 0.2.2 (Which includes fixes to geoip, a way to get environment variables, improves debugging of exceptions in the request handler, and other updates)
  • Added the Env namespace for accessing Fastly Compute environment variables.

0.2.0 (2021-08-31)

Added

  • Implement the WHATWG URL and URLSearchParam classes
  • Enable private class fields and methods, plus ergonomic brand checks
  • Breaking change: Implement FetchEvent#waitUntil
  • Mark builtins that rely on hostcalls as request-handler-only
  • Add support for including binary files, and for using typed arrays as Response bodies
  • Improve handling of hostcall errors

Fixed

  • Breaking change: Make FetchEvent handling more spec-compliant
  • Normalize HTTP method names when constructing Requests
  • Don't trap when trying to delete a non-existent header
  • Properly support base argument in URL constructor

0.1.0 (2021-07-28)

Added

  • Initial Release
  • Includes TypeScript type definitions for Fastly Compute flavored ServiceWorkers APIs
  • Also includes the js-compute-runtime CLI for bundling JavaScript applications