Skip to content

Commit 2e89c3b

Browse files
chore: release main (#230)
* chore: release main * Update CHANGELOG.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Jake Champion <[email protected]>
1 parent c8df593 commit 2e89c3b

File tree

7 files changed

+164
-220
lines changed

7 files changed

+164
-220
lines changed

.release-please-manifest.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"sdk/js-compute": "0.4.1",
3-
".": "0.4.1"
2+
"sdk/js-compute": "0.5.0",
3+
".": "0.5.0"
44
}

CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,19 @@
99

1010
- Calling `tee` on the client request no longer causes the application to hang [`#156`](https://github.com/fastly/js-compute-runtime/pull/156)
1111

12+
## [0.5.0](https://github.com/fastly/js-compute-runtime/compare/js-compute-runtime-v0.4.1...js-compute-runtime-v0.5.0) (2022-08-26)
13+
14+
15+
### Features
16+
17+
* 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))
18+
* Improve console output for all types ([#204](https://github.com/fastly/js-compute-runtime/issues/204)) ([a621d26](https://github.com/fastly/js-compute-runtime/commit/a621d26a27ee9ee18b01c5b110a5e74538f671f4))
19+
20+
21+
### Bug Fixes
22+
23+
* Fix our api website implementation ([#229](https://github.com/fastly/js-compute-runtime/issues/229)) ([a54a137](https://github.com/fastly/js-compute-runtime/commit/a54a1371f8a63d1ac11a6f8ecb1d95e6baf96174))
24+
1225
## 0.3.0
1326

1427
### Enhancements

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "js-compute-runtime"
3-
version = "0.4.0"
3+
version = "0.5.0"
44
authors = ["Fastly <[email protected]>"]
55
edition = "2018"
66

sdk/js-compute/CHANGELOG.md

+104-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,110 @@
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)
2104

3105
### Changed
4106

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
6108

7109
## 0.2.4 (2022-02-09)
8110

0 commit comments

Comments
 (0)