microsoft / FluidFramework

Library for building distributed, real-time collaborative web applications
https://fluidframework.com
MIT License
4.7k stars 528 forks source link

Include CJS build output to test-end-to-end-tests package #21955

Closed jikim-msft closed 1 month ago

jikim-msft commented 1 month ago

Description

ADO 9076

This PR enables dual emit of CJS and ESM build outputs in @fluid-private/test-end-to-end-tests. Mostly follows the instructions in the build-common readme.

msfluid-bot commented 1 month ago
@fluid-example/bundle-size-tests: +245 Bytes
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 457.46 KB 457.5 KB +35 Bytes
azureClient.js 555.23 KB 555.28 KB +49 Bytes
connectionState.js 680 Bytes 680 Bytes No change
containerRuntime.js 258.67 KB 258.68 KB +14 Bytes
fluidFramework.js 405.94 KB 405.95 KB +14 Bytes
loader.js 134.04 KB 134.05 KB +14 Bytes
map.js 42.13 KB 42.14 KB +7 Bytes
matrix.js 145.61 KB 145.62 KB +7 Bytes
odspClient.js 523.37 KB 523.42 KB +49 Bytes
odspDriver.js 97.55 KB 97.57 KB +21 Bytes
odspPrefetchSnapshot.js 42.61 KB 42.62 KB +14 Bytes
sharedString.js 162.62 KB 162.63 KB +7 Bytes
sharedTree.js 396.45 KB 396.46 KB +7 Bytes
Total Size 3.3 MB 3.3 MB +245 Bytes

Baseline commit: 489cbdedd9c34e9bf1e68da6b8086256ce1f6db8

Generated by :no_entry_sign: dangerJS against fb9ec94ca5e699bede6dba3941a45daf818c3e94

jikim-msft commented 1 month ago

Closing this item until Mocha library resolves the issue with global setup.

describeCompat leverages custom workaround function async mochaGlobalSetup() to ensure all the compatibility versions are loaded when in the creation of the test-suite. Due to this top-level async/await pattern, CJS build output is NOT compatible with the source code.

@fluid-private/test-end-to-end-tests heavily relies on describeCompat to run the e2e tests, therefore changing or replacing the current logic is not feasible.

More Detail found in this document: Investigation on CommonJS (CJS) Pipeline Setup.loop