Comments (10)
If it's truly not possible for Google Maps to fix their code before the end of October (please do pursue this regardless), then I think it's reasonable to add your solution to es6-shim - but I would strongly prefer not having to make the shim code less correct solely due to Google forcing the issue with broken code.
from es6-shim.
Yeah!! I will close it now, thank you so much for the supporting!
from es6-shim.
Google Maps fixed their code and our site was upgraded to latest google maps, thanks!!
from es6-shim.
Symbols can not be shimmed - only shammed. As such, I'd suggest not trying to include them.
If you do, you'd have to include a symbol sham after es6-shim (that may not actually work either, now that I think about it).
from es6-shim.
Hi @ljharb , I see you reopened this issue, so we will need more discussion here?
actually the solution I pasted is from core-js:
https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.symbol.js#L88
So would it make sense to have such check? Thank you so much for the help!
from es6-shim.
I closed it by accident, is all.
No - it would be incorrect and inappropriate to use anything but typeof to check for symbols, imo. Additionally, instanceof doesnโt work across realms.
from es6-shim.
thanks Jordan for the explanation! I agree with your point here
Right now I am facing an issue that seems either need to be fixed in google maps API or es6-shim side, could you provide me some suggestions for the fix? @ljharb @lencioni
Context:
- We need to upgrade to google map js API 3.37 or 3.38 by end of Oct. 2019, (it will auto update if we don't do anything), IE11 will break if we don't fix the issue
- These Google maps js API adds Symbol.iterator shim in IE11,
Issue:
- Google maps JS API detects if array supports iterator, using
Symbol.iterator
, in below code,a
is an array object.
- Because es6-shim doesn't recognize
Symbol.iterator
, so error will happen and google maps warns about itexport:This site overrides Array.from() with an implementation that doesn't support iterables, which could cause Google Maps JavaScript API v3 to not work correctly
To reproduce
follow the link for original error page and fixed page, open in IE11
https://es6-shim-google-maps.glitch.me/
Solution 1
- Add
symbol-es6
or similar shims beforees6-shim
- Fix
es6-shim
as suggested above
Actually other people had the similar issue and solved it similar way
(because core-js
already has Symbol polyfill and the suggested fix, so it's quite simple for them)
zloirock/core-js#567 (comment)
Solution 2
Ask google to fix their code
I think it will be hard, first the process of fixing in google maps is slow.
Second I think it is not an easy fix on google maps: They polyfilled Symbol and used it widely. It seems reasonable to check array's iterator by a[Symbol.iterator]
... I am not sure how to suggest them for a reasonable fix
We need to solve this issue by end of October to avoid IE11 break, do you have suggestion for any other options? THANKS A LOT!!
from es6-shim.
To be honest, I think asking Google is appropriate. es6-shim and core-js are the most common shims in use; if Google Maps won't work with es6-shim, it's going to break a lot of websites.
from es6-shim.
Thanks Jordan, discussed with @lencioni, I will ask Google if they can fix it or provide suggestions.
To clarify, core-js
is not breaking with Google Maps because:
- They have Symbol polyfill
- They have the logic to check
polyfilled Symbol
These 2 points are the Solution 1
I proposed above for using es6-shim
, so it's a really simple fix in zloirock/core-js#567: just load the polyfill before Google Maps
from es6-shim.
@wintlu hooray, glad to hear it! Does that mean #460 is no longer needed?
from es6-shim.
Related Issues (20)
- Support for Promise.prototype.finally HOT 2
- Symbol.split polyfill poor performance HOT 1
- Question: Template literals supported? HOT 4
- Possible to only use needed components? HOT 1
- Function.prototype.name getter brokes function name getter HOT 2
- native Promise broken in node 10.0 and 10.1 HOT 1
- Unneeded argument for overrideNative HOT 2
- Promise 'then' incorrect? HOT 10
- For statement doesn't loop? HOT 4
- TypeError: Object doesn't support property or method 'next' in IE browser HOT 10
- Does the array `of` shim apply to `for...of`? HOT 3
- WhiteSource warning - jQuery Vulnerability CVE-2020-11022 HOT 3
- babel-polyfill and es6-shim HOT 8
- Allowed iterator on empty object HOT 2
- Promise shim missing finally method HOT 1
- This software has new code recently, but no new version has been released. Will there be a new version released recently? HOT 4
- [spam]
- About update a new release HOT 3
- Documentation Icon Errors and typos HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from es6-shim.