fix(icon-service): Use plain Map instance for message transfer#2128
fix(icon-service): Use plain Map instance for message transfer#2128damyanpetev merged 7 commits intomasterfrom
Conversation
Since Safari does not support extended Map instances, we need to use a plain Map for message transfer. This change ensures compatibility across all browsers while maintaining the functionality of the icon service. Closes #2126
There was a problem hiding this comment.
Pull request overview
This PR addresses Safari’s inability to structured-clone custom Map subclasses when transferring icon registry state via BroadcastChannel, aiming to ensure icon-service cross-context sync works in Safari.
Changes:
- Added
DefaultMap.toPlainMap()to convertDefaultMapinstances into plainMapinstances suitable for structured cloning. - Updated
IconsStateBroadcast._syncState()to calltoPlainMap()before extracting and sending icon collections/references.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/components/icon/registry/default-map.ts |
Introduces toPlainMap() for structured-clone safe conversion + docs. |
src/components/icon/icon-state.broadcast.ts |
Attempts to send plain Map instances during SyncState broadcast. |
You can also share your feedback on Copilot code review. Take the survey.
…s before broadcasting
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
You can also share your feedback on Copilot code review. Take the survey.
Description
Since Safari does not support extended Map instances, we need to use a plain Map for message transfer.
This change ensures compatibility across all browsers while maintaining the functionality of the icon service.
Type of Change
Related Issues
Closes #2126
Checklist