FluidFramework icon indicating copy to clipboard operation
FluidFramework copied to clipboard

refactor(build-tools): Update build-tools to use common build-infra

Open tylerbutler opened this issue 1 year ago • 1 comments

[!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)

  • IFluidBuildPackageJson extends PackageJson with fluid-build-specific config properties. This type is used as the package.json type through fluid-build.
  • IFluidBuildPackage extends IPackage<IFluidBuildPackageJson> and is intended to be a replacement for the currently exported Package class.
  • Code that used the Package class has been updated to use IPackage wherever possible, and IFluidBuildPackage in places that need fluid-build specific properties.
  • The Package class was renamed to PackageClass and its load functions are marked deprecated. There are still uses in build-cli, so the class remains exported.
  • The internal type IFluidBuildPackage is exported as Package so 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 IFluidBuildPackageJson is exported from the package as PackageJson for 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 Package class as a type narrower, but Package is 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 PackageClass is 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.

tylerbutler avatar Sep 27 '24 01:09 tylerbutler

@fluid-example/bundle-size-tests: +245 Bytes
Metric NameBaseline SizeCompare SizeSize 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

msfluid-bot avatar Sep 27 '24 01:09 msfluid-bot

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!