Skip to content

build(build-tools): enable exactOptionalPropertyTypes#27568

Open
jason-ha wants to merge 1 commit into
mainfrom
build-tools/support-exactOptionalPropertyTypes
Open

build(build-tools): enable exactOptionalPropertyTypes#27568
jason-ha wants to merge 1 commit into
mainfrom
build-tools/support-exactOptionalPropertyTypes

Conversation

@jason-ha

Copy link
Copy Markdown
Contributor

Update build-tools packages to use exactOptionalPropertyTypes:true in normal build as well as check exactOptionalPropertyTypes:false successfully type checks (no emit, skipLibCheck).

Fixes

build-tools:

  • common/biomeConfigUtils.ts — Conditionally spread stopAt only when defined, avoiding passing undefined to the find-up library's Options.stopAt which expects string.
  • fluidBuild/commonOptions.ts — Changed defaultRoot and root from optional properties (?: string) to required properties with explicit undefined in the union (string | undefined), allowing direct assignment from process.env.
  • fluidBuild/fluidRepo.ts — Removed explicit ignoredDirs: undefined assignment; conditionally spread ignoredDirs only when the mapped value is defined.
  • fluidBuild/tasks/workers/apiExtractorWorker.ts — Split return into two distinct object literals (success without error, failure with error) instead of assigning undefined to the optional error property.
  • fluidBuild/tsCompile.ts — Conditionally spread projectReferences only when commandLine.projectReferences is defined, avoiding passing undefined to TypeScript API's CreateProgramOptions.

version-tools:

  • commands/version.ts — Conditionally spread bumpType only when defined, avoiding undefined assignment to an optional property.

Update build-tools packages to use exactOptionalPropertyTypes:true in normal build as well as check exactOptionalPropertyTypes:false successfully type checks (no emit, skipLibCheck).

### Fixes
build-tools:
- common/biomeConfigUtils.ts  — Conditionally spread  stopAt  only when defined, avoiding passing  undefined  to the  find-up  library's  Options.stopAt  which expects  string .
- fluidBuild/commonOptions.ts  — Changed  defaultRoot  and  root  from optional properties ( ?: string ) to required properties with explicit  undefined  in the union ( string |    undefined ), allowing direct assignment from  process.env .
- fluidBuild/fluidRepo.ts  — Removed explicit  ignoredDirs: undefined  assignment; conditionally spread  ignoredDirs  only when the mapped value is defined.
- fluidBuild/tasks/workers/apiExtractorWorker.ts  — Split return into two distinct object literals (success without  error , failure with  error ) instead of assigning  undefined  to the    optional  error  property.
- fluidBuild/tsCompile.ts  — Conditionally spread  projectReferences  only when  commandLine.projectReferences  is defined, avoiding passing  undefined  to TypeScript API's     CreateProgramOptions .

 version-tools:
 - commands/version.ts  — Conditionally spread  bumpType  only when defined, avoiding  undefined  assignment to an optional property.
@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Bundle size comparison

Base commit: 3adb358594a36333b40463a2f8be3abcb07c782c
Head commit: 7e6d946c0f039ca511a1c599d103103c505cda05

Notable changes

No bundles changed by ≥ 500 bytes parsed.

Per-bundle deltas

@fluid-example/bundle-size-tests

  • azureClient.js: parsed 619019 → 619075 (+56), gzip 164797 → 164845 (+48)
  • odspClient.js: parsed 591853 → 591909 (+56), gzip 158891 → 158933 (+42)
  • aqueduct.js: parsed 525463 → 525498 (+35), gzip 140683 → 140715 (+32)
  • fluidFramework.js: parsed 392149 → 392170 (+21), gzip 111130 → 111148 (+18)
  • sharedTree.js: parsed 381536 → 381550 (+14), gzip 108525 → 108536 (+11)
  • containerRuntime.js: parsed 303813 → 303827 (+14), gzip 83188 → 83196 (+8)
  • sharedString.js: parsed 175984 → 175991 (+7), gzip 49445 → 49453 (+8)
  • experimentalSharedTree.js: parsed 160798 → 160798 (0), gzip 45804 → 45804 (0)
  • matrix.js: parsed 159845 → 159852 (+7), gzip 45411 → 45418 (+7)
  • loader.js: parsed 145307 → 145321 (+14), gzip 39063 → 39078 (+15)
  • odspDriver.js: parsed 104431 → 104452 (+21), gzip 32647 → 32657 (+10)
  • directory.js: parsed 66616 → 66623 (+7), gzip 18532 → 18540 (+8)
  • 748.js: parsed 58793 → 58793 (0), gzip 17826 → 17826 (0)
  • map.js: parsed 46709 → 46716 (+7), gzip 14310 → 14317 (+7)
  • odspPrefetchSnapshot.js: parsed 45650 → 45664 (+14), gzip 15276 → 15284 (+8)
  • 594.js: parsed 44493 → 44493 (0), gzip 13744 → 13744 (0)
  • summarizerDelayLoadedModule.js: parsed 30753 → 30753 (0), gzip 7767 → 7767 (0)
  • socketModule.js: parsed 26486 → 26493 (+7), gzip 7883 → 7891 (+8)
  • createNewModule.js: parsed 12480 → 12480 (0), gzip 4786 → 4786 (0)
  • summaryModule.js: parsed 3797 → 3797 (0), gzip 1860 → 1860 (0)
  • connectionState.js: parsed 724 → 724 (0), gzip 429 → 429 (0)
  • sharedTreeAttributes.js: parsed 666 → 673 (+7), gzip 431 → 441 (+10)
  • debugAssert.js: parsed 429 → 429 (0), gzip 299 → 299 (0)
  • FluidFramework-HashFallback.js: parsed 422 → 422 (0), gzip 316 → 316 (0)

@github-actions

Copy link
Copy Markdown
Contributor

Hi! Thank you for opening this PR. Want me to review it?

Based on the diff (106 lines, 18 files), I've queued these reviewers:

  • Correctness — logic errors, race conditions, lifecycle issues
  • Security — vulnerabilities, secret exposure, injection
  • API Compatibility — breaking changes, release tags, type design
  • Performance — algorithmic regressions, memory leaks
  • Testing — coverage gaps, hollow tests

How this works

  • Adjust the reviewer set by ticking/unticking boxes above. Reviewer toggles alone don't trigger anything.

  • Tick Start review below to dispatch the review fleet.

  • After review finishes, tick Start review again to request another run — it auto-resets after each dispatch.

  • This comment updates as new commits land; your reviewer selections are preserved.

  • Start review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants