Finish the CLI-parsing migration; make the search index build non-blocking - #211
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Finishes the CLI-parsing migration on the remaining eight tools, and fixes a main-thread stall the new site search's index build left behind.
book/render-book.mjs, all sixeval/tools, andwisdom/wisdom.mjsnow parse throughlib/cli.mjs, joining the 21 tools it already covered. Each tool keeps its own usage text, exit code and refusal wording (search_quality's "unrecognised argument",wisdom's "Unknown option: X",transcript's--help-without--h).check_cli.mjsgained recorded cases for all eight, bringing the suite to 218 checks (39 probes, 179 cases), plus a kit comparing 26 real invocations of the migrated and unmigrated copies byte for byte.lunr(config), about 1.6 s) ran synchronously on the main thread, so the search box took no keystrokes while "Loading search index..." showed.buildIndexInSlices()now runs the same build (entries, then field vectors, then the token set) 25 ms at a time, yielding to the browser between slices through aMessageChannelmessage. Measured in headless Chrome, the longest main-thread task dropped from 1.6-1.7 s to 52-54 ms. Both the online client andoffline.mjs's copy use it.test/search.test.mjschecks that the sliced index matcheslunr(config)'s, and that a mid-build throw still restoreslunr.idf.check_cli.mjscase that only matched Node's Windows-shaped ENOENT message; Linux names the file without a leading folder. Taught the gate roster (gate-roster.mjs,check_gate_lists.mjs,check_ci_workflows.mjs) to recognizenode --test test/<file>.mjslines, named by path.test/search.test.mjshad been running intest.batsince the previous PR but never in CI; the composite action now runs it too, andtest.batis twelve steps.build.bat,check.batandtest.batran clean at each commit (recorded inbuilder/PLAN-TOOLING-REVIEW.md).