Repository navigation
build: generate the flatbuffers JavaScript bundle on demand - #7756
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7756 +/- ##
=======================================
Coverage 91.97% 91.97%
=======================================
Files 535 535
Lines 42745 42745
=======================================
+ Hits 39315 39316 +1
+ Misses 3430 3429 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
DennisOSRM
approved these changes
Oct 27, 2026
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.
Closes #7708. Follows #7707
Changes
features/support/fbresult_generated.js; output now goes to the gitignoredfeatures/generated/fbresult.js.features/support/fbresult.js(new): runsscripts/regenerate_fbresult_js.sh, then imports the bundle via top-level await. All importers now use it:nearest.js, andtest/nodejs/constants.jsscripts/regenerate_fbresult_js.sh:flatcin$OSRM_BUILD_DIRfirst (CI usesbuild-osrm/), thenbuild*/, thenPATH, and prints an actionable message when none is found.npm run regenerate-fbresultnow passes--force..gitignoreandeslint.config.jsupdated for the new path.Design notes
BeforeAllhook, because the step files use static ESM imports, which resolve before any hook runs. Hence a support module with top-level await.features/support/on purpose.cucumber.mjsimports everything in that folder, so a stale bundle there could be loaded first, and ESM's module cache would then hand the stale copy to the loader too.--gen-alland running esbuild from the work directory (from build: add a script to regenerate the flatbuffers JavaScript bundle #7707) are unchanged, so the output stays deterministic.Trade-off (raised in the issue)
Running the cucumber features or node tests now requires
flatc, from a configured build,FLATC=/path/to/flatc, orPATH. CI already has it. Someone running the features against a prebuilt binary without a build tree will get the "no flatc found" message.Testing
npm run regenerate-fbresult && npx cucumber-js features/nearest features/testbot/duration_matrix.feature: 42 scenarios / 337 steps pass. This coversfb.table()and thewaypoints_groupedfield added in feat(nearest): support multiple coordinates for GET and POST #7704.npm run nodejs-tests: 612/612 pass (coverstest/nodejs/constants.js).npx eslint features/: clean apart from the existing indent error infeatures/lib/osrm_loader.js, which is also on master.AI disclosure: this change was developed with help from Claude (Anthropic, Claude Opus 5.5). I have reviewed and tested it and understand it fully.