Skip to content

Ship the importLibrary loader minified - #147

Merged
gaelsimon merged 1 commit into
masterfrom
fix/minified-loader
Nov 6, 2026
Merged

gaelsimon merged 1 commit into
masterfrom
fix/minified-loader

Conversation

@gaelsimon

@gaelsimon gaelsimon commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

What?

The loaderShim bootstrap in layout.njk is now one minified line followed by a readable config object. The config only lists libraries and language when 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.html keeps 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 any dist/samples/<sample>/docs/index.html: the loader is a single line, with libraries: "widgets" on the indoor widget samples. The only diff against the current dist/ is the loader block. npx playwright test e2e passes.

@gaelsimon gaelsimon changed the title fix: ship the importLibrary loader minified, as Google does fix: ship the importLibrary loader minified Nov 5, 2026
@wgsadmin wgsadmin added the ai-reviewer-queued Nairi reviewer has a review in flight for this PR label Nov 5, 2026

@wgsadmin wgsadmin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@wgsadmin wgsadmin added ai-reviewer-done Nairi reviewer has finished with this PR \u2014 remove to ask again and removed ai-reviewer-queued Nairi reviewer has a review in flight for this PR labels Nov 5, 2026
@gaelsimon gaelsimon changed the title fix: ship the importLibrary loader minified Ship the importLibrary loader minified Nov 6, 2026
@gaelsimon gaelsimon self-assigned this Nov 6, 2026
@gaelsimon
gaelsimon merged commit 6eddb65 into master Nov 6, 2026
12 checks passed
@gaelsimon
gaelsimon deleted the fix/minified-loader branch November 6, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-reviewer-done Nairi reviewer has finished with this PR \u2014 remove to ask again

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants