You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature #2860 [Map] Deprecate property rawOptions from ux:map:*:before-create events, in favor of bridgeOptions (Kocal)
This PR was merged into the 2.x branch.
Discussion
----------
[Map] Deprecate property `rawOptions` from `ux:map:*:before-create` events, in favor of `bridgeOptions`
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes <!-- please update src/**/CHANGELOG.md files -->
| Docs? | yes <!-- required for new features -->
| Issues | Fix #... <!-- 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.
- Update/add documentation as required (we can help!)
- 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).
-->
Following #2859, the `rawOptions` does not really reflect its purpose, I find `bridgeOptions` much better.
With the follwing code:
```js
this.element.addEventListener("ux:map:marker:before-create", (event) => {
event.detail.definition.rawOptions = { opacity: 0.5};
event.detail.definition.bridgeOptions = { title: 'Paris!!'};
});
```
Both options are used, but a deprecation warning is nicely trigged:
<img width="1369" alt="image" src="https://github.com/user-attachments/assets/89ff93df-fca8-4a44-b9b3-21e9c245c96c" />
Commits
-------
9158b93 [Map] Deprecate property `rawOptions` from `ux:map:*:before-create` events, in favor of `bridgeOptions`
Copy file name to clipboardExpand all lines: src/Map/assets/dist/abstract_map_controller.js
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -93,6 +93,9 @@ class default_1 extends Controller {
93
93
consteventAfter=`${type}:after-create`;
94
94
return({ definition })=>{
95
95
this.dispatchEvent(eventBefore,{ definition });
96
+
if(typeofdefinition.rawOptions!=='undefined'){
97
+
console.warn(`[Symfony UX Map] The event "${eventBefore}" added a deprecated "rawOptions" property to the definition, it will be removed in a next major version, replace it with "bridgeOptions" instead.`,definition);
`[Symfony UX Map] The event "${eventBefore}" added a deprecated "rawOptions" property to the definition, it will be removed in a next major version, replace it with "bridgeOptions" instead.`,
0 commit comments