Skip to content

Commit bc5e5b1

Browse files
authored
docs: deprecate the Dictionary Class and advice applications to use the ConfigStore class (#739)
1 parent 6b9d825 commit bc5e5b1

File tree

10 files changed

+56
-115
lines changed

10 files changed

+56
-115
lines changed

documentation/docs/fastly:dictionary/Dictionary/Dictionary.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ import {Fiddle} from '@site/src/components/fiddle';
88

99
# `Dictionary()`
1010

11+
:::info
12+
13+
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'`
14+
15+
:::
16+
1117
The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries).
1218

1319
**Note**: Can only be used when processing requests, not during build-time initialization.

documentation/docs/fastly:dictionary/Dictionary/prototype/get.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ import {Fiddle} from '@site/src/components/fiddle';
88

99
# Dictionary.prototype.get
1010

11-
**get**(): `string`
11+
:::info
1212

13-
Returns the name of the Dictionary instance
13+
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'`
14+
15+
The `get()` method exists on the [`ConfigStore`](../../fastly:config-store/ConfigStore/ConfigStore.mdx) Class.
16+
17+
:::
1418

1519
The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`.
1620

documentation/versioned_docs/version-1.13.0/fastly:dictionary/Dictionary/Dictionary.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ import {Fiddle} from '@site/src/components/fiddle';
88

99
# `Dictionary()`
1010

11+
:::info
12+
13+
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'`
14+
15+
:::
16+
1117
The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries).
1218

1319
**Note**: Can only be used when processing requests, not during build-time initialization.

documentation/versioned_docs/version-1.13.0/fastly:dictionary/Dictionary/prototype/get.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ import {Fiddle} from '@site/src/components/fiddle';
88

99
# Dictionary.prototype.get
1010

11-
**get**(): `string`
11+
:::info
1212

13-
Returns the name of the Dictionary instance
13+
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'`
14+
15+
The `get()` method exists on the [`ConfigStore`](../../fastly:config-store/ConfigStore/ConfigStore.mdx) Class.
16+
17+
:::
1418

1519
The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`.
1620

documentation/versioned_docs/version-2.5.0/fastly:dictionary/Dictionary/Dictionary.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ import {Fiddle} from '@site/src/components/fiddle';
88

99
# `Dictionary()`
1010

11+
:::info
12+
13+
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'`
14+
15+
:::
16+
1117
The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries).
1218

1319
**Note**: Can only be used when processing requests, not during build-time initialization.

documentation/versioned_docs/version-2.5.0/fastly:dictionary/Dictionary/prototype/get.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ import {Fiddle} from '@site/src/components/fiddle';
88

99
# Dictionary.prototype.get
1010

11-
**get**(): `string`
11+
:::info
1212

13-
Returns the name of the Dictionary instance
13+
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'`
14+
15+
The `get()` method exists on the [`ConfigStore`](../../fastly:config-store/ConfigStore/ConfigStore.mdx) Class.
16+
17+
:::
1418

1519
The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`.
1620

documentation/versioned_docs/version-3.10.0/fastly:dictionary/Dictionary/Dictionary.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ import {Fiddle} from '@site/src/components/fiddle';
88

99
# `Dictionary()`
1010

11+
:::info
12+
13+
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'`
14+
15+
:::
16+
1117
The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries).
1218

1319
**Note**: Can only be used when processing requests, not during build-time initialization.

documentation/versioned_docs/version-3.10.0/fastly:dictionary/Dictionary/prototype/get.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ import {Fiddle} from '@site/src/components/fiddle';
88

99
# Dictionary.prototype.get
1010

11-
**get**(): `string`
11+
:::info
1212

13-
Returns the name of the Dictionary instance
13+
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'`
14+
15+
The `get()` method exists on the [`ConfigStore`](../../fastly:config-store/ConfigStore/ConfigStore.mdx) Class.
16+
17+
:::
1418

