Skip to content

fix(icon-service): Use plain Map instance for message transfer#2128

Merged
damyanpetev merged 7 commits intomasterfrom
rkaraivanov/fix-2126
Mar 6, 2026
Merged

fix(icon-service): Use plain Map instance for message transfer#2128
damyanpetev merged 7 commits intomasterfrom
rkaraivanov/fix-2126

Conversation

@rkaraivanov
Copy link
Member

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

  • Bug fix (non-breaking change that fixes an issue)

Related Issues

Closes #2126

Checklist

  • My code follows the project's coding standards
  • I have tested my changes locally

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
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 convert DefaultMap instances into plain Map instances suitable for structured cloning.
  • Updated IconsStateBroadcast._syncState() to call toPlainMap() 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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@damyanpetev damyanpetev merged commit 90569fe into master Mar 6, 2026
6 checks passed
@damyanpetev damyanpetev deleted the rkaraivanov/fix-2126 branch March 6, 2026 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

igniteui-angular dev demos are not working in safari

4 participants