Skip to content

Commit

Permalink
chore(main): release 3.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Champion authored and JakeChampion committed Apr 12, 2024
1 parent f479a3c commit 0973edf
Show file tree
Hide file tree
Showing 693 changed files with 86 additions and 30,892 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
# Changelog


## 3.13.0 (2024-04-11)


### Added

* Add KVStore.prototype.delete method ([578d858](https://github.com/fastly/js-compute-runtime/commit/578d858b6678c27116ead213f58d2f4fe80f1355))

### Changed
* Update to SpiderMonkey 124.0.2 ([e32632e](https://github.com/fastly/js-compute-runtime/commit/e32632e16ba822770dd9b0637185f7266a7952e2))
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](https://github.com/fastly/js-compute-runtime/commit/62fd0ea36e6aefd4a3cb281a09716a901f111485))
* Improve our console.log output for functions ([9a97fc1](https://github.com/fastly/js-compute-runtime/commit/9a97fc1352926ecad8377d72eca1e18e28aa2173))
* Refactor our async task implementation to be a generic AsyncTask class instead of separate implementations for each async operation ([68dfec7](https://github.com/fastly/js-compute-runtime/commit/68dfec75a0c9c583dc4be39a17cbbf9b70ff8b40))

## 3.12.1 (2024-04-05)


Expand Down
30,888 changes: 0 additions & 30,888 deletions documentation/app/fastly.toml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import {Fiddle} from '@site/src/components/fiddle';

:::info

This Class is deprecated, it has been renamed to [`ConfigStore`](../../../fastly:config-store/ConfigStore/ConfigStore.mdx) and can be imported via `import { ConfigStore } from 'fastly:config-store'`
This Class is deprecated, it has been renamed to [`ConfigStore`](../../fastly:config-store/ConfigStore/ConfigStore.mdx) and can be imported via `import { ConfigStore } from 'fastly:config-store'`

The `get()` method exists on the [`ConfigStore`](../../../fastly:config-store/ConfigStore/ConfigStore.mdx) Class.
The `get()` method exists on the [`ConfigStore`](../../fastly:config-store/ConfigStore/ConfigStore.mdx) Class.

:::

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---
# KVStore.prototype.delete

Deletes the value associated with the key `key` in the KV store.

## Syntax

```js
delete(key)
```

### Parameters

- `key` _: string_
- The key to retrieve from within the KV-store.

### Return value

Returns `undefined`

### Exceptions

- `TypeError`
- If the provided `key`:
- Is any of the strings `""`, `"."`, or `".."`
- Starts with the string `".well-known/acme-challenge/"`
- Contains any of the characters `"#?*[]\n\r"`
- Is longer than 1024 characters
- Does not exist

## Examples

In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then delete the entry.

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

import { KVStore } from "fastly:kv-store";

async function app(event) {
const files = new KVStore('files')

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

const entry = await files.get('hello')
if (entry) {
return new Response(await entry.text())
} else {
return new Response('no file named hello exists')
}

}

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

```
Loading

0 comments on commit 0973edf

Please sign in to comment.