Repository navigation
Ship the importLibrary loader minified - #147
Merged
Merged
Conversation
wgsadmin
reviewed
Nov 5, 2026
wgsadmin
left a comment
Collaborator
There was a problem hiding this comment.
No findings.
I checked the loader semantics, conditional configuration variants, and the formatting-marker lifecycle across the generated outputs. The implementation preserves the existing bootstrap behavior and keeps the formatting exception scoped to the intended build path.
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.
What?
The
loaderShimbootstrap inlayout.njkis now one minified line followed by a readable config object. The config only listslibrariesandlanguagewhen the sample sets them. A<!-- prettier-ignore -->marker keeps prettier from expanding the line, and the format steps strip the marker from the published outputs (docs, highlight, jsfiddle, iframe).app/index.htmlkeeps it because the iframe build formats that file again.Why?
Prettier was expanding the loader into a long block at the top of every sample's HTML tab, which is also what the developer docs embed. Readers are meant to copy it as is, not read it. The developers.woosmap.com Get Started page will show the same minified line.
The behaviour doesn't change. The minified version and the previous one give the same script URL and the same results with key only, empty params, widgets plus language plus nonce, a second bootstrap, a load error, and two libraries requested at once.
How to test
npm run build, then open anydist/samples/<sample>/docs/index.html: the loader is a single line, withlibraries: "widgets"on the indoor widget samples. The only diff against the currentdist/is the loader block.npx playwright test e2epasses.