Skip to content

[polyfill] Add warning for bad Map/Set polyfills #33575

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

leeguooooo
Copy link

Summary

Add detection and warning for incorrect Map/Set polyfill implementations that don't properly support non-string keys.

Details

  • Add BadMapPolyfill module to detect problematic implementations
  • Include comprehensive tests for the detection logic
  • Warn users when their polyfills may cause React to malfunction

This helps developers identify issues with polyfills that break React's internal mechanisms.

Test Plan

  • Added unit tests in BadMapPolyfill-test.js
  • Tests cover detection of bad Map/Set implementations
  • Verifies warning messages are shown appropriately

Add detection and warning for incorrect Map/Set polyfill implementations
that don't properly support non-string keys. This helps developers identify
issues with polyfills that break React's internal mechanisms.

- Add BadMapPolyfill module to detect problematic implementations
- Include comprehensive tests for the detection logic
- Warn users when their polyfills may cause React to malfunction

Fixes issues where bad polyfills silently break React functionality.
@leeguooooo leeguooooo changed the title feat: Add warning for bad Map/Set polyfills [polyfill] Add warning for bad Map/Set polyfills Jun 19, 2025
Copy link

@hardanishsingh1 hardanishsingh1 left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

3 participants