Skip to content

Commit 569bb86

Browse files
authored
chore: remove FASTGlobal version tracking (#7480)
# Pull Request ## 📖 Description Remove the `FASTGlobal.versions` API from the v3 branch so FAST no longer exposes runtime version tracking. This keeps the change as a pure breaking-change removal: the public API/docs are updated, the migration guidance explains the unsupported multi-version scenario, and no legacy runtime fallback is added. ### 🎫 Issues - Closes #7278 ## 👩‍💻 Reviewer Notes This revision intentionally keeps the work to API and documentation removal only. Reviewers can focus on the `FASTGlobal` surface removal and the migration guidance update. ## 📑 Test Plan - Run the existing `packages/fast-element/src/platform.pw.spec.ts` Chromium Playwright spec. - `npm run build -w @microsoft/fast-element` - `npm run prebuild -w sites/website` - `npm run build` - `npm run biome:check` - `npm run checkchange -- --branch origin/releases/fast-element-v3` ## ✅ Checklist ### General - [x] I have included a change request file using `$ npm run change` - [ ] I have added tests for my changes. - [x] I have tested my changes. - [x] I have updated the project documentation to reflect my changes. - [x] I have read the [CONTRIBUTING](https://github.com/microsoft/fast/blob/main/CONTRIBUTING.md) documentation and followed the [standards](https://github.com/microsoft/fast/blob/main/CODE_OF_CONDUCT.md#our-standards) for this project.
1 parent 46a4314 commit 569bb86

10 files changed

Lines changed: 48 additions & 103 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "major",
3+
"comment": "remove FASTGlobal version tracking",
4+
"packageName": "@microsoft/fast-element",
5+
"email": "7559015+janechu@users.noreply.github.com",
6+
"dependentChangeType": "none"
7+
}

packages/fast-element/DESIGN.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ For deep dives into specific areas, see the linked detailed documents.
4848
| Context protocol | W3C community Context protocol (`Context.create`, `Context.for`) |
4949
| Reactive state helpers | `state()`, `watch()` (beta) |
5050

51-
The library's kernel (the `FAST` global, the `Updates` queue, and the `Observable` system) is stored on `globalThis.FAST` and can be shared across multiple versions of the library loaded on the same page.
51+
The library's kernel (the `FAST` global, the `Updates` queue, and the `Observable` system) is stored on `globalThis.FAST`.
5252

5353
---
5454

@@ -68,8 +68,8 @@ The `KernelServiceId` object controls which numeric/string keys are used for sha
6868

6969
| Mode | Behaviour |
7070
|---|---|
71-
| `share` | Share the kernel across any FAST version |
72-
| `share-v2` | Share only with other v2 instances |
71+
| `share` | Use the shared numeric kernel service IDs |
72+
| `share-v2` | Use the alternate numeric kernel service IDs |
7373
| *(default)* | Fully isolated instance with a random postfix |
7474

7575
---

packages/fast-element/MIGRATION.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Migrating from previous versions
22

3+
## FASTGlobal version tracking (v2 → v3)
4+
5+
### Removed API
6+
7+
| Removed | Replacement |
8+
|---|---|
9+
| `FAST.versions` | No replacement. Multiple FAST versions on the same page are unsupported in v3. |
10+
11+
### Migration steps
12+
13+
1. Remove any runtime checks that read `FAST.versions`.
14+
2. Fix duplicate FAST installs in your bundler or dependency graph instead of relying on version tracking at runtime.
15+
316
## Prerendered Content Optimization (v2 → v3)
417

518
### Removed exports

packages/fast-element/SIZES.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ Bundle sizes for `@microsoft/fast-element` exports.
44

55
| Export | Minified | Gzip | Brotli |
66
|--------|----------|------|--------|
7-
| CDN Rollup Bundle | 65.02 KB | 19.31 KB | 17.34 KB |
7+
| CDN Rollup Bundle | 65.03 KB | 19.31 KB | 17.30 KB |
88
| FASTElement | 23.92 KB | 7.48 KB | 6.76 KB |
9-
| Updates | 3.68 KB | 1.51 KB | 1.28 KB |
10-
| Observable | 8.20 KB | 3.01 KB | 2.69 KB |
11-
| observable | 8.23 KB | 3.02 KB | 2.69 KB |
9+
| Updates | 3.69 KB | 1.51 KB | 1.28 KB |
10+
| Observable | 8.20 KB | 3.01 KB | 2.68 KB |
11+
| observable | 8.24 KB | 3.02 KB | 2.69 KB |
1212
| attr | 3.63 KB | 1.44 KB | 1.21 KB |
13-
| children | 6.22 KB | 2.36 KB | 2.08 KB |
14-
| css | 11.40 KB | 4.10 KB | 3.68 KB |
15-
| ref | 5.19 KB | 2.04 KB | 1.78 KB |
13+
| children | 6.22 KB | 2.37 KB | 2.08 KB |
14+
| css | 11.40 KB | 4.10 KB | 3.69 KB |
15+
| ref | 5.20 KB | 2.04 KB | 1.78 KB |
1616
| slotted | 6.01 KB | 2.30 KB | 2.02 KB |
1717
| volatile | 8.29 KB | 3.04 KB | 2.71 KB |
18-
| when | 2.40 KB | 979 B | 787 B |
19-
| html | 27.37 KB | 8.95 KB | 8.03 KB |
20-
| repeat | 31.02 KB | 9.88 KB | 8.88 KB |
18+
| when | 2.40 KB | 978 B | 786 B |
19+
| html | 27.37 KB | 8.95 KB | 8.02 KB |
20+
| repeat | 31.03 KB | 9.88 KB | 8.88 KB |

packages/fast-element/docs/api-report.api.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,6 @@ export interface FASTGlobal {
490490
getById<T>(id: string | number): T | null;
491491
// (undocumented)
492492
getById<T>(id: string | number, initialize: () => T): T;
493-
readonly versions: string[];
494493
warn(code: number, values?: Record<string, any>): void;
495494
}
496495

packages/fast-element/src/interfaces.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,14 @@ export type Mutable<T> = {
6363
export type ParameterDecorator = (
6464
target: Object,
6565
propertyKey: string | undefined,
66-
parameterIndex: number
66+
parameterIndex: number,
6767
) => void;
6868

6969
/**
7070
* The FAST global.
7171
* @public
7272
*/
7373
export interface FASTGlobal {
74-
/**
75-
* The list of loaded versions.
76-
*/
77-
readonly versions: string[];
78-
7974
/**
8075
* Gets a kernel value.
8176
* @param id - The id to get the value for.
@@ -119,7 +114,7 @@ try {
119114
const currentScript = scripts[scripts.length - 1];
120115
kernelMode = currentScript.getAttribute(kernelAttr);
121116
}
122-
} catch (e) {
117+
} catch {
123118
kernelMode = "isolate";
124119
}
125120

@@ -153,7 +148,7 @@ switch (kernelMode) {
153148
elementRegistry: 4.2,
154149
});
155150
break;
156-
default:
151+
default: {
157152
// fully isolate the kernel from all other FAST instances
158153
const postfix = `-${Math.random().toString(36).substring(2, 8)}`;
159154
KernelServiceId = Object.freeze({
@@ -163,6 +158,7 @@ switch (kernelMode) {
163158
elementRegistry: `4.2${postfix}`,
164159
});
165160
break;
161+
}
166162
}
167163

168164
export { KernelServiceId };

packages/fast-element/src/platform.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export interface TypeRegistry<TDefinition extends TypeDefinition> {
8080
* @internal
8181
*/
8282
export function createTypeRegistry<
83-
TDefinition extends TypeDefinition
83+
TDefinition extends TypeDefinition,
8484
>(): TypeRegistry<TDefinition> {
8585
const typeToDefinition = new Map<Function, TDefinition>();
8686

sites/website/src/docs/3.x/api/fast-element.fastglobal.md

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -23,52 +23,6 @@ The FAST global.
2323
export interface FASTGlobal
2424
```
2525

26-
## Properties
27-
28-
<table><thead><tr><th>
29-
30-
Property
31-
32-
33-
</th><th>
34-
35-
Modifiers
36-
37-
38-
</th><th>
39-
40-
Type
41-
42-
43-
</th><th>
44-
45-
Description
46-
47-
48-
</th></tr></thead>
49-
<tbody><tr><td>
50-
51-
[versions](../fast-element.fastglobal.versions/)
52-
53-
54-
</td><td>
55-
56-
`readonly`
57-
58-
59-
</td><td>
60-
61-
string\[\]
62-
63-
64-
</td><td>
65-
66-
The list of loaded versions.
67-
68-
69-
</td></tr>
70-
</tbody></table>
71-
7226
## Methods
7327

7428
<table><thead><tr><th>

sites/website/src/docs/3.x/api/fast-element.fastglobal.versions.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

sites/website/src/docs/3.x/resources/export-sizes.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ Bundle sizes for `@microsoft/fast-element` exports.
1919

2020
| Export | Minified | Gzip | Brotli |
2121
|--------|----------|------|--------|
22-
| CDN Rollup Bundle | 65.02 KB | 19.31 KB | 17.34 KB |
22+
| CDN Rollup Bundle | 65.03 KB | 19.31 KB | 17.30 KB |
2323
| FASTElement | 23.92 KB | 7.48 KB | 6.76 KB |
24-
| Updates | 3.68 KB | 1.51 KB | 1.28 KB |
25-
| Observable | 8.20 KB | 3.01 KB | 2.69 KB |
26-
| observable | 8.23 KB | 3.02 KB | 2.69 KB |
24+
| Updates | 3.69 KB | 1.51 KB | 1.28 KB |
25+
| Observable | 8.20 KB | 3.01 KB | 2.68 KB |
26+
| observable | 8.24 KB | 3.02 KB | 2.69 KB |
2727
| attr | 3.63 KB | 1.44 KB | 1.21 KB |
28-
| children | 6.22 KB | 2.36 KB | 2.08 KB |
29-
| css | 11.40 KB | 4.10 KB | 3.68 KB |
30-
| ref | 5.19 KB | 2.04 KB | 1.78 KB |
28+
| children | 6.22 KB | 2.37 KB | 2.08 KB |
29+
| css | 11.40 KB | 4.10 KB | 3.69 KB |
30+
| ref | 5.20 KB | 2.04 KB | 1.78 KB |
3131
| slotted | 6.01 KB | 2.30 KB | 2.02 KB |
3232
| volatile | 8.29 KB | 3.04 KB | 2.71 KB |
33-
| when | 2.40 KB | 979 B | 787 B |
34-
| html | 27.37 KB | 8.95 KB | 8.03 KB |
35-
| repeat | 31.02 KB | 9.88 KB | 8.88 KB |
33+
| when | 2.40 KB | 978 B | 786 B |
34+
| html | 27.37 KB | 8.95 KB | 8.02 KB |
35+
| repeat | 31.03 KB | 9.88 KB | 8.88 KB |

0 commit comments

Comments
 (0)