-
-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Map] Fix Google/Leaflet bridges when using Webpack Encore #2199
Conversation
450b96d
to
5abfff3
Compare
5abfff3
to
b3283f4
Compare
@@ -1,8 +1,48 @@ | |||
import AbstractMapController from '@symfony/ux-map/abstract-map-controller'; | |||
import { Controller } from '@hotwired/stimulus'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surely because Rollup has been able to resolve the file when using import AbstractMapController from '@symfony/ux-map'
, the AbstractMapController
is now inlined.
I'm fine with this, especially it removes one useless HTTP request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
This PR fixes #2105, and ensures Leaflet and GoogleMaps bridges are working fine with Webpack Encore.
To be sure:
--webapp
),.addAliases({ 'leaflet/dist/leaflet.min.css': 'leaflet/dist/leaflet.css' })
and.enableStimulusBridge('./assets/controllers.json')
inwebpack.config.js
new Map()
) and rendered it (ux_map(map, { style: 'height: ...' })
)I am able to display a Leaflet map:
And a GoogleMap maps:
The Map rendered on ux.symfony.com is also working (after updating the
importmap.php
as documented):