polyfills

How do I use babel's `useBuiltIns: 'usage'` option on the vendors bundle?

给你一囗甜甜゛ 提交于 2019-12-03 00:49:21
Since I need to support also IE11, I need to transpile also node_modules . This is the babel config I use on the node_modules: presets: [ ['@babel/preset-env', { modules: false, useBuiltIns: 'usage' }], ], I use the useBuiltIns options because it was giving an error Symbol is not defined , the polyfill was needed. However this configuration breaks at compile time, supposedly because it injects some imports in the code, here is the error: Basically it's not liking the module.exports . So how do I use useBuiltIns in the vendors bundle? For now I solved by always requiring the babel polyfill in

Shim vs. Sham: What is the difference?

无人久伴 提交于 2019-12-02 17:51:17
What is the difference between a shim an a sham? Is it enough to include es5-shim.min.js and es6-shim.min.js or should I also include es5-sham.min.js and es6-sham.min.js? According to this Github page the shims include all monkey-patches that faithfully represent the ES5 features. In other words: you can use the features provided by these files as if you were using ES5 proper. The shams, however contain those features that can not be emulated with other code. They basically provide the API, so your code doesn't crash but they don't provide the actual functionality. Which ones do you need? That

WordPress - Enqueue scripts for only if LT IE 9

喜欢而已 提交于 2019-12-02 17:08:09
In a WordPress theme, how do you conditionally include scripts for ie8 and below? This is primarily to apply polyfills for various html5/css3 features. I see that wp has the $is_IE variable which can be used as a conditional to only include scripts for IE. Is there a way to add the script for only certain versions of IE though rather than all of them? This is simple with some HTML ie conditional comments, but I'd like to include the scripts all in the same place in my functions file. Conditional for specific versions in HTML: <!--[if lt IE 9]> <script src="iepolyfill.min.js"></script> <![endif

Whats the best JSON JavaScript polyfill

醉酒当歌 提交于 2019-12-02 15:40:59
问题 I am looking for a JSON polyfill (for JSON support in older browsers) that I can use in some JavaScript I'm writing. I've looked and found JSON2 and JSON3 are quite popular and I've read that JSON3 is meant to be a drop in replacement for JSON2 but I was wondering if these are the best polyfills out there? The only problem I have with JSON3 is that when I run the google closure lint checks over the JSON3 library it complains about for loops not defining a body: If this if/for/while really

Modernizr with Respond.js

余生长醉 提交于 2019-12-02 15:26:33
I am carefully assessing the best way to utilize Modernizr and Respond.js for responsive design and have a couple of questions for the community. Firstly, it is my understanding that when bundling Modernizr with Respond.js, no other coding or tests are required for media query support in IE8 and below. In other words, when Respond.js is bundled with Modernizr I merely have to load Modernizr in my source to get Respond.js active. Correct? Secondly, do you believe this is the most efficient way to achieve support for media queries in IE8 and below? In essence, I would be including a larger

HTML Import webcomponents polyfill not working in firefox

三世轮回 提交于 2019-12-02 12:37:42
I am trying webcomponents in a sample app. Since some of the specs are not included in some browsers, i tried using polyfill for those. In Mozilla firefox, i tried by enabling the key dom.webcomponents.enabled and adding some polyfills (that are not in browser). I have used HTML Import polyfill from webcomponents.js polyfill. Still HTMLImport is not working in firefox, internet explorer (even with polyfill). ( https://github.com/webcomponents/webcomponentsjs ) I also tried customElements v1 polyfill, not working in internet explorer and firefox. ( https://github.com/webcomponents/custom

TypeError: Unable to get property 'ngMetadataName' of undefined or null reference on IE 10

依然范特西╮ 提交于 2019-12-01 14:36:52
In IE 10, I got the following error: (but OK in IE 11) TypeError: Unable to get property 'ngMetadataName' of undefined or null reference The property ngMetadataName has been found in vendor.js . The polyfills.ts is as the following: /******************************************************************************* BROWSER POLYFILLS */ /** IE9, IE10 and IE11 requires all of the following polyfills. **/ import 'core-js/es6/symbol'; import 'core-js/es6/object'; import 'core-js/es6/function'; import 'core-js/es6/parse-int'; import 'core-js/es6/parse-float'; import 'core-js/es6/number'; import 'core

How to polyfill RadioNodeList?

戏子无情 提交于 2019-12-01 09:21:11
问题 Background As per the WHATWG someForm.elements should return a HTMLFormElementsCollection. A HTMLFormElementsCollection returns a RadioNodeList if multiple elements share the same name. The RadioNodeList has special value semantics where it returns the value of the first checked radio list in the nodelist. This would allow the following answer to work if it were implemented I naively attempted a polyfill that is based on host objects being well behaved (as per WebIDL), which they are clearly

FileReader.js nothing happens in IE9

时光怂恿深爱的人放手 提交于 2019-12-01 07:12:49
I need help setting up Jadriens FileReader.js . I have set up everything as I think this polyfill works. But the callback that fires when everything is initiated doesn't fire in IE9. This is my markup: <body> <div class="main"> <canvas id="mainCanvas" width="600" height="600"></canvas><br /> <div id="fileReaderSWFObject"></div> <input type="file" id="imageLoader" name="imageLoader" /><br /> <input id="text" type="text" placeholder="some text..."> </div> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script> <script>window.jQuery || document.write('<script src="js

Template tag polyfill for IE 11 - not working with table tr and td

ぐ巨炮叔叔 提交于 2019-12-01 06:32:28
I work with polyfill js that allows to process tags for browsers that does not support it. Source code of polyfill on jsfiddle Source question But I've noticed that in IE 11 this polyfill fails to work with templates that include <tr> and <td> tags My sample on jsfiddle The problem is that when we try to get childNodes from template tag node elPlate.childNodes it returns everything but <tr> and <td> children as if there were no such tags inside <template> . Am I missing something? Is there any workarounds for this issue? P.S I was not able to add a comment to source issue due to lack of