Closed (fixed)
Project:
Drupal core
Version:
8.6.x-dev
Component:
javascript
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
3 Jul 2018 at 15:19 UTC
Updated:
30 Jul 2018 at 06:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
ApacheEx commentedHere is a patch. I have also run
yarn run build:js.Comment #4
m1r1k commentedSeems like babel does not provide polyfill? Because Number.isNan is ES6 feature and in disaplace.js it is not changed
Comment #5
m1r1k commentedStyles were fixed, but what to do with Number.isNan polyfill?
How do you usually proceed guys? :)
1) manual polyfill
2) import 'core-js/es6/number';
3) etc
Comment #6
ApacheEx commentedthanks for your investigation. IE doesn't support
Number.isNaN, so yeah perhaps we need to polyfill it.I will take a look today later.
Comment #7
ApacheEx commentedI was trying to use https://babeljs.io/docs/en/babel-plugin-transform-runtime,
it will add polyfills automatically only when needed (based on browsers from babel-present-env).
But, that's something which depends on
requireorimport- we don't support it ¯\_(ツ)_/¯I see 2 ways:
1) ignore it by
eslint-disable-next-line2) add https://polyfill.io/ or properly configure https://babeljs.io/docs/en/babel-polyfill
currently, I'd prefer the first option. Any other thoughts?
Comment #8
m1r1k commentedas @drpal mentioned somewhere in other tasks, it is quite costy to add polyfills in such cases, because they will be added to all separate files and we can handle duplication while we transpile each file separately
Comment #9
GrandmaGlassesRopeManNice. I think this fine for now.
@m1r1k & @ApacheEx - You are correct. Right now we don't have a solid plan for how we can handle polyfill support. If you want to open a followup where we can discuss an approach that would be wonderful.
Comment #10
GrandmaGlassesRopeMan- I forgot this minor reroll due to changes to
core/.eslintrc.passing.json.Comment #11
ApacheEx commentedThanks for reroll.
Here is a followup #2985495: JS: Polyfills support
Comment #14
lauriiiCommitted 258a27b and pushed to 8.7.x. Cherry-picked d1b8295 and pushed to 8.6.x. Thanks! ✨