Repository navigation
fix(tsrs-wasm): catch edited inputs when -b runs over in-memory files - #1217
Conversation
memoryFileSystem gave every file a modification time of 0 and ignored chtimes. On a second in-memory `tsc -b`, an edited input was then no newer than the .tsbuildinfo passed back with it, and the project was reported up to date without checking the edit. Files passed in have no history, so the host now dates every build info file passed in before every other file passed in. `--build` then checks each input against the build info by content, whatever order it stats files in. A build info file is a `.tsbuildinfo` file, or a file under a custom `tsBuildInfoFile` name that starts the way build info does. The `.tsbuildinfo` files are older still, so a JSON input that happens to start like build info is still checked against them. Writes take their times from the module's real-time clock, which the compiler compares them with, and chtimes records the time it is given. Fixes #1042
Performance change vs mainWorkflow run Β· main Clef gate: Clef estimated 23.2% default and single-threaded wall time, 17.4% peak RSS, 17.2% single-threaded instruction count impact probability. The main and PR tsrs-lintThe main and PR |
Merging this PR will not alter performanceWarning oxc-project has exceeded the Hobby plan limit of 5 active contributors. Upgrade your plan or apply to the open source program by December 8, 2026 to keep using CodSpeed. 1 warning
Comparing Footnotes
|
memoryFileSystemgave every file an mtime of 0 and ignoredchtimes. on a second in-memorytsc -bwith the first build's outputs passed back, an edited input was no newer than its build info, so-breported the project up to date without checking the edit.memoryFileSystemnow gives passed-in.tsbuildinfofiles the oldest time, files starting with{"version":"(customtsBuildInfoFile) the next oldest, and everything else a newer time.-bthen checks inputs by content in any stat order, and a JSON input with that prefix is still newer than.tsbuildinfo. writes follow the module's real-time clock and are strictly increasing, andchtimesrecords the time given. Fixes #1042 and supersedes #1043, which dated files at firststat()so it depended on stat ordertsconfig has no content check, so every project with passed-in build info builds again.
compositeandincrementalprojects re-emit only what changed and nothing when nothing changed, while others re-emit everything.--verboseand--dryreport those projects as out of date because oftsconfig.json. a custom-named build info that doesn't start with{"version":"(edited by hand, pretty-printed) still ties with the sources, as does a config or JSON input that starts with that prefix next to a custom-named build info, so those can still miss an edit tests build each case natively on disk and in memory and compare output, exit code and changed files. they cover the issue's edit with the default and a custom build info name, nothing edited, and an upstream edit with and without a.d.tschange. the first and last fail on main