Skip to content

Commit baec39b

Browse files
authored
chore: address markdown lint issues (#327)
Signed-off-by: Michael Beemer <[email protected]>
1 parent 2d4b27b commit baec39b

File tree

6 files changed

+72
-19
lines changed

6 files changed

+72
-19
lines changed

specification/sections/01-flag-evaluation.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ See [event handlers and initialization](./05-events.md#event-handlers-and-initia
4848

4949
#### Requirement 1.1.2.3
5050

51-
> The `provider mutator` function **MUST** invoke the `shutdown` function on the previously registered provider once it's no longer being used to resolve flag values.
51+
> The `provider mutator` function **MUST** invoke the `shutdown` function on the previously registered provider once it's no longer being used to resolve flag values.
5252
5353
When a provider is no longer in use, it should be disposed of using its `shutdown` mechanism.
5454
Provider instances which are bound to multiple `domains` won't be shut down until the last binding is removed.
@@ -227,7 +227,6 @@ number myNumber = client.getNumberValue('number-flag', 75);
227227
MyStruct myStruct = client.getObjectValue<MyStruct>('structured-flag', { text: 'N/A', percentage: 75 }, options);
228228
```
229229

230-
231230
#### Condition 1.3.3
232231

233232
> The implementation language differentiates between floating-point numbers and integers.
@@ -409,7 +408,7 @@ It's recommended that application-authors call this function on application shut
409408
410409
The global API object defines a `shutdown` function, which will call the respective `shutdown` function on all providers.
411410
Alternatively, implementations might leverage language idioms such as auto-disposable interfaces or some means of cancellation signal propagation to allow for graceful shutdown.
412-
This shutdown function unconditionally calls the shutdown function on all registered providers, regardless of their state.
411+
This shutdown function unconditionally calls the shutdown function on all registered providers, regardless of their state.
413412

414413
see: [`shutdown`](./02-providers.md#25-shutdown)
415414

specification/sections/02-providers.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ ResolutionDetails<number> resolveNumberValue(string flagKey, number defaultValue
124124
// example structure flag value resolution with generic argument
125125
ResolutionDetails<MyStruct> resolveStructureValue(string flagKey, MyStruct defaultValue, context: EvaluationContext);
126126
```
127+
127128
#### Requirement 2.2.9
128129

129130
> The `provider` **SHOULD** populate the `resolution details` structure's `flag metadata` field.

specification/sections/03-evaluation-context.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ see: [dynamic-context paradigm](../glossary.md#dynamic-context-paradigm)
177177

178178
> The API **SHOULD** have a method for setting a `transaction context propagator`.
179179
180-
If there already is a `transaction context propagator`, it is replaced with the new one.
180+
If there already is a `transaction context propagator`, it is replaced with the new one.
181181

182182
#### Condition 3.3.1.2
183183

specification/sections/04-hooks.md

Lines changed: 63 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,14 @@ see: [dynamic-context paradigm](../glossary.md#dynamic-context-paradigm)
7474
Either the `hook data` reference itself must be mutable, or it must allow mutation of its contents.
7575

7676
Mutable reference:
77-
```
77+
78+
```js
7879
hookContext.hookData = {'my-key': 'my-value'}
7980
```
8081

8182
Mutable content:
82-
```
83+
84+
```js
8385
hookContext.hookData.set('my-key', 'my-value')
8486
```
8587

@@ -116,6 +118,7 @@ hookContext.hookData.set('my-key', 'my-value')
116118
> `Hook data` **MUST** must be created before the first `stage` invoked in a hook for a specific evaluation and propagated between each `stage` of the hook. The hook data is not shared between different hooks.
117119
118120
Example showing data between `before` and `after` stage for two different hooks.
121+
119122
```mermaid
120123
sequenceDiagram
121124
actor Application
@@ -248,21 +251,70 @@ client.getValue('my-flag', 'defaultValue', new Hook3());
248251

249252
> Hooks **MUST** be executed "stack-wise" with respect to flag resolution, prioritizing increasing specificity (API, Client, Invocation, Provider) first, and the order in which they were added second.
250253

251-
Before flag resolution (the `before` stage), hooks run in the order `API` -> `Client` -> `Invocation` -> `Provider`, and within those, in the order in which they were added.
254+
Before flag resolution (the `before` stage), hooks run in the order `API` -> `Client` -> `Invocation` -> `Provider`, and within those, in the order in which they were added.
252255
After flag evaluation (the `after`, `error`, or `finally` stages), hooks run in the order `Provider` -> `Invocation` -> `Client` -> `API`, and within those, in reverse of the order in which they were added.
253256
This achieves intuitive "stack-like" or "LIFO" behavior for side effects and transformations.
254257

255-
```
256258
Given hooks A - H, each implementing the both the `before` and `after` stages, added at the following levels and order:
257259

258-
API: [A, B]
259-
Client: [C, D]
260-
Invocation: [E, F]
261-
Provider: [G, H]
260+
- API: [A, B]
261+
- Client: [C, D]
262+
- Invocation: [E, F]
263+
- Provider: [G, H]
262264

263265
The expected order of execution is:
264266

265-
A.before -> B.before -> C.before -> D.before -> E.before -> F.before -> G.before -> H.before -> flagResolution -> H.after -> G.after -> F.after -> E.after -> D.after -> C.after -> B.after -> A.after
267+
```mermaid
268+
flowchart BT
269+
subgraph FlagResolution [Flag Resolution]
270+
flagResolution[flagResolution]
271+
end
272+
273+
subgraph Provider [Provider Layer]
274+
G_before[G.before]
275+
H_before[H.before]
276+
G_after[G.after]
277+
H_after[H.after]
278+
end
279+
280+
subgraph Invocation [Invocation Layer]
281+
E_before[E.before]
282+
F_before[F.before]
283+
E_after[E.after]
284+
F_after[F.after]
285+
end
286+
287+
subgraph Client [Client Layer]
288+
C_before[C.before]
289+
D_before[D.before]
290+
C_after[C.after]
291+
D_after[D.after]
292+
end
293+
294+
subgraph API [API Layer]
295+
A_before[A.before]
296+
B_before[B.before]
297+
A_after[A.after]
298+
B_after[B.after]
299+
end
300+
301+
A_before --> B_before
302+
B_before --> C_before
303+
C_before --> D_before
304+
D_before --> E_before
305+
E_before --> F_before
306+
F_before --> G_before
307+
G_before --> H_before
308+
H_before --> flagResolution
309+
310+
flagResolution --> H_after
311+
H_after --> G_after
312+
G_after --> F_after
313+
F_after --> E_after
314+
E_after --> D_after
315+
D_after --> C_after
316+
C_after --> B_after
317+
B_after --> A_after
266318
```
267319

268320
#### Requirement 4.4.3
@@ -349,6 +401,7 @@ but different hooks have different hook data instances.
349401
Access to hook data is restricted to only a single hook instance, and it has no serialization requirements, and as a result does not require any value type restrictions.
350402

351403
Example TypeScript definition:
352-
```JavaScript
404+
405+
```js
353406
type HookData = Record<string, unknown>;
354407
```

specification/sections/05-events.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ see: [domain](../glossary.md#domain)
3131

3232
#### Requirement 5.1.1
3333

34-
> The `provider` **MAY** define a mechanism for signaling the occurrence of one of a set of events, including `PROVIDER_READY`, `PROVIDER_ERROR`, `PROVIDER_CONFIGURATION_CHANGED` and `PROVIDER_STALE`, with a `provider event details` payload.
34+
> The `provider` **MAY** define a mechanism for signaling the occurrence of one of a set of events, including `PROVIDER_READY`, `PROVIDER_ERROR`, `PROVIDER_CONFIGURATION_CHANGED` and `PROVIDER_STALE`, with a `provider event details` payload.
3535
3636
Providers cannot emit `PROVIDER_CONTEXT_CHANGED` or `PROVIDER_RECONCILING` events.
3737
These are emitted only by the SDK during context reconciliation.
@@ -50,7 +50,7 @@ see: [provider event types](../types.md#provider-events), [`event details`](../t
5050
> When a `provider` signals the occurrence of a particular `event`, the associated `client` and `API` event handlers **MUST** run.
5151
5252
Client event handlers respect the dynamic binding of clients to providers via `domains`.
53-
Client event handlers run when a lifecycle function terminates on the associated provider, or the associated provider emits an event.
53+
Client event handlers run when a lifecycle function terminates on the associated provider, or the associated provider emits an event.
5454

5555
see: [provider event types](./../types.md#provider-events) and [event handlers](#52-event-handlers).
5656

@@ -59,7 +59,7 @@ see: [provider event types](./../types.md#provider-events) and [event handlers](
5959
> When a `provider` signals the occurrence of a particular `event`, event handlers on clients which are not associated with that provider **MUST NOT** run.
6060
6161
Client event handlers respect the dynamic binding of clients to providers via `domains`.
62-
Client event handlers do not run when a lifecycle function terminates on an unassociated provider, or an unassociated provider emits an event.
62+
Client event handlers do not run when a lifecycle function terminates on an unassociated provider, or an unassociated provider emits an event.
6363

6464
see [setting a provider](./01-flag-evaluation.md#setting-a-provider), [domain](../glossary.md#domain) for details.
6565

@@ -152,7 +152,7 @@ See [provider initialization](./02-providers.md#24-initialization) and [setting
152152

153153
> If the provider's `initialize` function terminates abnormally, `PROVIDER_ERROR` handlers **MUST** run.
154154
155-
A failed initialization could represent an unrecoverable error, such as bad credentials or a missing file.
155+
A failed initialization could represent an unrecoverable error, such as bad credentials or a missing file.
156156
If a failed initialization could also represent a transient error.
157157
A provider which maintains a persistent connection to a remote `flag management system` may attempt to reconnect, and emit `PROVIDER_READY` after a failed initialization.
158158

specification/sections/06-tracking.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,4 @@ See [provider tracking support](./02-providers.md#27-tracking-support).
104104
105105
The `tracking event details` supports the addition of arbitrary fields, including nested objects, similar to the `evaluation context` and object-typed flag values.
106106

107-
See [structure](../types.md#structure), [evaluation context](.//03-evaluation-context.md).
107+
See [structure](../types.md#structure), [evaluation context](.//03-evaluation-context.md).

0 commit comments

Comments
 (0)