1519
The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`.
1620

types/config-store.d.ts

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -4,58 +4,6 @@ declare module "fastly:config-store" {
44
* Class for accessing [Fastly Edge Dictionaries](https://docs.fastly.com/en/guides/about-edge-dictionaries).
55
*
66
* **Note**: Can only be used when processing requests, not during build-time initialization.
7-
*
8-
* @example
9-
* <script async defer src="https://fiddle.fastly.dev/embed.js"></script>
10-
* In this example we have an Edge Dictionary named 'animals' and we return the 'cat'
11-
* entry as the response body to the client.
12-
*
13-
* <script type="application/json+fiddle">
14-
* {
15-
* "type": "javascript",
16-
* "title": "ConfigStore Example",
17-
* "origins": [
18-
* "https://http-me.glitch.me"
19-
* ],
20-
* "src": {
21-
* "deps": "{\n \"@fastly/js-compute\": \"^0.7.0\"\n}",
22-
* "main": "/// <reference types=\"@fastly/js-compute\" />\nimport { ConfigStore } from \"fastly:config-store\";\n\nasync function app (event) {\n const config = new ConfigStore('animals');\n return new Response(config.get('cat'));\n}\n\naddEventListener(\"fetch\", event => event.respondWith(app(event)));\n"
23-
* },
24-
* "requests": [
25-
* {
26-
* "enableCluster": true,
27-
* "enableShield": false,
28-
* "enableWAF": false,
29-
* "data": {
30-
* "dictionaries": {
31-
* "animals": {
32-
* "cat": "meow"
33-
* }
34-
* }
35-
* },
36-
* "method": "GET",
37-
* "path": "/status=200",
38-
* "useFreshCache": false,
39-
* "followRedirects": false,
40-
* "tests": "",
41-
* "delay": 0
42-
* }
43-
* ],
44-
* "srcVersion": 26
45-
* }
46-
* </script>
47-
* <noscript>
48-
* ```js
49-
* /// <reference types="@fastly/js-compute" />
50-
* import { ConfigStore } from "fastly:config-store";
51-
*
52-
* async function app (event) {
53-
* const config = new ConfigStore('animals');
54-
* return new Response(config.get('cat'));
55-
* }
56-
* addEventListener("fetch", event => event.respondWith(app(event)));
57-
* ```
58-
* </noscript>
597
*/
608
class ConfigStore {
619
/**

types/dictionary.d.ts

Lines changed: 8 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -3,71 +3,24 @@ declare module "fastly:dictionary" {
33
* Class for accessing [Fastly Edge Dictionaries](https://docs.fastly.com/en/guides/about-edge-dictionaries).
44
*
55
* **Note**: Can only be used when processing requests, not during build-time initialization.
6-
*
7-
* @example
8-
* <script async defer src="https://fiddle.fastly.dev/embed.js"></script>
9-
* In this example we have an Edge Dictionary named 'animals' and we return the 'cat'
10-
* entry as the response body to the client.
11-
*
12-
* <script type="application/json+fiddle">
13-
* {
14-
* "title": "Dictionary Example",
15-
* "type": "javascript",
16-
* "origins": [
17-
* "https://http-me.glitch.me"
18-
* ],
19-
* "src": {
20-
* "deps": "{\n \"@fastly/js-compute\": \"^0.7.0\"\n}",
21-
* "main": "/// <reference types=\"@fastly/js-compute\" />\nimport { Dictionary } from \"fastly:dictionary\";\n\nasync function app (event) {\n const animals = new Dictionary('animals');\n return new Response(animals.get('cat'));\n}\n\naddEventListener(\"fetch\", event => event.respondWith(app(event)));\n"
22-
* },
23-
* "srcVersion": 7,
24-
* "requests": [
25-
* {
26-
* "enableCluster": true,
27-
* "enableShield": false,
28-
* "enableWAF": false,
29-
* "data": {
30-
* "dictionaries": {
31-
* "animals": {
32-
* "cat": "meow"
33-
* }
34-
* }
35-
* },
36-
* "method": "GET",
37-
* "path": "/status=200",
38-
* "useFreshCache": false,
39-
* "followRedirects": false,
40-
* "tests": "",
41-
* "delay": 0
42-
* }
43-
* ]
44-
* }
45-
* </script>
46-
* <noscript>
47-
* ```js
48-
* /// <reference types="@fastly/js-compute" />
49-
* import { Dictionary } from "fastly:dictionary";
50-
*
51-
* async function app (event) {
52-
* const animals = new Dictionary('animals');
53-
* return new Response(animals.get('cat'));
54-
* }
55-
*
56-
* addEventListener("fetch", event => event.respondWith(app(event)));
57-
* ```
58-
* </noscript>
6+
*
7+
* @deprecated This Class is deprecated, it has been renamed to ConfigStore and can be imported via `import { ConfigStore } from 'fastly:config-store'`
598
*/
609
class Dictionary {
6110
/**
6211
* Creates a new Dictionary object, and opens an edge dictionary to query
63-
*
12+
*
6413
* @throws {Error} Throws an `Error` if no Dictionary exists with the provided name
14+
*
15+
* @deprecated This constructor is deprecated, it has been renamed to ConfigStore and can be imported via `import { ConfigStore } from 'fastly:config-store'`
6516
*/
6617
constructor(name: string);
6718
/**
6819
* Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`.
69-
*
20+
*
7021
* @throws {TypeError} Throws an `TypeError` if the provided key is longer than 256 characters.
22+
*
23+
* @deprecated This Class is deprecated, the Class has been renamed to ConfigStore and can be imported via `import { ConfigStore } from 'fastly:config-store'`
7124
*/
7225
get(key: string): string | null;
7326
}

0 commit comments

Comments
 (0)