Neutrino: Template literals do not work when targeting IE 11
See original GitHub issueIf I target the browser ie 11
in my babel-preset-env
config, then the translation which are based on template literals do not work. I think it’s because babel-preset-env
pulls in transform-es2015-template-literals
. It generates then code like this:
var _templateObject = _taggedTemplateLiteral(['This field is required'], ['This field is required']),
_templateObject2 = _taggedTemplateLiteral(['Valid email required'], ['Valid email required']);
var defaultMessages = exports.defaultMessages = function defaultMessages(i18n) {
return {
isRequired: i18n.t(_templateObject),
isEmail: i18n.t(_templateObject2)
};
};
Without the transform-es2015-template-literals
plugin, it creates code like:
const defaultMessages = i18n => ({
isRequired: i18n._('This field is required'),
isEmail: i18n._('Valid email required')
});
If I’m right then you transform also template literals t function calls, but now the transform-es2015-template-literals
comes first and your transformation cannot be processed.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Template literals syntax is not working in IE11 - Stack Overflow
If you look at the ECMAScript 6 compatibility table, you'll see that template literals are not supported by IE11. The "use strict" ...
Read more >Cross Browser Compatibility of ES6 Template Literals ...
ES6 Template Literals (Template Strings) is Not Supported on Internet Explorer 11. Checkout overall cross browser compatibility of ES6 ...
Read more >Neutrino EK Spotted Leveraging Patched IE Zero Day - Vulners
Attackers behind the Neutrino Exploit Kit didn't take long to co-op a recently patched Internet Explorer zero-day into its arsenal.
Read more >Targeting ultra-high energy neutrinos with the ARIANNA ...
We report on the detector capabilities to determine the neutrino direction by reconstructing the signal arrival direction of a 800m deep ...
Read more >Template literals (Template strings) - JavaScript | MDN
However, a tagged template literal may not result in a string; it can be used with a custom tag function to perform whatever...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This works for me. But You’re right. This should be easier.
Added section about integrations https://lingui.gitbooks.io/js/guides/integrations.html