Conversation
Import Leaflet, all plugins, Font Awesome, and custom CSS directly in src/map-engine/index.ts so webpack packs everything into the single build/spotmap-map.js + build/spotmap-map.css output. This eliminates the copy-deps.js script and the public/ vendor subdirectories entirely. window.L is explicitly assigned after import so future Leaflet plugins loaded as separate <script> tags still find the global, matching the behaviour of the old enqueue-based approach. Fixes a class of issues where WordPress caching/optimisation plugins reorder or concatenate the previously separate Leaflet script tags and break the dependency chain. https://claude.ai/code/session_01AAsqtsybGk9VPJ4FmggxBC
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…edCount instance path
techtimo
added a commit
that referenced
this pull request
Apr 15, 2026
…e in multi-feed popups (#46) * refactor: bundle all vendor deps into spotmap-map.js, drop copy-deps Import Leaflet, all plugins, Font Awesome, and custom CSS directly in src/map-engine/index.ts so webpack packs everything into the single build/spotmap-map.js + build/spotmap-map.css output. This eliminates the copy-deps.js script and the public/ vendor subdirectories entirely. window.L is explicitly assigned after import so future Leaflet plugins loaded as separate <script> tags still find the global, matching the behaviour of the old enqueue-based approach. Fixes a class of issues where WordPress caching/optimisation plugins reorder or concatenate the previously separate Leaflet script tags and break the dependency chain. https://claude.ai/code/session_01AAsqtsybGk9VPJ4FmggxBC * fix global var * complete change * test(map-engine): cover POST branch in buildView and MarkerManager feedCount instance 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.
Summary
Bundle vendor deps — Leaflet, all plugins, Font Awesome, and custom CSS are
now imported directly in
src/map-engine/index.tsand packed into the singlebuild/spotmap-map.js+build/spotmap-map.cssoutput. Eliminatesscripts/copy-deps.jsand the
public/vendor subdirectories. Fixes a class of issues where WordPresscaching/optimisation plugins reorder or concatenate the previously separate Leaflet
script tags and break the dependency chain.
Mustache popup templates — replaces string concatenation in
MarkerManager.getPopupHtml()with a single data-presence-driven Mustache template (
popup-templates.ts). AbuildView()function shapes the
SpotPointinto a flat view object; the template renders onlythe fields that are present, with no type-branching inside the template itself.
CSS classes for popup styles — inline
style=""attributes on popup elements arereplaced with
.spotmap-popup-image,.spotmap-popup-excerpt, and.spotmap-popup-dateclasses in a new
popup.css, making popup appearance overridable via CSS.Feed name in multi-feed popups — when a map has more than one feed configured,
the feed name is shown inline with the point type header (e.g.
OK — Tracker A).Single-feed maps are unaffected.