FluidFramework
FluidFramework copied to clipboard
refactor(build-tools): Update build-tools to use common build-infra
[!IMPORTANT] Read the PR description for #22347 first. This change builds on top of that infrastructure.
In #22347 we introduced a new package with common infrastructure for build-cli and fluid-build. This change is the first step in adapting those packages to the new infrastructure.
Summary of changes
fluid-build (build-tools)
IFluidBuildPackageJsonextendsPackageJsonwith fluid-build-specific config properties. This type is used as the package.json type through fluid-build.IFluidBuildPackageextendsIPackage<IFluidBuildPackageJson>and is intended to be a replacement for the currently exportedPackageclass.- Code that used the
Packageclass has been updated to useIPackagewherever possible, andIFluidBuildPackagein places that need fluid-build specific properties. - The
Packageclass was renamed toPackageClassand its load functions are marked deprecated. There are still uses in build-cli, so the class remains exported. - The internal type
IFluidBuildPackageis exported asPackageso most downstream code does not need to be updated. However, there are places where the PackageClass is used directly that will be cleaned up in a future change. - The internal type
IFluidBuildPackageJsonis exported from the package asPackageJsonfor the same reasons as above. Once build-cli is more fully converted to use build-infrastructure, then these uses will be removed and the exports can also be removed.
build-cli
- There were places where build-cli used the
Packageclass as a type narrower, butPackageis now an interface (see above). In all those cases I was able to rewrite the logic to narrow the types differently. This was done to minimize churn in this change. - As noted earlier, the
PackageClassis still used in the flub filtering and selection code. That code can mostly be deleted once it's using build-infrastructure, because that package includes the filtering support directly in the IFluidRepo type.
⯅ @fluid-example/bundle-size-tests: +245 Bytes
| Metric Name | Baseline Size | Compare Size | Size Diff |
|---|---|---|---|
| aqueduct.js | 459.88 KB | 459.92 KB | ⯅ +35 Bytes |
| azureClient.js | 556.87 KB | 556.91 KB | ⯅ +49 Bytes |
| connectionState.js | 724 Bytes | 724 Bytes | ■ No change |
| containerRuntime.js | 259.16 KB | 259.17 KB | ⯅ +14 Bytes |
| fluidFramework.js | 405.93 KB | 405.95 KB | ⯅ +14 Bytes |
| loader.js | 134.34 KB | 134.36 KB | ⯅ +14 Bytes |
| map.js | 42.46 KB | 42.46 KB | ⯅ +7 Bytes |
| matrix.js | 148.63 KB | 148.64 KB | ⯅ +7 Bytes |
| odspClient.js | 523.83 KB | 523.88 KB | ⯅ +49 Bytes |
| odspDriver.js | 97.84 KB | 97.86 KB | ⯅ +21 Bytes |
| odspPrefetchSnapshot.js | 42.81 KB | 42.82 KB | ⯅ +14 Bytes |
| sharedString.js | 164.82 KB | 164.83 KB | ⯅ +7 Bytes |
| sharedTree.js | 396.39 KB | 396.4 KB | ⯅ +7 Bytes |
| Total Size | 3.31 MB | 3.31 MB | ⯅ +245 Bytes |
Baseline commit: 880afad1349f73746eb4413d41e8d8492699c7c3
Generated by :no_entry_sign: dangerJS against 895adc73e97bdda4d5d67cd9f1a49f9f76299cc3
This PR has been automatically marked as stale because it has had no activity for 60 days. It will be closed if no further activity occurs within 8 days of this comment. Thank you for your contributions to Fluid Framework!