From 2ec7657332fdd34389b34942de771cc2fa871b56 Mon Sep 17 00:00:00 2001 From: Tyler Butler Date: Sat, 23 Nov 2024 15:45:28 -0800 Subject: [PATCH 01/11] improvement(fluid-build): Ignore some tsconfig fields when determining incremental build --- .../src/fluidBuild/tasks/leaf/tscTask.ts | 55 ++++++++++++++++--- .../src/fluidBuild/tasks/taskUtils.ts | 53 ++++++++++++++++++ 2 files changed, 99 insertions(+), 9 deletions(-) diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts index 9e356305916a..b8cd5f09fb5c 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts @@ -3,15 +3,16 @@ * Licensed under the MIT License. */ -import * as assert from "node:assert"; +import assert from "node:assert"; import { type BigIntStats, type Stats, existsSync, lstatSync } from "node:fs"; import { readFile } from "node:fs/promises"; import path from "node:path"; + import isEqual from "lodash.isequal"; import * as tsTypes from "typescript"; import { TscUtil, getTscUtils } from "../../tscUtils"; -import { getInstalledPackageVersion } from "../taskUtils"; +import { diffObjects, getInstalledPackageVersion } from "../taskUtils"; import { LeafTask, LeafWithDoneFileTask } from "./leafTask"; interface ITsBuildInfo { @@ -258,13 +259,49 @@ export class TscTask extends LeafTask { path.resolve, ); - if (!isEqual(configOptions, tsBuildInfoOptions)) { - this.traceTrigger(`ts option changed ${configFileFullPath}`); - this.traceTrigger("Config:"); - this.traceTrigger(JSON.stringify(configOptions, undefined, 2)); - this.traceTrigger("BuildInfo:"); - this.traceTrigger(JSON.stringify(tsBuildInfoOptions, undefined, 2)); - return false; + // The following code checks that the cached buildInfo options -- that is, the tsconfig options used to build + // originally -- match the current tsconfig. If they don't match, then the cache is outdated and a rebuild is + // needed. + // + // However, there are some tsconfig settings that don't seem to be cached in the tsbuildinfo. This makes any builds + // including these settings always fail this check. We special-case the properties in this set -- any differences in + // those fields are ignored. + // + // IMPORTANT: This is a somewhat unsafe action. Technically speaking, we don't know for sure the incremental build + // status when there is ANY difference between these settings. Thus the safest thing to do is to assume a rebuild is + // needed, Projects using these ignored settings may exhibit strange incremental build behavior. + // + // For that reason, this behavior can be disabled completely using the _FLUID_BUILD_DISABLE_IGNORE_TSC_OPTIONS_ + // environment variable. If that variable is set to any non-empty value, the list of ignored s=options will not be + // checked. + const tsConfigOptionsIgnored: Set = + (process.env._FLUID_BUILD_DISABLE_IGNORE_TSC_OPTIONS_ ?? "" !== "") + ? new Set() + : new Set(["allowJs", "checkJs"]); + + const diffResults = diffObjects(configOptions, tsBuildInfoOptions); + if (diffResults.length > 0) { + // Track whether the diff is "real"; that is, the diff is in properties that are not ignored. By default, + // assume that it is. + let diffIsReal = true; + + // We only need to check the different properties if the number of differences is <= the ignored options; + // any properties over that count will be a non-ignored difference. + if (diffResults.length <= tsConfigOptionsIgnored.size) { + // The diff is "real" if any different property is not ignored + diffIsReal = diffResults.some( + (diffResult) => !tsConfigOptionsIgnored.has(diffResult.path), + ); + } + + if (diffIsReal) { + this.traceTrigger(`ts option changed ${configFileFullPath}`); + this.traceTrigger("Config:"); + this.traceTrigger(JSON.stringify(configOptions, undefined, 2)); + this.traceTrigger("BuildInfo:"); + this.traceTrigger(JSON.stringify(tsBuildInfoOptions, undefined, 2)); + return false; + } } return true; } diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/taskUtils.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/taskUtils.ts index bb12876ed8e0..03d6b2c4d6e3 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/taskUtils.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/taskUtils.ts @@ -97,3 +97,56 @@ export async function loadModule(modulePath: string, moduleType?: string) { } return require(modulePath); } + +export type DiffResult = { + path: string; + type: "added" | "removed" | "changed"; + oldValue?: any; + newValue?: any; + value?: any; +}; + +/** + * Takes two objects and diffs them, returning a list of each property that differs between the two. + * + * @param obj1 - The first object to compare. + * @param obj2 - The second object to compare. + * @returns An array of {@link DiffResult}s with the changed properties, their old and new values, and the type of + * change. + */ +export function diffObjects(obj1: object, obj2: object): DiffResult[] { + const diffs: Map = new Map(); + + function findDiffs(o1: object, o2: object, path: string) { + for (const key of Object.keys(o1)) { + if (Object.prototype.hasOwnProperty.call(o1, key)) { + const newPath = path ? `${path}.${key}` : key; + if (!Object.prototype.hasOwnProperty.call(o2, key)) { + diffs.set(newPath, { path: newPath, type: "removed", value: o1[key] }); + } else if (typeof o1[key] === "object" && typeof o2[key] === "object") { + findDiffs(o1[key], o2[key], newPath); + } else if (o1[key] !== o2[key]) { + diffs.set(newPath, { + path: newPath, + type: "changed", + oldValue: o1[key], + newValue: o2[key], + }); + } + } + } + + for (const key in o2) { + if ( + Object.prototype.hasOwnProperty.call(o2, key) && + !Object.prototype.hasOwnProperty.call(o1, key) + ) { + const newPath = path ? `${path}.${key}` : key; + diffs.set(newPath, { path: newPath, type: "added", value: o2[key] }); + } + } + } + + findDiffs(obj1, obj2, ""); + return [...diffs.values()]; +} From b7f5b00baf5c47a531a15546e553a400071aa0d3 Mon Sep 17 00:00:00 2001 From: Tyler Butler Date: Sat, 23 Nov 2024 16:08:00 -0800 Subject: [PATCH 02/11] logging improvements --- .../src/fluidBuild/tasks/leaf/leafTask.ts | 6 +++++ .../src/fluidBuild/tasks/leaf/tscTask.ts | 23 ++++++++++++------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/leafTask.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/leafTask.ts index 380f16160b94..84cbde076c94 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/leafTask.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/leafTask.ts @@ -21,6 +21,7 @@ import { Task, TaskExec } from "../task"; const { log } = defaultLogger; const traceTaskTrigger = registerDebug("fluid-build:task:trigger"); +const traceTaskTriggerDebug = registerDebug("fluid-build:task:trigger:debug"); const traceTaskCheck = registerDebug("fluid-build:task:check"); const traceTaskInitDep = registerDebug("fluid-build:task:init:dep"); const traceTaskInitWeight = registerDebug("fluid-build:task:init:weight"); @@ -428,6 +429,11 @@ export abstract class LeafTask extends Task { traceTaskTrigger(msg); } + protected traceTriggerDebug(reason: string) { + const msg = `${this.nameColored}: [${reason}]`; + traceTaskTriggerDebug(msg); + } + protected traceError(msg: string) { traceError(`${this.nameColored}: ${msg}`); } diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts index b8cd5f09fb5c..183f80f7fda8 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts @@ -289,17 +289,24 @@ export class TscTask extends LeafTask { // any properties over that count will be a non-ignored difference. if (diffResults.length <= tsConfigOptionsIgnored.size) { // The diff is "real" if any different property is not ignored - diffIsReal = diffResults.some( - (diffResult) => !tsConfigOptionsIgnored.has(diffResult.path), - ); + diffIsReal = diffResults.some((diffResult) => { + const isIgnoredOption = tsConfigOptionsIgnored.has(diffResult.path); + if (isIgnoredOption) { + this.traceTrigger(`ignoring tsbuildinfo property: ${diffResult.path}`); + } + return !isIgnoredOption; + }); } if (diffIsReal) { - this.traceTrigger(`ts option changed ${configFileFullPath}`); - this.traceTrigger("Config:"); - this.traceTrigger(JSON.stringify(configOptions, undefined, 2)); - this.traceTrigger("BuildInfo:"); - this.traceTrigger(JSON.stringify(tsBuildInfoOptions, undefined, 2)); + this.traceTrigger(`ts options changed ${configFileFullPath}`); + this.traceTrigger("Diff:"); + this.traceTrigger(JSON.stringify(diffResults, undefined, 2)); + + this.traceTriggerDebug("Config:"); + this.traceTriggerDebug(JSON.stringify(configOptions, undefined, 2)); + this.traceTriggerDebug("BuildInfo:"); + this.traceTriggerDebug(JSON.stringify(tsBuildInfoOptions, undefined, 2)); return false; } } From a03835e5518a786f39795b1480c781e817db1eb5 Mon Sep 17 00:00:00 2001 From: Tyler Butler Date: Sat, 23 Nov 2024 16:26:27 -0800 Subject: [PATCH 03/11] typo --- .../packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts index 183f80f7fda8..ec766c064def 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts @@ -272,7 +272,7 @@ export class TscTask extends LeafTask { // needed, Projects using these ignored settings may exhibit strange incremental build behavior. // // For that reason, this behavior can be disabled completely using the _FLUID_BUILD_DISABLE_IGNORE_TSC_OPTIONS_ - // environment variable. If that variable is set to any non-empty value, the list of ignored s=options will not be + // environment variable. If that variable is set to any non-empty value, the list of ignored options will not be // checked. const tsConfigOptionsIgnored: Set = (process.env._FLUID_BUILD_DISABLE_IGNORE_TSC_OPTIONS_ ?? "" !== "") From d96d37ce26bf9c7ce668e563c4b51d2aadf0502b Mon Sep 17 00:00:00 2001 From: Tyler Butler Date: Wed, 18 Jun 2025 16:27:29 -0700 Subject: [PATCH 04/11] simpler approach --- .../src/fluidBuild/tasks/leaf/tscTask.ts | 41 ++++++------------- 1 file changed, 13 insertions(+), 28 deletions(-) diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts index ec766c064def..f85fd6c511df 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts @@ -279,36 +279,21 @@ export class TscTask extends LeafTask { ? new Set() : new Set(["allowJs", "checkJs"]); - const diffResults = diffObjects(configOptions, tsBuildInfoOptions); - if (diffResults.length > 0) { - // Track whether the diff is "real"; that is, the diff is in properties that are not ignored. By default, - // assume that it is. - let diffIsReal = true; - - // We only need to check the different properties if the number of differences is <= the ignored options; - // any properties over that count will be a non-ignored difference. - if (diffResults.length <= tsConfigOptionsIgnored.size) { - // The diff is "real" if any different property is not ignored - diffIsReal = diffResults.some((diffResult) => { - const isIgnoredOption = tsConfigOptionsIgnored.has(diffResult.path); - if (isIgnoredOption) { - this.traceTrigger(`ignoring tsbuildinfo property: ${diffResult.path}`); - } - return !isIgnoredOption; - }); + for (const ignoredOption of tsConfigOptionsIgnored) { + // Delete the ignored option if it exists on the object + if (ignoredOption in configOptions) { + this.traceTrigger(`ignoring tsBuildInfoOption: '${ignoredOption}1`); + delete configOptions[ignoredOption]; } + } - if (diffIsReal) { - this.traceTrigger(`ts options changed ${configFileFullPath}`); - this.traceTrigger("Diff:"); - this.traceTrigger(JSON.stringify(diffResults, undefined, 2)); - - this.traceTriggerDebug("Config:"); - this.traceTriggerDebug(JSON.stringify(configOptions, undefined, 2)); - this.traceTriggerDebug("BuildInfo:"); - this.traceTriggerDebug(JSON.stringify(tsBuildInfoOptions, undefined, 2)); - return false; - } + if (!isEqual(configOptions, tsBuildInfoOptions)) { + this.traceTrigger(`ts option changed ${configFileFullPath}`); + this.traceTrigger("Config:"); + this.traceTrigger(JSON.stringify(configOptions, undefined, 2)); + this.traceTrigger("BuildInfo:"); + this.traceTrigger(JSON.stringify(tsBuildInfoOptions, undefined, 2)); + return false; } return true; } From f376ff754458099a391a9d5b93c936dfdc6d67dd Mon Sep 17 00:00:00 2001 From: Tyler Butler Date: Wed, 18 Jun 2025 16:28:02 -0700 Subject: [PATCH 05/11] revert --- .../src/fluidBuild/tasks/taskUtils.ts | 53 ------------------- 1 file changed, 53 deletions(-) diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/taskUtils.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/taskUtils.ts index 03d6b2c4d6e3..bb12876ed8e0 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/taskUtils.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/taskUtils.ts @@ -97,56 +97,3 @@ export async function loadModule(modulePath: string, moduleType?: string) { } return require(modulePath); } - -export type DiffResult = { - path: string; - type: "added" | "removed" | "changed"; - oldValue?: any; - newValue?: any; - value?: any; -}; - -/** - * Takes two objects and diffs them, returning a list of each property that differs between the two. - * - * @param obj1 - The first object to compare. - * @param obj2 - The second object to compare. - * @returns An array of {@link DiffResult}s with the changed properties, their old and new values, and the type of - * change. - */ -export function diffObjects(obj1: object, obj2: object): DiffResult[] { - const diffs: Map = new Map(); - - function findDiffs(o1: object, o2: object, path: string) { - for (const key of Object.keys(o1)) { - if (Object.prototype.hasOwnProperty.call(o1, key)) { - const newPath = path ? `${path}.${key}` : key; - if (!Object.prototype.hasOwnProperty.call(o2, key)) { - diffs.set(newPath, { path: newPath, type: "removed", value: o1[key] }); - } else if (typeof o1[key] === "object" && typeof o2[key] === "object") { - findDiffs(o1[key], o2[key], newPath); - } else if (o1[key] !== o2[key]) { - diffs.set(newPath, { - path: newPath, - type: "changed", - oldValue: o1[key], - newValue: o2[key], - }); - } - } - } - - for (const key in o2) { - if ( - Object.prototype.hasOwnProperty.call(o2, key) && - !Object.prototype.hasOwnProperty.call(o1, key) - ) { - const newPath = path ? `${path}.${key}` : key; - diffs.set(newPath, { path: newPath, type: "added", value: o2[key] }); - } - } - } - - findDiffs(obj1, obj2, ""); - return [...diffs.values()]; -} From 12a64ce199e9ff41c446109a3ec5b2e7d2407ed8 Mon Sep 17 00:00:00 2001 From: Tyler Butler Date: Wed, 18 Jun 2025 16:30:32 -0700 Subject: [PATCH 06/11] formatting --- .../packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts index f85fd6c511df..77be8511cbd3 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts @@ -12,7 +12,7 @@ import isEqual from "lodash.isequal"; import * as tsTypes from "typescript"; import { TscUtil, getTscUtils } from "../../tscUtils"; -import { diffObjects, getInstalledPackageVersion } from "../taskUtils"; +import { getInstalledPackageVersion } from "../taskUtils"; import { LeafTask, LeafWithDoneFileTask } from "./leafTask"; interface ITsBuildInfo { From b8eab63a2f499d2fa346d61fc1d59753a5d01dd6 Mon Sep 17 00:00:00 2001 From: Tyler Butler Date: Thu, 19 Jun 2025 16:08:04 -0700 Subject: [PATCH 07/11] fix --- .../build-tools/src/fluidBuild/tasks/leaf/tscTask.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts index 77be8511cbd3..199e19289c0f 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts @@ -281,9 +281,9 @@ export class TscTask extends LeafTask { for (const ignoredOption of tsConfigOptionsIgnored) { // Delete the ignored option if it exists on the object - if (ignoredOption in configOptions) { - this.traceTrigger(`ignoring tsBuildInfoOption: '${ignoredOption}1`); - delete configOptions[ignoredOption]; + if (ignoredOption in tsBuildInfoOptions) { + this.traceTrigger(`ignoring tsBuildInfoOption: '${ignoredOption}'`); + delete tsBuildInfoOptions[ignoredOption]; } } From a9c36b213c16bd90e57353a9e6cd34cb7f524be6 Mon Sep 17 00:00:00 2001 From: Tyler Butler Date: Thu, 19 Jun 2025 16:12:30 -0700 Subject: [PATCH 08/11] add better diff in case where there's a mismatch --- build-tools/packages/build-tools/package.json | 1 + .../src/fluidBuild/tasks/leaf/tscTask.ts | 2 ++ build-tools/pnpm-lock.yaml | 18 +++++++++++++----- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/build-tools/packages/build-tools/package.json b/build-tools/packages/build-tools/package.json index ac7a0c7c1a83..4ccf08cfeb11 100644 --- a/build-tools/packages/build-tools/package.json +++ b/build-tools/packages/build-tools/package.json @@ -54,6 +54,7 @@ "json5": "^2.2.3", "lodash.isequal": "^4.5.0", "multimatch": "^5.0.0", + "microdiff": "^1.5.0", "picocolors": "^1.1.1", "picomatch": "^2.3.1", "picospinner": "^2.0.0", diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts index 199e19289c0f..41ed0b5625bd 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts @@ -9,6 +9,7 @@ import { readFile } from "node:fs/promises"; import path from "node:path"; import isEqual from "lodash.isequal"; +import diff from "microdiff"; import * as tsTypes from "typescript"; import { TscUtil, getTscUtils } from "../../tscUtils"; @@ -293,6 +294,7 @@ export class TscTask extends LeafTask { this.traceTrigger(JSON.stringify(configOptions, undefined, 2)); this.traceTrigger("BuildInfo:"); this.traceTrigger(JSON.stringify(tsBuildInfoOptions, undefined, 2)); + this.traceTrigger(JSON.stringify(diff(configOptions, tsBuildInfoOptions), undefined, 2)); return false; } return true; diff --git a/build-tools/pnpm-lock.yaml b/build-tools/pnpm-lock.yaml index 0ae52905d654..9a0b66f59867 100644 --- a/build-tools/pnpm-lock.yaml +++ b/build-tools/pnpm-lock.yaml @@ -558,6 +558,9 @@ importers: lodash.isequal: specifier: ^4.5.0 version: 4.5.0 + microdiff: + specifier: ^1.5.0 + version: 1.5.0 multimatch: specifier: ^5.0.0 version: 5.0.0 @@ -5119,6 +5122,9 @@ packages: merge@2.1.1: resolution: {integrity: sha512-jz+Cfrg9GWOZbQAnDQ4hlVnQky+341Yk5ru8bZSe6sIDTCIg8n9i/u7hSQGSVOF3C7lH6mGtqjkiT9G4wFLL0w==} + microdiff@1.5.0: + resolution: {integrity: sha512-Drq+/THMvDdzRYrK0oxJmOKiC24ayUV8ahrt8l3oRK51PWt6gdtrIGrlIH3pT/lFh1z93FbAcidtsHcWbnRz8Q==} + micromark-core-commonmark@2.0.1: resolution: {integrity: sha512-CUQyKr1e///ZODyD1U3xit6zXwy1a8q2a1S1HKtIlmgvurrEpaw/Y9y6KSIbF8P59cn/NjzHyO+Q2fAyYLQrAA==} @@ -7752,7 +7758,7 @@ snapshots: '@rushstack/eslint-patch': 1.4.0 '@rushstack/eslint-plugin': 0.13.1(eslint@8.57.0)(typescript@5.4.5) '@rushstack/eslint-plugin-security': 0.7.1(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/eslint-plugin': 6.7.5(@typescript-eslint/parser@6.7.5(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/eslint-plugin': 6.7.5(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5) '@typescript-eslint/parser': 6.7.5(eslint@8.57.0)(typescript@5.4.5) eslint-config-biome: 1.9.4 eslint-config-prettier: 9.0.0(eslint@8.57.0) @@ -8964,10 +8970,10 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/eslint-plugin@6.7.5(@typescript-eslint/parser@6.7.5(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5)': + '@typescript-eslint/eslint-plugin@6.7.5(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5)': dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.7.5(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/parser': 6.21.0(eslint@8.57.0)(typescript@5.4.5) '@typescript-eslint/scope-manager': 6.7.5 '@typescript-eslint/type-utils': 6.7.5(eslint@8.57.0)(typescript@5.4.5) '@typescript-eslint/utils': 6.7.5(eslint@8.57.0)(typescript@5.4.5) @@ -11021,7 +11027,7 @@ snapshots: eslint: 8.57.0 eslint-rule-composer: 0.3.0 optionalDependencies: - '@typescript-eslint/eslint-plugin': 6.7.5(@typescript-eslint/parser@6.7.5(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/eslint-plugin': 6.7.5(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5) eslint-rule-composer@0.3.0: {} @@ -11493,7 +11499,7 @@ snapshots: dependencies: foreground-child: 3.1.1 jackspeak: 2.3.6 - minimatch: 9.0.3 + minimatch: 9.0.5 minipass: 7.0.4 path-scurry: 1.10.2 @@ -12963,6 +12969,8 @@ snapshots: merge@2.1.1: {} + microdiff@1.5.0: {} + micromark-core-commonmark@2.0.1: dependencies: decode-named-character-reference: 1.0.2 From 644fe65628b2fbe6390d214b7ea836ad957eb951 Mon Sep 17 00:00:00 2001 From: Tyler Butler Date: Thu, 19 Jun 2025 16:33:53 -0700 Subject: [PATCH 09/11] missed some log removals --- .../build-tools/src/fluidBuild/tasks/leaf/tscTask.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts index 41ed0b5625bd..29dd9f3ee077 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts @@ -289,11 +289,8 @@ export class TscTask extends LeafTask { } if (!isEqual(configOptions, tsBuildInfoOptions)) { - this.traceTrigger(`ts option changed ${configFileFullPath}`); - this.traceTrigger("Config:"); - this.traceTrigger(JSON.stringify(configOptions, undefined, 2)); - this.traceTrigger("BuildInfo:"); - this.traceTrigger(JSON.stringify(tsBuildInfoOptions, undefined, 2)); + this.traceTrigger(`ts option changed in '${configFileFullPath}'`); + this.traceTrigger("Diff:"); this.traceTrigger(JSON.stringify(diff(configOptions, tsBuildInfoOptions), undefined, 2)); return false; } From 7231c97f9ba8cb403cf31d2536008c26b53e4c9f Mon Sep 17 00:00:00 2001 From: Tyler Butler Date: Fri, 20 Jun 2025 16:01:24 -0700 Subject: [PATCH 10/11] switch to opt-in --- .../build-tools/src/fluidBuild/tasks/leaf/tscTask.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts index 29dd9f3ee077..c659bb599bfb 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts @@ -272,13 +272,12 @@ export class TscTask extends LeafTask { // status when there is ANY difference between these settings. Thus the safest thing to do is to assume a rebuild is // needed, Projects using these ignored settings may exhibit strange incremental build behavior. // - // For that reason, this behavior can be disabled completely using the _FLUID_BUILD_DISABLE_IGNORE_TSC_OPTIONS_ - // environment variable. If that variable is set to any non-empty value, the list of ignored options will not be - // checked. + // For that reason, this behavior must be enabled using the _FLUID_BUILD_ENABLE_IGNORE_TSC_OPTIONS_ + // environment variable. To enable ignoring these settings, set the environment variable to "1". const tsConfigOptionsIgnored: Set = - (process.env._FLUID_BUILD_DISABLE_IGNORE_TSC_OPTIONS_ ?? "" !== "") - ? new Set() - : new Set(["allowJs", "checkJs"]); + (process.env._FLUID_BUILD_ENABLE_IGNORE_TSC_OPTIONS_ === "1") + ? new Set(["allowJs", "checkJs"]) + : new Set(); for (const ignoredOption of tsConfigOptionsIgnored) { // Delete the ignored option if it exists on the object From 79673d9a2ac181894643822c5a2e5359f32fd5d9 Mon Sep 17 00:00:00 2001 From: Tyler Butler Date: Fri, 20 Jun 2025 16:40:22 -0700 Subject: [PATCH 11/11] policy --- build-tools/packages/build-tools/package.json | 2 +- .../packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build-tools/packages/build-tools/package.json b/build-tools/packages/build-tools/package.json index 4ccf08cfeb11..35f962b87e23 100644 --- a/build-tools/packages/build-tools/package.json +++ b/build-tools/packages/build-tools/package.json @@ -53,8 +53,8 @@ "ignore": "^5.3.2", "json5": "^2.2.3", "lodash.isequal": "^4.5.0", - "multimatch": "^5.0.0", "microdiff": "^1.5.0", + "multimatch": "^5.0.0", "picocolors": "^1.1.1", "picomatch": "^2.3.1", "picospinner": "^2.0.0", diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts index c659bb599bfb..12058d98203c 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts @@ -275,7 +275,7 @@ export class TscTask extends LeafTask { // For that reason, this behavior must be enabled using the _FLUID_BUILD_ENABLE_IGNORE_TSC_OPTIONS_ // environment variable. To enable ignoring these settings, set the environment variable to "1". const tsConfigOptionsIgnored: Set = - (process.env._FLUID_BUILD_ENABLE_IGNORE_TSC_OPTIONS_ === "1") + process.env._FLUID_BUILD_ENABLE_IGNORE_TSC_OPTIONS_ === "1" ? new Set(["allowJs", "checkJs"]) : new Set();