@fluid-internal/client-utils 2.117.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/README.md +13 -15
- package/dist/base64EncodingBrowser.d.ts +2 -1
- package/dist/base64EncodingBrowser.d.ts.map +1 -1
- package/dist/base64EncodingBrowser.js +1 -1
- package/dist/base64EncodingBrowser.js.map +1 -1
- package/dist/base64EncodingNode.d.ts +2 -1
- package/dist/base64EncodingNode.d.ts.map +1 -1
- package/dist/base64EncodingNode.js.map +1 -1
- package/dist/buffer.d.ts +93 -0
- package/dist/buffer.d.ts.map +1 -0
- package/dist/buffer.js +7 -0
- package/dist/buffer.js.map +1 -0
- package/dist/bufferBrowser.d.ts +18 -49
- package/dist/bufferBrowser.d.ts.map +1 -1
- package/dist/bufferBrowser.js +49 -52
- package/dist/bufferBrowser.js.map +1 -1
- package/dist/bufferNode.d.ts +67 -19
- package/dist/bufferNode.d.ts.map +1 -1
- package/dist/bufferNode.js +10 -12
- package/dist/bufferNode.js.map +1 -1
- package/dist/bufferShared.d.ts +38 -3
- package/dist/bufferShared.d.ts.map +1 -1
- package/dist/bufferShared.js +67 -5
- package/dist/bufferShared.js.map +1 -1
- package/dist/events/emitter.d.ts.map +1 -1
- package/dist/events/emitter.js +4 -3
- package/dist/events/emitter.js.map +1 -1
- package/dist/hashFileBrowser.d.ts +1 -1
- package/dist/hashFileBrowser.d.ts.map +1 -1
- package/dist/hashFileBrowser.js +23 -11
- package/dist/hashFileBrowser.js.map +1 -1
- package/dist/hashFileNode.d.ts +10 -2
- package/dist/hashFileNode.d.ts.map +1 -1
- package/dist/hashFileNode.js +10 -3
- package/dist/hashFileNode.js.map +1 -1
- package/dist/indexBrowser.d.ts +5 -3
- package/dist/indexBrowser.d.ts.map +1 -1
- package/dist/indexBrowser.js +5 -5
- package/dist/indexBrowser.js.map +1 -1
- package/dist/indexNode.d.ts +4 -3
- package/dist/indexNode.d.ts.map +1 -1
- package/dist/indexNode.js +5 -2
- package/dist/indexNode.js.map +1 -1
- package/dist/layerCompat.d.ts +37 -13
- package/dist/layerCompat.d.ts.map +1 -1
- package/dist/layerCompat.js +19 -14
- package/dist/layerCompat.js.map +1 -1
- package/dist/trace.js +2 -0
- package/dist/trace.js.map +1 -1
- package/dist/typedEventEmitter.js +7 -0
- package/dist/typedEventEmitter.js.map +1 -1
- package/eslint.config.mts +2 -2
- package/lib/base64EncodingBrowser.d.ts +2 -1
- package/lib/base64EncodingBrowser.d.ts.map +1 -1
- package/lib/base64EncodingBrowser.js +1 -1
- package/lib/base64EncodingBrowser.js.map +1 -1
- package/lib/base64EncodingNode.d.ts +2 -1
- package/lib/base64EncodingNode.d.ts.map +1 -1
- package/lib/base64EncodingNode.js.map +1 -1
- package/lib/buffer.d.ts +93 -0
- package/lib/buffer.d.ts.map +1 -0
- package/lib/buffer.js +6 -0
- package/lib/buffer.js.map +1 -0
- package/lib/bufferBrowser.d.ts +18 -49
- package/lib/bufferBrowser.d.ts.map +1 -1
- package/lib/bufferBrowser.js +29 -40
- package/lib/bufferBrowser.js.map +1 -1
- package/lib/bufferNode.d.ts +67 -19
- package/lib/bufferNode.d.ts.map +1 -1
- package/lib/bufferNode.js +7 -9
- package/lib/bufferNode.js.map +1 -1
- package/lib/bufferShared.d.ts +38 -3
- package/lib/bufferShared.d.ts.map +1 -1
- package/lib/bufferShared.js +64 -3
- package/lib/bufferShared.js.map +1 -1
- package/lib/events/emitter.d.ts.map +1 -1
- package/lib/events/emitter.js +2 -1
- package/lib/events/emitter.js.map +1 -1
- package/lib/hashFileBrowser.d.ts +1 -1
- package/lib/hashFileBrowser.d.ts.map +1 -1
- package/lib/hashFileBrowser.js +4 -1
- package/lib/hashFileBrowser.js.map +1 -1
- package/lib/hashFileNode.d.ts +10 -2
- package/lib/hashFileNode.d.ts.map +1 -1
- package/lib/hashFileNode.js +8 -0
- package/lib/hashFileNode.js.map +1 -1
- package/lib/indexBrowser.d.ts +5 -3
- package/lib/indexBrowser.d.ts.map +1 -1
- package/lib/indexBrowser.js +3 -5
- package/lib/indexBrowser.js.map +1 -1
- package/lib/indexNode.d.ts +4 -3
- package/lib/indexNode.d.ts.map +1 -1
- package/lib/indexNode.js +2 -2
- package/lib/indexNode.js.map +1 -1
- package/lib/layerCompat.d.ts +37 -13
- package/lib/layerCompat.d.ts.map +1 -1
- package/lib/layerCompat.js +17 -12
- package/lib/layerCompat.js.map +1 -1
- package/lib/trace.js +2 -0
- package/lib/trace.js.map +1 -1
- package/lib/typedEventEmitter.js +7 -0
- package/lib/typedEventEmitter.js.map +1 -1
- package/package.json +65 -62
- package/playwright.config.ts +23 -0
- package/src/base64EncodingBrowser.ts +3 -2
- package/src/base64EncodingNode.ts +2 -1
- package/src/buffer.ts +112 -0
- package/src/bufferBrowser.ts +98 -60
- package/src/bufferNode.ts +86 -30
- package/src/bufferShared.ts +74 -4
- package/src/hashFileBrowser.ts +6 -3
- package/src/hashFileNode.ts +10 -2
- package/src/indexBrowser.ts +13 -2
- package/src/indexNode.ts +13 -2
- package/src/layerCompat.ts +41 -13
- package/tsconfig.json +1 -2
- package/webpack.playwright.cjs +22 -0
- package/jest-puppeteer.config.cjs +0 -16
- package/jest.config.cjs +0 -21
package/lib/layerCompat.d.ts
CHANGED
|
@@ -21,29 +21,29 @@ export type FluidLayer = "loader" | "driver" | "runtime" | "dataStore";
|
|
|
21
21
|
*/
|
|
22
22
|
export declare const LayerCompatibilityPolicyWindowMonths: {
|
|
23
23
|
/**
|
|
24
|
-
* Driver is compatible with Loader versions up to 12 months (or generations) older.
|
|
24
|
+
* A newer Driver is compatible with Loader versions up to 12 months (or generations) older.
|
|
25
25
|
*/
|
|
26
|
-
readonly
|
|
26
|
+
readonly NewDriverOldLoader: 12;
|
|
27
27
|
/**
|
|
28
|
-
* Loader is compatible with Driver versions up to 12 months (or generations) older.
|
|
28
|
+
* A newer Loader is compatible with Driver versions up to 12 months (or generations) older.
|
|
29
29
|
*/
|
|
30
|
-
readonly
|
|
30
|
+
readonly NewLoaderOldDriver: 12;
|
|
31
31
|
/**
|
|
32
|
-
* Runtime is compatible with Loader versions up to 12 months (or generations) older.
|
|
32
|
+
* A newer Runtime is compatible with Loader versions up to 12 months (or generations) older.
|
|
33
33
|
*/
|
|
34
|
-
readonly
|
|
34
|
+
readonly NewRuntimeOldLoader: 12;
|
|
35
35
|
/**
|
|
36
|
-
* Loader is compatible with Runtime versions up to 3 months (or generations) older.
|
|
36
|
+
* A newer Loader is compatible with Runtime versions up to 3 months (or generations) older.
|
|
37
37
|
*/
|
|
38
|
-
readonly
|
|
38
|
+
readonly NewLoaderOldRuntime: 3;
|
|
39
39
|
/**
|
|
40
|
-
* Runtime is compatible with DataStore versions up to 3 months (or generations) older.
|
|
40
|
+
* A newer Runtime is compatible with DataStore versions up to 3 months (or generations) older.
|
|
41
41
|
*/
|
|
42
|
-
readonly
|
|
42
|
+
readonly NewRuntimeOldDataStore: 3;
|
|
43
43
|
/**
|
|
44
|
-
* DataStore is compatible with Runtime versions up to 3 months (or generations) older.
|
|
44
|
+
* A newer DataStore is compatible with Runtime versions up to 3 months (or generations) older.
|
|
45
45
|
*/
|
|
46
|
-
readonly
|
|
46
|
+
readonly NewDataStoreOldRuntime: 3;
|
|
47
47
|
};
|
|
48
48
|
/**
|
|
49
49
|
* Result of a layer compatibility check - whether a layer is compatible with another layer.
|
|
@@ -107,11 +107,35 @@ export interface ILayerCompatDetails extends Partial<IProvideLayerCompatDetails>
|
|
|
107
107
|
* @internal
|
|
108
108
|
*/
|
|
109
109
|
export declare const defaultLayerCompatDetails: ILayerCompatDetails;
|
|
110
|
+
/**
|
|
111
|
+
* Key used to look up {@link (ILayerCompatSupportRequirements:interface)} on a `FluidObject`.
|
|
112
|
+
* @internal
|
|
113
|
+
*/
|
|
114
|
+
export declare const ILayerCompatSupportRequirements: keyof IProvideLayerCompatSupportRequirements;
|
|
115
|
+
/**
|
|
116
|
+
* Provides {@link (ILayerCompatSupportRequirements:interface)} so that a layer can publish, as a `FluidObject`, the
|
|
117
|
+
* requirements another layer must meet to be compatible with it.
|
|
118
|
+
* @internal
|
|
119
|
+
*/
|
|
120
|
+
export interface IProvideLayerCompatSupportRequirements {
|
|
121
|
+
readonly ILayerCompatSupportRequirements: ILayerCompatSupportRequirements;
|
|
122
|
+
}
|
|
110
123
|
/**
|
|
111
124
|
* The requirements that a layer needs another layer to support for them to be compatible.
|
|
125
|
+
*
|
|
126
|
+
* @remarks
|
|
127
|
+
* A layer can also publish its requirements across a boundary as a `FluidObject` (via
|
|
128
|
+
* {@link IProvideLayerCompatSupportRequirements}) for the case where this layer cannot run the compatibility
|
|
129
|
+
* validation itself and instead needs the layer on the other side of the boundary to check itself against the
|
|
130
|
+
* published requirements. Most boundaries are validated by both layers because each holds
|
|
131
|
+
* a reference to the other (e.g. the Loader and the Runtime). The Driver / Loader boundary is asymmetric: the
|
|
132
|
+
* Loader holds a reference to the Driver, but the Driver has no reference to the Loader and so cannot validate it.
|
|
133
|
+
* To still validate in both directions, the Driver publishes its requirements for the Loader and the Loader
|
|
134
|
+
* validates itself against them on the Driver's behalf.
|
|
135
|
+
*
|
|
112
136
|
* @internal
|
|
113
137
|
*/
|
|
114
|
-
export interface ILayerCompatSupportRequirements {
|
|
138
|
+
export interface ILayerCompatSupportRequirements extends Partial<IProvideLayerCompatSupportRequirements> {
|
|
115
139
|
/**
|
|
116
140
|
* The minimum supported generation the other layer needs to be at.
|
|
117
141
|
*/
|
package/lib/layerCompat.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layerCompat.d.ts","sourceRoot":"","sources":["../src/layerCompat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;AAEvE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oCAAoC;IAChD;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;CAEM,CAAC;AAEX;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAC/B;IAAE,QAAQ,CAAC,YAAY,EAAE,IAAI,CAAA;CAAE,GAC/B;IACA,QAAQ,CAAC,YAAY,EAAE,KAAK,CAAC;IAC7B;;OAEG;IACH,QAAQ,CAAC,sBAAsB,EAAE,OAAO,CAAC;IACzC;;;OAGG;IACH,QAAQ,CAAC,mBAAmB,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;CAC3D,CAAC;AAEL;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,0BAAkD,CAAC;AAE3F;;GAEG;AACH,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;CAClD;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAoB,SAAQ,OAAO,CAAC,0BAA0B,CAAC;IAC/E;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAChD;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC5B;AAED;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,mBAIvC,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,+BAA+B;
|
|
1
|
+
{"version":3,"file":"layerCompat.d.ts","sourceRoot":"","sources":["../src/layerCompat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;AAEvE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oCAAoC;IAChD;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;CAEM,CAAC;AAEX;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAC/B;IAAE,QAAQ,CAAC,YAAY,EAAE,IAAI,CAAA;CAAE,GAC/B;IACA,QAAQ,CAAC,YAAY,EAAE,KAAK,CAAC;IAC7B;;OAEG;IACH,QAAQ,CAAC,sBAAsB,EAAE,OAAO,CAAC;IACzC;;;OAGG;IACH,QAAQ,CAAC,mBAAmB,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;CAC3D,CAAC;AAEL;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,0BAAkD,CAAC;AAE3F;;GAEG;AACH,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;CAClD;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAoB,SAAQ,OAAO,CAAC,0BAA0B,CAAC;IAC/E;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAChD;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC5B;AAED;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,mBAIvC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,+BAA+B,EAAE,MAAM,sCAClB,CAAC;AAEnC;;;;GAIG;AACH,MAAM,WAAW,sCAAsC;IACtD,QAAQ,CAAC,+BAA+B,EAAE,+BAA+B,CAAC;CAC1E;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,+BAChB,SAAQ,OAAO,CAAC,sCAAsC,CAAC;IACvD;;OAEG;IACH,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAC;IACxC;;OAEG;IACH,QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7C;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACtC,+BAA+B,EAAE,+BAA+B,EAChE,mBAAmB,EAAE,mBAAmB,GAAG,SAAS,GAClD,sBAAsB,CA4BxB"}
|
package/lib/layerCompat.js
CHANGED
|
@@ -16,29 +16,29 @@
|
|
|
16
16
|
*/
|
|
17
17
|
export const LayerCompatibilityPolicyWindowMonths = {
|
|
18
18
|
/**
|
|
19
|
-
* Driver is compatible with Loader versions up to 12 months (or generations) older.
|
|
19
|
+
* A newer Driver is compatible with Loader versions up to 12 months (or generations) older.
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
NewDriverOldLoader: 12,
|
|
22
22
|
/**
|
|
23
|
-
* Loader is compatible with Driver versions up to 12 months (or generations) older.
|
|
23
|
+
* A newer Loader is compatible with Driver versions up to 12 months (or generations) older.
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
NewLoaderOldDriver: 12,
|
|
26
26
|
/**
|
|
27
|
-
* Runtime is compatible with Loader versions up to 12 months (or generations) older.
|
|
27
|
+
* A newer Runtime is compatible with Loader versions up to 12 months (or generations) older.
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
NewRuntimeOldLoader: 12,
|
|
30
30
|
/**
|
|
31
|
-
* Loader is compatible with Runtime versions up to 3 months (or generations) older.
|
|
31
|
+
* A newer Loader is compatible with Runtime versions up to 3 months (or generations) older.
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
NewLoaderOldRuntime: 3,
|
|
34
34
|
/**
|
|
35
|
-
* Runtime is compatible with DataStore versions up to 3 months (or generations) older.
|
|
35
|
+
* A newer Runtime is compatible with DataStore versions up to 3 months (or generations) older.
|
|
36
36
|
*/
|
|
37
|
-
|
|
37
|
+
NewRuntimeOldDataStore: 3,
|
|
38
38
|
/**
|
|
39
|
-
* DataStore is compatible with Runtime versions up to 3 months (or generations) older.
|
|
39
|
+
* A newer DataStore is compatible with Runtime versions up to 3 months (or generations) older.
|
|
40
40
|
*/
|
|
41
|
-
|
|
41
|
+
NewDataStoreOldRuntime: 3,
|
|
42
42
|
};
|
|
43
43
|
/**
|
|
44
44
|
* @internal
|
|
@@ -54,6 +54,11 @@ export const defaultLayerCompatDetails = {
|
|
|
54
54
|
generation: 0, // 0 is reserved for layers before compatibility enforcement was introduced.
|
|
55
55
|
pkgVersion: "unknown",
|
|
56
56
|
};
|
|
57
|
+
/**
|
|
58
|
+
* Key used to look up {@link (ILayerCompatSupportRequirements:interface)} on a `FluidObject`.
|
|
59
|
+
* @internal
|
|
60
|
+
*/
|
|
61
|
+
export const ILayerCompatSupportRequirements = "ILayerCompatSupportRequirements";
|
|
57
62
|
/**
|
|
58
63
|
* Checks compatibility of a layer (layer1) with another layer (layer2).
|
|
59
64
|
* @param compatSupportRequirementsLayer1 - The requirements from layer1 that layer2 needs to meet.
|
package/lib/layerCompat.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layerCompat.js","sourceRoot":"","sources":["../src/layerCompat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG;IACnD;;OAEG;IACH,
|
|
1
|
+
{"version":3,"file":"layerCompat.js","sourceRoot":"","sources":["../src/layerCompat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG;IACnD;;OAEG;IACH,kBAAkB,EAAE,EAAE;IACtB;;OAEG;IACH,kBAAkB,EAAE,EAAE;IACtB;;OAEG;IACH,mBAAmB,EAAE,EAAE;IACvB;;OAEG;IACH,mBAAmB,EAAE,CAAC;IACtB;;OAEG;IACH,sBAAsB,EAAE,CAAC;IACzB;;OAEG;IACH,sBAAsB,EAAE,CAAC;CAChB,CAAC;AAqBX;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAqC,qBAAqB,CAAC;AAsC3F;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAwB;IAC7D,iBAAiB,EAAE,IAAI,GAAG,EAAE;IAC5B,UAAU,EAAE,CAAC,EAAE,4EAA4E;IAC3F,UAAU,EAAE,SAAS;CACrB,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAC3C,iCAAiC,CAAC;AAsCnC;;;;;;;;GAQG;AACH,MAAM,UAAU,uBAAuB,CACtC,+BAAgE,EAChE,mBAAoD;IAEpD,MAAM,wBAAwB,GAAG,mBAAmB,IAAI,yBAAyB,CAAC;IAClF,IAAI,sBAAsB,GAAG,IAAI,CAAC;IAClC,MAAM,mBAAmB,GAAa,EAAE,CAAC;IAEzC,2FAA2F;IAC3F,6BAA6B;IAC7B,IACC,wBAAwB,CAAC,UAAU;QACnC,+BAA+B,CAAC,sBAAsB,EACrD,CAAC;QACF,sBAAsB,GAAG,KAAK,CAAC;IAChC,CAAC;IAED,gFAAgF;IAChF,KAAK,MAAM,OAAO,IAAI,+BAA+B,CAAC,gBAAgB,EAAE,CAAC;QACxE,IAAI,CAAC,wBAAwB,CAAC,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9D,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnC,CAAC;IACF,CAAC;IAED,OAAO,sBAAsB,IAAI,mBAAmB,CAAC,MAAM,KAAK,CAAC;QAChE,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE;QACxB,CAAC,CAAC;YACA,YAAY,EAAE,KAAK;YACnB,sBAAsB;YACtB,mBAAmB,EAAE,mBAAmB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS;SACrF,CAAC;AACL,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * The different Fluid layers in a client.\n * @internal\n */\nexport type FluidLayer = \"loader\" | \"driver\" | \"runtime\" | \"dataStore\";\n\n/**\n * The policy for compatibility windows that a layer uses to validate compatibility with another layer.\n * The other layer must be within this window relative to the layer to be compatible.\n * Note that the policy is defined in terms of months, but the actual compatibility check is done using generations.\n * Generations are updated every 1+ months depending on the release cadence so they are mostly 1-to-1 with months,\n * but they are always higher than months since releases are not exactly every month.\n *\n * IMPORTANT: When changing these policy values, update the documentation in \"Layer Compatibility Policy\" section of\n * LayerCompatibility.md at the root of the repository.\n *\n * @internal\n */\nexport const LayerCompatibilityPolicyWindowMonths = {\n\t/**\n\t * A newer Driver is compatible with Loader versions up to 12 months (or generations) older.\n\t */\n\tNewDriverOldLoader: 12,\n\t/**\n\t * A newer Loader is compatible with Driver versions up to 12 months (or generations) older.\n\t */\n\tNewLoaderOldDriver: 12,\n\t/**\n\t * A newer Runtime is compatible with Loader versions up to 12 months (or generations) older.\n\t */\n\tNewRuntimeOldLoader: 12,\n\t/**\n\t * A newer Loader is compatible with Runtime versions up to 3 months (or generations) older.\n\t */\n\tNewLoaderOldRuntime: 3,\n\t/**\n\t * A newer Runtime is compatible with DataStore versions up to 3 months (or generations) older.\n\t */\n\tNewRuntimeOldDataStore: 3,\n\t/**\n\t * A newer DataStore is compatible with Runtime versions up to 3 months (or generations) older.\n\t */\n\tNewDataStoreOldRuntime: 3,\n} as const;\n\n/**\n * Result of a layer compatibility check - whether a layer is compatible with another layer.\n * @internal\n */\nexport type LayerCompatCheckResult =\n\t| { readonly isCompatible: true }\n\t| {\n\t\t\treadonly isCompatible: false;\n\t\t\t/**\n\t\t\t * Whether the generation of the layer is compatible with the other layer.\n\t\t\t */\n\t\t\treadonly isGenerationCompatible: boolean;\n\t\t\t/**\n\t\t\t * The features that are required by the layer but are not supported by the other layer. This will only\n\t\t\t * be set if there are unsupported features.\n\t\t\t */\n\t\t\treadonly unsupportedFeatures: readonly string[] | undefined;\n\t };\n\n/**\n * @internal\n */\nexport const ILayerCompatDetails: keyof IProvideLayerCompatDetails = \"ILayerCompatDetails\";\n\n/**\n * @internal\n */\nexport interface IProvideLayerCompatDetails {\n\treadonly ILayerCompatDetails: ILayerCompatDetails;\n}\n\n/**\n * This interface is used to communicate the compatibility details of a layer to another layer.\n * @internal\n */\nexport interface ILayerCompatDetails extends Partial<IProvideLayerCompatDetails> {\n\t/**\n\t * A list of features supported by the layer at a particular layer boundary. This is used to check if these\n\t * set of features satisfy the requirements of another layer.\n\t */\n\treadonly supportedFeatures: ReadonlySet<string>;\n\t/**\n\t * The generation of the layer. The other layer at the layer boundary uses this to check if this satisfies\n\t * the minimum generation it requires to be compatible.\n\t *\n\t * @remarks Generation is updated on a regular cadence, say, monthly. This will allow us to determine how\n\t * far apart two layers are in terms of time and whether they are compatible.\n\t * For example, say generation is updated every month and the compatibility window between layer1 and layer2 is\n\t * 6 months. Now, if layer1 is at generation 1 and layer2 is at generation 5, then they are 4 months apart and are\n\t * compatible. But if layer1 is at generation 1 and layer2 is at generation 8, then they are 7 months apart and\n\t * are not compatible.\n\t */\n\treadonly generation: number;\n\t/**\n\t * The package version of the layer. When an incompatibility is detected, this is used to provide more context\n\t * on what the versions of the incompatible layers are.\n\t */\n\treadonly pkgVersion: string;\n}\n\n/**\n * This is the default compat details for a layer when it doesn't provide any compat details. This is used for\n * backwards compatibility to allow older layers to work before compatibility enforcement was introduced.\n * @internal\n */\nexport const defaultLayerCompatDetails: ILayerCompatDetails = {\n\tsupportedFeatures: new Set(),\n\tgeneration: 0, // 0 is reserved for layers before compatibility enforcement was introduced.\n\tpkgVersion: \"unknown\",\n};\n\n/**\n * Key used to look up {@link (ILayerCompatSupportRequirements:interface)} on a `FluidObject`.\n * @internal\n */\nexport const ILayerCompatSupportRequirements: keyof IProvideLayerCompatSupportRequirements =\n\t\"ILayerCompatSupportRequirements\";\n\n/**\n * Provides {@link (ILayerCompatSupportRequirements:interface)} so that a layer can publish, as a `FluidObject`, the\n * requirements another layer must meet to be compatible with it.\n * @internal\n */\nexport interface IProvideLayerCompatSupportRequirements {\n\treadonly ILayerCompatSupportRequirements: ILayerCompatSupportRequirements;\n}\n\n/**\n * The requirements that a layer needs another layer to support for them to be compatible.\n *\n * @remarks\n * A layer can also publish its requirements across a boundary as a `FluidObject` (via\n * {@link IProvideLayerCompatSupportRequirements}) for the case where this layer cannot run the compatibility\n * validation itself and instead needs the layer on the other side of the boundary to check itself against the\n * published requirements. Most boundaries are validated by both layers because each holds\n * a reference to the other (e.g. the Loader and the Runtime). The Driver / Loader boundary is asymmetric: the\n * Loader holds a reference to the Driver, but the Driver has no reference to the Loader and so cannot validate it.\n * To still validate in both directions, the Driver publishes its requirements for the Loader and the Loader\n * validates itself against them on the Driver's behalf.\n *\n * @internal\n */\nexport interface ILayerCompatSupportRequirements\n\textends Partial<IProvideLayerCompatSupportRequirements> {\n\t/**\n\t * The minimum supported generation the other layer needs to be at.\n\t */\n\treadonly minSupportedGeneration: number;\n\t/**\n\t * The features that the other layer needs to support.\n\t */\n\treadonly requiredFeatures: readonly string[];\n}\n\n/**\n * Checks compatibility of a layer (layer1) with another layer (layer2).\n * @param compatSupportRequirementsLayer1 - The requirements from layer1 that layer2 needs to meet.\n * @param compatDetailsLayer2 - The compatibility details of the layer2. If this is undefined, then the\n * default compatibility details are used for backwards compatibility.\n * @returns The result of the compatibility check indicating whether layer2 is compatible with layer1.\n *\n * @internal\n */\nexport function checkLayerCompatibility(\n\tcompatSupportRequirementsLayer1: ILayerCompatSupportRequirements,\n\tcompatDetailsLayer2: ILayerCompatDetails | undefined,\n): LayerCompatCheckResult {\n\tconst compatDetailsLayer2ToUse = compatDetailsLayer2 ?? defaultLayerCompatDetails;\n\tlet isGenerationCompatible = true;\n\tconst unsupportedFeatures: string[] = [];\n\n\t// If layer2's generation is less than the required minimum supported generation of layer1,\n\t// then it is not compatible.\n\tif (\n\t\tcompatDetailsLayer2ToUse.generation <\n\t\tcompatSupportRequirementsLayer1.minSupportedGeneration\n\t) {\n\t\tisGenerationCompatible = false;\n\t}\n\n\t// All features required by layer1 must be supported by layer2 to be compatible.\n\tfor (const feature of compatSupportRequirementsLayer1.requiredFeatures) {\n\t\tif (!compatDetailsLayer2ToUse.supportedFeatures.has(feature)) {\n\t\t\tunsupportedFeatures.push(feature);\n\t\t}\n\t}\n\n\treturn isGenerationCompatible && unsupportedFeatures.length === 0\n\t\t? { isCompatible: true }\n\t\t: {\n\t\t\t\tisCompatible: false,\n\t\t\t\tisGenerationCompatible,\n\t\t\t\tunsupportedFeatures: unsupportedFeatures.length > 0 ? unsupportedFeatures : undefined,\n\t\t\t};\n}\n"]}
|
package/lib/trace.js
CHANGED
|
@@ -10,10 +10,12 @@ import { performanceNow } from "./performanceIsomorphic.js";
|
|
|
10
10
|
* @internal
|
|
11
11
|
*/
|
|
12
12
|
export class Trace {
|
|
13
|
+
startTick;
|
|
13
14
|
static start() {
|
|
14
15
|
const startTick = performanceNow();
|
|
15
16
|
return new Trace(startTick);
|
|
16
17
|
}
|
|
18
|
+
lastTick;
|
|
17
19
|
constructor(startTick) {
|
|
18
20
|
this.startTick = startTick;
|
|
19
21
|
this.lastTick = startTick;
|
package/lib/trace.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../src/trace.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,OAAO,KAAK;
|
|
1
|
+
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../src/trace.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,OAAO,KAAK;IAOqB;IAN/B,MAAM,CAAC,KAAK;QAClB,MAAM,SAAS,GAAG,cAAc,EAAE,CAAC;QACnC,OAAO,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC;IAC7B,CAAC;IAES,QAAQ,CAAS;IAC3B,YAAsC,SAAiB;QAAjB,cAAS,GAAT,SAAS,CAAQ;QACtD,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;IAC3B,CAAC;IAEM,KAAK;QACX,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;QAC9B,MAAM,KAAK,GAAG;YACb,gBAAgB,EAAE,IAAI,GAAG,IAAI,CAAC,SAAS;YACvC,QAAQ,EAAE,IAAI,GAAG,IAAI,CAAC,QAAQ;YAC9B,IAAI;SACJ,CAAC;QACF,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,OAAO,KAAK,CAAC;IACd,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { performanceNow } from \"./performanceIsomorphic.js\";\n\n/**\n * Helper class for tracing performance of events\n * Time measurements are in milliseconds as a floating point with a decimal\n *\n * @internal\n */\nexport class Trace {\n\tpublic static start(): Trace {\n\t\tconst startTick = performanceNow();\n\t\treturn new Trace(startTick);\n\t}\n\n\tprotected lastTick: number;\n\tprotected constructor(public readonly startTick: number) {\n\t\tthis.lastTick = startTick;\n\t}\n\n\tpublic trace(): ITraceEvent {\n\t\tconst tick = performanceNow();\n\t\tconst event = {\n\t\t\ttotalTimeElapsed: tick - this.startTick,\n\t\t\tduration: tick - this.lastTick,\n\t\t\ttick,\n\t\t};\n\t\tthis.lastTick = tick;\n\t\treturn event;\n\t}\n}\n\n/**\n * Event in a performance trace including time elapsed.\n *\n * @internal\n */\nexport interface ITraceEvent {\n\t/**\n\t * Total time elapsed since the start of the Trace.\n\t * Measured in milliseconds as a floating point with a decimal\n\t */\n\treadonly totalTimeElapsed: number;\n\t/**\n\t * Time elapsed since the last trace event.\n\t * Measured in milliseconds as a floating point with a decimal\n\t */\n\treadonly duration: number;\n\t/**\n\t * This number represents a relative time which should\n\t * be consistent for all trace ticks.\n\t */\n\treadonly tick: number;\n}\n"]}
|
package/lib/typedEventEmitter.js
CHANGED
|
@@ -20,5 +20,12 @@ export class TypedEventEmitter extends EventEmitter {
|
|
|
20
20
|
this.removeListener = super.removeListener.bind(this);
|
|
21
21
|
this.off = super.off.bind(this);
|
|
22
22
|
}
|
|
23
|
+
addListener;
|
|
24
|
+
on;
|
|
25
|
+
once;
|
|
26
|
+
prependListener;
|
|
27
|
+
prependOnceListener;
|
|
28
|
+
removeListener;
|
|
29
|
+
off;
|
|
23
30
|
}
|
|
24
31
|
//# sourceMappingURL=typedEventEmitter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typedEventEmitter.js","sourceRoot":"","sources":["../src/typedEventEmitter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AA8BlD;;;;;GAKG;AACH,MAAM,OAAO,iBACZ,SAAQ,YAAY;IAGpB;QACC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;QACrF,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;QACnE,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;QACvE,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAGrD,CAAC;QACF,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAG7D,CAAC;QACF,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;QAC3F,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;IACtE,CAAC;
|
|
1
|
+
{"version":3,"file":"typedEventEmitter.js","sourceRoot":"","sources":["../src/typedEventEmitter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AA8BlD;;;;;GAKG;AACH,MAAM,OAAO,iBACZ,SAAQ,YAAY;IAGpB;QACC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;QACrF,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;QACnE,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;QACvE,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAGrD,CAAC;QACF,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAG7D,CAAC;QACF,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;QAC3F,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;IACtE,CAAC;IACe,WAAW,CAAoC;IAC/C,EAAE,CAAoC;IACtC,IAAI,CAAoC;IACxC,eAAe,CAAoC;IACnD,mBAAmB,CAAoC;IACvD,cAAc,CAAoC;IAClD,GAAG,CAAoC;CACvD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIEvent,\n\tIEventProvider,\n\tIEventTransformer,\n\tTransformedEvent,\n} from \"@fluidframework/core-interfaces\";\n\nimport { EventEmitter } from \"./eventEmitter.cjs\";\n\n/**\n * The event emitter polyfill and the node event emitter have different event types:\n * string | symbol vs. string | number\n *\n * The polyfill is now always used, but string is the only event type preferred.\n * @legacy @beta\n */\nexport type EventEmitterEventType = string;\n\n/**\n * @legacy @beta\n */\nexport type TypedEventTransform<TThis, TEvent> =\n\t// Event emitter supports some special events for the emitter itself to use\n\t// this exposes those events for the TypedEventEmitter.\n\t// Since we know what the shape of these events are, we can describe them directly via a TransformedEvent\n\t// which easier than trying to extend TEvent directly\n\tTransformedEvent<\n\t\tTThis,\n\t\t\"newListener\" | \"removeListener\",\n\t\tParameters<(event: string, listener: (...args: any[]) => void) => void>\n\t> &\n\t\t// Expose all the events provides by TEvent\n\t\tIEventTransformer<TThis, TEvent & IEvent> &\n\t\t// Add the default overload so this is covertable to EventEmitter regardless of environment\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tTransformedEvent<TThis, EventEmitterEventType, any[]>;\n\n/**\n * Event Emitter helper class the supports emitting typed events.\n * @privateRemarks\n * This should become internal once the classes extending it become internal.\n * @legacy @beta\n */\nexport class TypedEventEmitter<TEvent>\n\textends EventEmitter\n\timplements IEventProvider<TEvent & IEvent>\n{\n\tpublic constructor() {\n\t\tsuper();\n\t\tthis.addListener = super.addListener.bind(this) as TypedEventTransform<this, TEvent>;\n\t\tthis.on = super.on.bind(this) as TypedEventTransform<this, TEvent>;\n\t\tthis.once = super.once.bind(this) as TypedEventTransform<this, TEvent>;\n\t\tthis.prependListener = super.prependListener.bind(this) as TypedEventTransform<\n\t\t\tthis,\n\t\t\tTEvent\n\t\t>;\n\t\tthis.prependOnceListener = super.prependOnceListener.bind(this) as TypedEventTransform<\n\t\t\tthis,\n\t\t\tTEvent\n\t\t>;\n\t\tthis.removeListener = super.removeListener.bind(this) as TypedEventTransform<this, TEvent>;\n\t\tthis.off = super.off.bind(this) as TypedEventTransform<this, TEvent>;\n\t}\n\tpublic readonly addListener: TypedEventTransform<this, TEvent>;\n\tpublic readonly on: TypedEventTransform<this, TEvent>;\n\tpublic readonly once: TypedEventTransform<this, TEvent>;\n\tpublic readonly prependListener: TypedEventTransform<this, TEvent>;\n\tpublic readonly prependOnceListener: TypedEventTransform<this, TEvent>;\n\tpublic readonly removeListener: TypedEventTransform<this, TEvent>;\n\tpublic readonly off: TypedEventTransform<this, TEvent>;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-internal/client-utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Not intended for use outside the Fluid Framework.",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -15,24 +15,12 @@
|
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|
|
17
17
|
"node": {
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
"default": "./lib/indexNode.js"
|
|
21
|
-
},
|
|
22
|
-
"require": {
|
|
23
|
-
"types": "./dist/indexNode.d.ts",
|
|
24
|
-
"default": "./dist/indexNode.js"
|
|
25
|
-
}
|
|
18
|
+
"types": "./lib/indexNode.d.ts",
|
|
19
|
+
"default": "./lib/indexNode.js"
|
|
26
20
|
},
|
|
27
21
|
"default": {
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
"default": "./lib/indexBrowser.js"
|
|
31
|
-
},
|
|
32
|
-
"require": {
|
|
33
|
-
"types": "./dist/indexBrowser.d.ts",
|
|
34
|
-
"default": "./dist/indexBrowser.js"
|
|
35
|
-
}
|
|
22
|
+
"types": "./lib/indexBrowser.d.ts",
|
|
23
|
+
"default": "./lib/indexBrowser.js"
|
|
36
24
|
}
|
|
37
25
|
},
|
|
38
26
|
"./internal-api-report/current": {
|
|
@@ -52,8 +40,6 @@
|
|
|
52
40
|
}
|
|
53
41
|
}
|
|
54
42
|
},
|
|
55
|
-
"main": "lib/indexBrowser.js",
|
|
56
|
-
"types": "lib/indexBrowser.d.ts",
|
|
57
43
|
"c8": {
|
|
58
44
|
"all": true,
|
|
59
45
|
"cache-dir": "nyc/.cache",
|
|
@@ -77,8 +63,8 @@
|
|
|
77
63
|
"temp-directory": "nyc/.nyc_output"
|
|
78
64
|
},
|
|
79
65
|
"dependencies": {
|
|
80
|
-
"@fluidframework/core-interfaces": "~
|
|
81
|
-
"@fluidframework/core-utils": "~
|
|
66
|
+
"@fluidframework/core-interfaces": "~3.0.0",
|
|
67
|
+
"@fluidframework/core-utils": "~3.0.0",
|
|
82
68
|
"@types/events_pkg": "npm:@types/events@^3.0.0",
|
|
83
69
|
"base64-js": "^1.5.1",
|
|
84
70
|
"buffer": "^6.0.3",
|
|
@@ -89,18 +75,15 @@
|
|
|
89
75
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
90
76
|
"@biomejs/biome": "~2.4.5",
|
|
91
77
|
"@fluid-internal/client-utils-previous": "npm:@fluid-internal/client-utils@2.116.0",
|
|
92
|
-
"@fluid-internal/mocha-test-setup": "~
|
|
78
|
+
"@fluid-internal/mocha-test-setup": "~3.0.0",
|
|
93
79
|
"@fluid-tools/build-cli": "^0.67.0",
|
|
94
80
|
"@fluidframework/build-common": "^2.0.3",
|
|
95
81
|
"@fluidframework/build-tools": "^0.67.0",
|
|
96
82
|
"@fluidframework/eslint-config-fluid": "^14.0.0",
|
|
97
83
|
"@microsoft/api-extractor": "7.58.1",
|
|
98
|
-
"@
|
|
99
|
-
"@types/jest": "29.5.3",
|
|
100
|
-
"@types/jest-environment-puppeteer": "~2.117.0",
|
|
84
|
+
"@playwright/test": "^1.62.1",
|
|
101
85
|
"@types/mocha": "^10.0.10",
|
|
102
86
|
"@types/node": "~22.19.17",
|
|
103
|
-
"@types/rewire": "^2.5.30",
|
|
104
87
|
"@types/sha.js": "^2.4.4",
|
|
105
88
|
"@types/sinon": "^17.0.3",
|
|
106
89
|
"c8": "^10.1.3",
|
|
@@ -109,61 +92,60 @@
|
|
|
109
92
|
"cross-env": "^10.1.0",
|
|
110
93
|
"eslint": "~9.39.1",
|
|
111
94
|
"eslint-config-prettier": "~10.1.8",
|
|
112
|
-
"jest": "^29.6.2",
|
|
113
|
-
"jest-environment-puppeteer": "^10.1.3",
|
|
114
|
-
"jest-junit": "^16.0.0",
|
|
115
|
-
"jest-puppeteer": "^10.1.3",
|
|
116
95
|
"jiti": "^2.6.1",
|
|
117
96
|
"mocha": "^11.7.5",
|
|
118
97
|
"mocha-multi-reporters": "^1.5.1",
|
|
119
|
-
"puppeteer": "^23.6.0",
|
|
120
|
-
"rewire": "^9.0.1",
|
|
121
98
|
"rimraf": "^6.1.3",
|
|
122
99
|
"sinon": "^18.0.1",
|
|
123
|
-
"ts-jest": "^29.1.1",
|
|
124
100
|
"ts-node": "^10.9.2",
|
|
125
|
-
"typescript": "~
|
|
101
|
+
"typescript": "~6.0.3",
|
|
102
|
+
"webpack": "^5.94.0",
|
|
103
|
+
"webpack-cli": "^5.1.4"
|
|
126
104
|
},
|
|
127
105
|
"fluidBuild": {
|
|
128
106
|
"tasks": {
|
|
107
|
+
"eslint": [
|
|
108
|
+
"build:esm"
|
|
109
|
+
],
|
|
129
110
|
"build:api-reports:browser:current": [
|
|
130
|
-
"build:exports:browser"
|
|
111
|
+
"build:exports:browser",
|
|
112
|
+
"^build:api-reports"
|
|
131
113
|
],
|
|
132
114
|
"build:api-reports:browser:legacy": [
|
|
133
|
-
"build:exports:browser"
|
|
115
|
+
"build:exports:browser",
|
|
116
|
+
"^build:api-reports"
|
|
134
117
|
],
|
|
135
118
|
"build:api-reports:node:current": [
|
|
136
|
-
"build:api-reports:browser:current"
|
|
119
|
+
"build:api-reports:browser:current",
|
|
120
|
+
"^build:api-reports"
|
|
137
121
|
],
|
|
138
122
|
"build:api-reports:node:legacy": [
|
|
139
|
-
"build:api-reports:browser:legacy"
|
|
123
|
+
"build:api-reports:browser:legacy",
|
|
124
|
+
"^build:api-reports"
|
|
140
125
|
],
|
|
141
126
|
"build:exports:browser": [
|
|
142
|
-
"build:
|
|
127
|
+
"build:esm"
|
|
143
128
|
],
|
|
144
129
|
"build:exports:node": [
|
|
145
|
-
"build:
|
|
146
|
-
],
|
|
147
|
-
"build:test:jest": [
|
|
148
|
-
"tsc"
|
|
130
|
+
"build:esm"
|
|
149
131
|
],
|
|
150
132
|
"build:test:mocha:cjs": [
|
|
151
|
-
"
|
|
133
|
+
"build:cjs"
|
|
152
134
|
],
|
|
153
135
|
"build:test:mocha:esm": [
|
|
154
|
-
"build:
|
|
136
|
+
"build:esm"
|
|
155
137
|
],
|
|
156
138
|
"build:test:types": [
|
|
157
|
-
"build:
|
|
139
|
+
"build:esm"
|
|
158
140
|
],
|
|
159
141
|
"check:exports:bundle-release-tags": [
|
|
160
142
|
"build:exports:browser"
|
|
161
143
|
],
|
|
162
144
|
"check:exports:cjs:indexBrowser": [
|
|
163
|
-
"
|
|
145
|
+
"build:cjs"
|
|
164
146
|
],
|
|
165
147
|
"check:exports:cjs:indexNode": [
|
|
166
|
-
"
|
|
148
|
+
"build:cjs"
|
|
167
149
|
],
|
|
168
150
|
"check:exports:esm:browser:current": [
|
|
169
151
|
"build:exports:browser"
|
|
@@ -172,7 +154,7 @@
|
|
|
172
154
|
"build:exports:browser"
|
|
173
155
|
],
|
|
174
156
|
"check:exports:esm:indexBrowser": [
|
|
175
|
-
"build:
|
|
157
|
+
"build:esm"
|
|
176
158
|
],
|
|
177
159
|
"check:exports:esm:indexNode": [
|
|
178
160
|
"build:exports:node"
|
|
@@ -184,16 +166,20 @@
|
|
|
184
166
|
"build:exports:node"
|
|
185
167
|
],
|
|
186
168
|
"ci:build:api-reports:browser:current": [
|
|
187
|
-
"build:exports:browser"
|
|
169
|
+
"build:exports:browser",
|
|
170
|
+
"^ci:build:api-reports"
|
|
188
171
|
],
|
|
189
172
|
"ci:build:api-reports:browser:legacy": [
|
|
190
|
-
"build:exports:browser"
|
|
173
|
+
"build:exports:browser",
|
|
174
|
+
"^ci:build:api-reports"
|
|
191
175
|
],
|
|
192
176
|
"ci:build:api-reports:node:current": [
|
|
193
|
-
"build:exports:node"
|
|
177
|
+
"build:exports:node",
|
|
178
|
+
"^ci:build:api-reports"
|
|
194
179
|
],
|
|
195
180
|
"ci:build:api-reports:node:legacy": [
|
|
196
|
-
"build:exports:node"
|
|
181
|
+
"build:exports:node",
|
|
182
|
+
"^ci:build:api-reports"
|
|
197
183
|
],
|
|
198
184
|
"test:mocha:cjs": [
|
|
199
185
|
"build:test:mocha:cjs"
|
|
@@ -209,8 +195,24 @@
|
|
|
209
195
|
"releasePkgVersion": "2.115.0"
|
|
210
196
|
},
|
|
211
197
|
"typeValidation": {
|
|
212
|
-
"broken": {
|
|
213
|
-
|
|
198
|
+
"broken": {
|
|
199
|
+
"Class_Buffer": {
|
|
200
|
+
"backCompat": false
|
|
201
|
+
},
|
|
202
|
+
"Function_Uint8ArrayToArrayBuffer": {
|
|
203
|
+
"backCompat": false
|
|
204
|
+
},
|
|
205
|
+
"TypeAlias_IsoBuffer": {
|
|
206
|
+
"backCompat": false
|
|
207
|
+
},
|
|
208
|
+
"Variable_IsoBuffer": {
|
|
209
|
+
"backCompat": false
|
|
210
|
+
},
|
|
211
|
+
"Variable_LayerCompatibilityPolicyWindowMonths": {
|
|
212
|
+
"backCompat": false
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
"entrypoint": ""
|
|
214
216
|
},
|
|
215
217
|
"scripts": {
|
|
216
218
|
"build": "fluid-build . --task build",
|
|
@@ -219,19 +221,20 @@
|
|
|
219
221
|
"build:api-reports:browser:legacy": "api-extractor run --local --config api-extractor/api-extractor-report-browser.legacy.json",
|
|
220
222
|
"build:api-reports:node:current": "npm run ci:build:api-reports:node:current",
|
|
221
223
|
"build:api-reports:node:legacy": "npm run ci:build:api-reports:node:legacy",
|
|
224
|
+
"build:cjs": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist",
|
|
222
225
|
"build:commonjs": "fluid-build . --task commonjs",
|
|
223
226
|
"build:compile": "fluid-build . --task compile",
|
|
224
227
|
"build:docs": "api-extractor run --local --config api-extractor/api-extractor-model-browser.json",
|
|
225
|
-
"build:
|
|
228
|
+
"build:esm": "tsc --project ./tsconfig.json",
|
|
226
229
|
"build:exports:browser": "flub generate entrypoints --outFileLegacyBeta legacy --outFilePrefix {@unscopedPackageName}.browser. --mainEntrypoint ./src/indexBrowser.ts --outDir ./lib",
|
|
227
230
|
"build:exports:node": "flub generate entrypoints --outFileLegacyBeta legacy --outFilePrefix {@unscopedPackageName}.node. --mainEntrypoint ./src/indexNode.ts --outDir ./lib",
|
|
228
|
-
"build:test": "concurrently npm:build:test:mocha npm:build:test:
|
|
229
|
-
"build:test:jest": "fluid-tsc commonjs --project ./src/test/jest/tsconfig.cjs.json",
|
|
231
|
+
"build:test": "concurrently npm:build:test:mocha npm:build:test:playwright npm:build:test:types",
|
|
230
232
|
"build:test:mocha": "concurrently npm:build:test:mocha:esm npm:build:test:mocha:cjs",
|
|
231
233
|
"build:test:mocha:cjs": "fluid-tsc commonjs --project ./src/test/mocha/tsconfig.cjs.json",
|
|
232
234
|
"build:test:mocha:esm": "tsc --project ./src/test/mocha/tsconfig.json",
|
|
235
|
+
"build:test:playwright": "tsc --project ./src/test/playwright/tsconfig.json && webpack --config webpack.playwright.cjs",
|
|
233
236
|
"build:test:types": "tsc --project ./src/test/types/tsconfig.json",
|
|
234
|
-
"check:are-the-types-wrong": "attw --pack . --exclude-entrypoints ./internal-api-report/current ./internal-api-report/legacy",
|
|
237
|
+
"check:are-the-types-wrong": "attw --pack . --profile esm-only --exclude-entrypoints ./internal-api-report/current ./internal-api-report/legacy",
|
|
235
238
|
"check:biome": "biome check .",
|
|
236
239
|
"check:exports": "concurrently \"npm:check:exports:*\"",
|
|
237
240
|
"check:exports:bundle-release-tags": "api-extractor run --config api-extractor/api-extractor-lint-bundle.json",
|
|
@@ -244,6 +247,7 @@
|
|
|
244
247
|
"check:exports:esm:node:current": "api-extractor run --config api-extractor/api-extractor-lint-node.current.esm.json",
|
|
245
248
|
"check:exports:esm:node:legacy": "api-extractor run --config api-extractor/api-extractor-lint-node.legacy.esm.json",
|
|
246
249
|
"check:format": "npm run check:biome",
|
|
250
|
+
"check:types:inexactOptionalPropertyTypes": "tsc --project ./tsconfig.json --noEmit --exactOptionalPropertyTypes false --skipLibCheck --emitDeclarationOnly false --tsBuildInfoFile ./tsconfig.inexactOptionalPropertyTypes.tsbuildinfo",
|
|
247
251
|
"ci:build:api-reports": "concurrently \"npm:ci:build:api-reports:*\"",
|
|
248
252
|
"ci:build:api-reports:browser:current": "api-extractor run --config api-extractor/api-extractor-report-browser.current.json",
|
|
249
253
|
"ci:build:api-reports:browser:legacy": "api-extractor run --config api-extractor/api-extractor-report-browser.legacy.json",
|
|
@@ -258,13 +262,12 @@
|
|
|
258
262
|
"layerGeneration:gen": "flub generate compatLayerGeneration --dir . -v",
|
|
259
263
|
"lint": "fluid-build . --task lint",
|
|
260
264
|
"lint:fix": "fluid-build . --task eslint:fix --task format",
|
|
261
|
-
"test": "npm run test:mocha && npm run test:
|
|
265
|
+
"test": "npm run test:mocha && npm run test:playwright",
|
|
262
266
|
"test:coverage": "c8 npm test",
|
|
263
|
-
"test:jest": "jest --ci",
|
|
264
267
|
"test:mocha": "npm run test:mocha:esm && npm run test:mocha:cjs",
|
|
265
268
|
"test:mocha:cjs": "cross-env FLUID_TEST_MODULE_SYSTEM=CJS \"MOCHA_SPEC=dist/test/mocha/**/*.spec.*js\" mocha",
|
|
266
269
|
"test:mocha:esm": "cross-env \"MOCHA_SPEC=lib/test/mocha/**/*.spec.*js\" mocha",
|
|
267
|
-
"
|
|
270
|
+
"test:playwright": "playwright test",
|
|
268
271
|
"typetests:gen": "flub generate typetests --dir . -v"
|
|
269
272
|
}
|
|
270
273
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { defineConfig, devices } from "@playwright/test";
|
|
7
|
+
|
|
8
|
+
export default defineConfig({
|
|
9
|
+
// Run against the built test output (matches the pattern used by mocha:esm tests).
|
|
10
|
+
testDir: "lib/test/playwright",
|
|
11
|
+
forbidOnly: !!process.env.CI,
|
|
12
|
+
retries: 0,
|
|
13
|
+
timeout: 60_000,
|
|
14
|
+
outputDir: "nyc/test-results",
|
|
15
|
+
reporter: [["list"], ["junit", { outputFile: "nyc/junit-report.xml" }]],
|
|
16
|
+
use: {
|
|
17
|
+
headless: true,
|
|
18
|
+
launchOptions: {
|
|
19
|
+
args: ["--no-sandbox", "--disable-setuid-sandbox"],
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
projects: [{ name: "chromium", use: { ...devices["Desktop Chrome"] } }],
|
|
23
|
+
});
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
import type { IsoBufferEncoding } from "./buffer.js";
|
|
7
|
+
// This file is a browser-specific implementation of the base64 encoding functions.
|
|
7
8
|
// Aside from the below import statement, this file should be identical to the
|
|
8
9
|
// base64EncodingNode.ts.
|
|
9
10
|
//
|
|
@@ -36,7 +37,7 @@ export const fromUtf8ToBase64 = (input: string): string =>
|
|
|
36
37
|
*
|
|
37
38
|
* @internal
|
|
38
39
|
*/
|
|
39
|
-
export const toUtf8 = (input: string, encoding:
|
|
40
|
+
export const toUtf8 = (input: string, encoding: IsoBufferEncoding): string => {
|
|
40
41
|
switch (encoding) {
|
|
41
42
|
case "utf8":
|
|
42
43
|
// eslint-disable-next-line unicorn/text-encoding-identifier-case -- this value is supported, just discouraged
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import type { IsoBufferEncoding } from "./buffer.js";
|
|
6
7
|
// This file is a Node.js-specific implementation of the base64 encoding functions.
|
|
7
8
|
// Aside from the below import statement, this file should be identical to the
|
|
8
9
|
// base64EncodingBrowser.ts.
|
|
@@ -36,7 +37,7 @@ export const fromUtf8ToBase64 = (input: string): string =>
|
|
|
36
37
|
*
|
|
37
38
|
* @internal
|
|
38
39
|
*/
|
|
39
|
-
export const toUtf8 = (input: string, encoding:
|
|
40
|
+
export const toUtf8 = (input: string, encoding: IsoBufferEncoding): string => {
|
|
40
41
|
switch (encoding) {
|
|
41
42
|
case "utf8":
|
|
42
43
|
// eslint-disable-next-line unicorn/text-encoding-identifier-case -- this value is supported, just discouraged
|