|
1 |
| -## Unreleased |
| 1 | +## 0.5.0 |
| 2 | + |
| 3 | +### Features |
| 4 | + |
| 5 | +#### Object-store support |
| 6 | + |
| 7 | +This release adds support for Fastly [Object-store](https://developer.fastly.com/reference/api/object-store/), which is globally consistent key-value storage accessible across the Fastly Network. This makes it possible for your Compute@Edge application to read and write from Object-stores. |
| 8 | + |
| 9 | +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`. |
| 10 | + |
| 11 | +The way to use these classes is best shown with an example: |
| 12 | +```js |
| 13 | +async function app(event) { |
| 14 | + // Create a connection the the Object-store named 'example-store' |
| 15 | + const store = new ObjectStore('example-store') |
| 16 | + |
| 17 | + // Create or update the 'hello' key with the contents 'world' |
| 18 | + await store.put('hello', 'world') |
| 19 | + |
| 20 | + // Retrieve the contents of the 'hello' key |
| 21 | + // Note: Object-stores are eventually consistent, this means that the updated contents associated may not be available to read from all |
| 22 | + // Fastly edge locations immediately and some edge locations may continue returning the previous contents associated with the key. |
| 23 | + const hello = await store.lookup('hello') |
| 24 | + |
| 25 | + // Read the contents of the `hello` key into a string |
| 26 | + const hellotext = await hello.text() |
| 27 | + return new Response(hellotext) |
| 28 | +} |
| 29 | + |
| 30 | +addEventListener("fetch", event => { |
| 31 | + event.respondWith(app(event)) |
| 32 | +}) |
| 33 | +``` |
| 34 | + |
| 35 | +#### Added `btoa` and `atob` global functions |
| 36 | + |
| 37 | +These two functions enable you to encode to ([btoa](https://developer.mozilla.org/en-US/docs/Web/API/btoa)) and decode from ([atob](https://developer.mozilla.org/en-US/docs/Web/API/atob)) Base64 strings. They follow the same specification as the `atob` and `btoa` functions that exist in web-browsers. |
| 38 | + |
| 39 | +```js |
| 40 | +addEventListener("fetch", event => { |
| 41 | + event.respondWith(new Response(atob(btoa('hello from fastly')))) |
| 42 | +}) |
| 43 | +``` |
| 44 | + |
| 45 | + |
| 46 | +#### Improved Console Support |
| 47 | + |
| 48 | +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. |
| 49 | + |
| 50 | +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. |
| 51 | + |
| 52 | +This is a before and after example of what happens when logging a Request with our console methods. |
| 53 | + |
| 54 | +Before: |
| 55 | +```js |
| 56 | +const request = new Request('https://www.fastly.com', {body:'I am the body', method: 'POST'}); |
| 57 | +console.log(request); // outputs `[object Object]`. |
| 58 | +``` |
| 59 | + |
| 60 | +After: |
| 61 | +```js |
| 62 | +const request = new Request('https://www.fastly.com', {body:'I am the body', method: 'POST'}); |
| 63 | +console.log(request); // outputs `Request: {method: POST, url: https://www.fastly.com/, version: 2, headers: {}, body: null, bodyUsed: false}`. |
| 64 | +``` |
| 65 | + |
| 66 | + |
| 67 | +### Summary |
| 68 | + |
| 69 | +* Implemented ObjectStore and ObjectStoreEntry classes for interacting with Fastly ObjectStore ([#110](https://github.com/fastly/js-compute-runtime/issues/110)) |
| 70 | +* Improved console output for all types ([#204](https://github.com/fastly/js-compute-runtime/issues/204)) |
| 71 | +* add btoa and atob native implementations ([#227](https://github.com/fastly/js-compute-runtime/issues/227)) ([8b8c31f](https://github.com/fastly/js-compute-runtime/commit/8b8c31fa9ad70337b1060a3242b8e3495ae47df3)) |
| 72 | + |
| 73 | + |
| 74 | +## 0.4.0 |
| 75 | + |
| 76 | +### Enhancements |
| 77 | + |
| 78 | +- Implement the DecompressionStream builtin [`#160`](https://github.com/fastly/js-compute-runtime/pull/160) |
| 79 | +- Improve performace of Regular Expression literals via precompilation [`#146`](https://github.com/fastly/js-compute-runtime/pull/146) |
| 80 | + |
| 81 | +### Fixes |
| 82 | + |
| 83 | +- Calling `tee` on the client request no longer causes the application to hang [`#156`](https://github.com/fastly/js-compute-runtime/pull/156) |
| 84 | + |
| 85 | +## 0.3.0 (2022-06-29) |
| 86 | + |
| 87 | +### Enhancements |
| 88 | + |
| 89 | +- Implement the CompressionStream builtin |
| 90 | + [#84](https://github.com/fastly/js-compute-runtime/pull/84) |
| 91 | +- Removed the requirement for a fastly.toml file to be present when using js-compute-runtimes CLI to compile a WASM file |
| 92 | +- **Breaking change:** Removed --skip-pkg argument from js-compute-runtime's CLI |
| 93 | + [#108](https://github.com/fastly/js-compute-runtime/pull/108) |
| 94 | +- **Breaking change:** Removed `console.trace` method |
| 95 | + |
| 96 | +### Fixes |
| 97 | + |
| 98 | +- Fix the response error message text |
| 99 | +- Throw an error if constructors are called as plain functions |
| 100 | +- Fix the behavior of `console.debug` |
| 101 | +- Allow builtin classes to be extended |
| 102 | + |
| 103 | +## 0.2.5 (2022-04-20) |
2 | 104 |
|
3 | 105 | ### Changed
|
4 | 106 |
|
5 |
| -- |
| 107 | +- 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 |
6 | 108 |
|
7 | 109 | ## 0.2.4 (2022-02-09)
|
8 | 110 |
|
|
0 commit comments