Consolidate duplicated vendored JS into shared /js/#22
Merged
jonasniesner merged 1 commit intoJul 5, 2026
Conversation
jszip.min.js existed twice (byte-identical); the toolbox and the nrf_web_tools demo page now both load /js/jszip.min.js. The web-serial polyfill existed twice under different names, and only toolbox/serial.js had the unhandled-rejection / byte-reordering / port-close fixes (146f4c0). That fixed copy is now /js/web-serial-polyfill.js and the stale nrf_web_tools/web-serial-polyfill.js is gone, so the demo page gets the fixes too. nrf_web_tools.js existed twice, and the toolbox shipped the older revision without the multi-part DFU reconnect flow, so multi-image NRF52840 packages dead-ended there after part 1. The newer copy is now /js/nrf_web_tools.js and both pages load it. Both copies export the same NrfWebTools API and the zip path resolves against the page URL, so the move is drop-in. Script-injection src values and their querySelector guards updated in both pages to the new absolute paths. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TEs4tsAWupf2DXFM4faECC
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.
Follow-up to #21. Three vendored libraries existed in two copies each; this moves one canonical copy of each into
/js/and repoints both pages (firmware/toolbox/index.htmlandnrf_web_tools/index.html) at it. For both divergent pairs, the kept copy is the good one — so this is a bug fix for whichever page was serving the stale copy, not just cleanup:/js/jszip.min.js— the two copies were byte-identical; pure dedup./js/web-serial-polyfill.js— wastoolbox/serial.jsandnrf_web_tools/web-serial-polyfill.jsunder different names. Only the toolbox copy had the fixes from 146f4c0 (unhandled rejection inpull(), overlapping-transferInbyte reordering, USB device left open onclose()), so the demo page was still shipping those bugs. The fixed copy wins./js/nrf_web_tools.js— the toolbox shipped an older revision missing the multi-part DFU reconnect flow (WAITING_RECONNECT/flashRemainingFirmware/reconnectAndContinue), so flashing a softdevice+bootloader+appNRF52840.zipfrom the toolbox dead-ended at "Installation failed" after part 1. The newer copy wins; both revisions export the sameNrfWebTools(buttonElement, zipPath)API with identical constructor semantics, and the only network access isfetch(zipPath), which resolves against the page URL rather than the script URL — verified drop-in.Script-injection
srcvalues and theirquerySelector('script[src=…]')duplicate-load guards were updated together in both pages. Verified: no remaining references to the old paths anywhere inhttpdocs/(grep), andnode --checkpasses on all three relocated files.🤖 Generated with Claude Code
https://claude.ai/code/session_01TEs4tsAWupf2DXFM4faECC