[Map] Make UX Map compatible with Live Components (and some internal things)#2385
Merged
Kocal merged 5 commits intosymfony:2.xfrom Nov 22, 2024
Merged
[Map] Make UX Map compatible with Live Components (and some internal things)#2385Kocal merged 5 commits intosymfony:2.xfrom
Kocal merged 5 commits intosymfony:2.xfrom
Conversation
Contributor
📊 Packages dist files size differenceThanks for the PR! Here is the difference in size of the packages dist files between the base branch and the PR.
|
||||||||||||||||||||||||||||||
00fc2d4 to
bcbc42a
Compare
Member
Author
|
Note: Usages and examples can be a bit limited for the moment, but for a next PR I would like to add more methods like |
smnandre
reviewed
Nov 19, 2024
bcbc42a to
635bf7c
Compare
smnandre
reviewed
Nov 20, 2024
smnandre
reviewed
Nov 20, 2024
smnandre
reviewed
Nov 20, 2024
smnandre
reviewed
Nov 20, 2024
smnandre
reviewed
Nov 20, 2024
smnandre
reviewed
Nov 20, 2024
| /** | ||
| * @internal | ||
| */ | ||
| #[LiveProp(hydrateWith: 'hydrateMap', dehydrateWith: 'dehydrateMap')] |
Member
There was a problem hiding this comment.
Suggested change
| #[LiveProp(hydrateWith: 'hydrateMap', dehydrateWith: 'dehydrateMap')] | |
| #[LiveProp(hydrateWith: 'hydrateMap', dehydrateWith: 'dehydrateMap')] |
Should be private i think, and we maybe should create a dedicated hydration extension here.. wdyt ?
Member
Author
There was a problem hiding this comment.
I put it public otherwise the Live hydration process was not working due to visibility issue. Maybe I can try to add a setter?
Member
There was a problem hiding this comment.
Let's discuss all this tomorrow :)
smnandre
reviewed
Nov 20, 2024
smnandre
reviewed
Nov 20, 2024
smnandre
reviewed
Nov 20, 2024
smnandre
reviewed
Nov 20, 2024
smnandre
reviewed
Nov 20, 2024
smnandre
reviewed
Nov 20, 2024
smnandre
reviewed
Nov 20, 2024
smnandre
reviewed
Nov 20, 2024
smnandre
reviewed
Nov 20, 2024
074fa84 to
c90ac6d
Compare
smnandre
reviewed
Nov 21, 2024
smnandre
reviewed
Nov 21, 2024
smnandre
reviewed
Nov 21, 2024
c90ac6d to
558eb5c
Compare
smnandre
reviewed
Nov 22, 2024
Comment on lines
+21
to
+26
| /** | ||
| * @author Hugo Alliaume <hugo@alliau.me> | ||
| */ | ||
| trait ComponentWithMapTrait |
Member
There was a problem hiding this comment.
Suggested change
| /** | |
| * @author Hugo Alliaume <hugo@alliau.me> | |
| */ | |
| trait ComponentWithMapTrait | |
| /** | |
| * @author Hugo Alliaume <hugo@alliau.me> | |
| * | |
| * @experimental | |
| */ | |
| trait ComponentWithMapTrait |
smnandre
approved these changes
Nov 22, 2024
558eb5c to
6d4ead0
Compare
… methods internal
… of Map's value objects, add MapOptionsNormalizer
Co-authored-by: Simon André <smn.andre@gmail.com>
6d4ead0 to
74d937a
Compare
Kocal
added a commit
that referenced
this pull request
Dec 3, 2024
This PR was squashed before being merged into the 2.x branch. Discussion ---------- [Map] Fix default values of Stimulus Map Controller | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Issues | Fix #2417 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT <!-- Replace this notice by a description of your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - For new features, provide some code snippets to help understand usage. - Features and deprecations must be submitted against branch main. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> This issue happens at `doCreateMap` when we called `->fitBoundsToMarkers()` instead of `->center(...)`. The value `center` was supposed to be `null`, but since I forgot to configure the default value of `this.centerValue` to `null`, it automatically used `{}` as default value (https://stimulus.hotwired.dev/reference/values#getters) and it breaks the code. This bug has been introduced in #2385. Commits ------- 4cb91ef [Map] Fix default values of Stimulus Map Controller
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.
Here’s a corrected and polished version of your text:
Hi! 😊
This PR enhances the UX Map to be compatible with Live Components, allowing you to interact with the
Mapdirectly from your PHP code. You can perform actions and see your map update in real-time from the front-end!To achieve this, I had to refactor and improve several areas:
toArrayand newfromArraymethods forMap,Marker, and all other value objects could rebuild an equivalent object accurately (e.g.,$marker == Marker::fromArray($marker->toArray())).viewobject containingzoom,center,markers, etc. These properties were split into individual values to improve performance.@idis now automatically computed for eachMarkerandPolygondefinition. This optimization makes rendering significantly more efficient, avoiding the need to remove and re-render all markers or polygons (and avoiding a visual glitch aswell).Enregistrement.de.l.ecran.2024-11-17.a.10.30.54-2.mov
Enregistrement.de.l.ecran.2024-11-17.a.10.28.15-2.mov