Skip to content
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

Feature detect Symbol support. Use string as a fallback. #5840

Merged
merged 4 commits into from
Jan 27, 2020

Conversation

ms
Copy link
Contributor

@ms ms commented Jan 25, 2020

IE11 does not support Symbols natively and it is tricky to polyfill them
in a spec-compliant way.

Instead of using a Symbol to the React object, we can use an equivalent
string that is unlikely to conflict to store the ApolloContext object.

This is similar to the strategy used in React itself: https://github.com/facebook/react/blob/7dc9745427046d462506e9788878ba389e176b8a/packages/shared/ReactSymbols.js

Checklist:

  • If this PR is a new feature, please reference an issue where a consensus about the design was reached (not necessary for small changes)
  • Make sure all of the significant new logic is covered by tests

IE11 does not support Symbols natively and it is tricky to polyfill them
in a spec-compliant way.

Instead of using a Symbol to the React object, we can use an equivalent
string that is unlikely to conflict to store the ApolloContext object.
@ms ms changed the base branch from master to release-3.0 January 25, 2020 04:02
@hwillson hwillson added this to the Release 3.0 milestone Jan 27, 2020
@hwillson hwillson self-assigned this Jan 27, 2020
@hwillson hwillson changed the base branch from release-3.0 to master January 27, 2020 21:24
Copy link
Member

@hwillson hwillson left a comment

Choose a reason for hiding this comment

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

Thanks for working on this @ms!

@hwillson hwillson merged commit 9b38fc2 into apollographql:master Jan 27, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants