tryggvigy / pseudo-localization

Dynamic pseudo-localization in the browser and nodejs
https://tryggvigy.github.io/pseudo-localization/hamlet.html
MIT License
140 stars 15 forks source link

Pseudo-localization on angular throws error in vendor.js in IE #8

Closed gowthambalashanmugam closed 5 years ago

gowthambalashanmugam commented 5 years ago

Since pseudo-localization npm developed in es6, it throws error in IE because vendor.js directly appended all the npm modules.

IE 11 doesn't support arrow functions as of now

tryggvigy commented 5 years ago

Hey @gowthambalashanmugam! Thanks for the issue. Can you explain to me how you are using pseudo-localization a bit? I'd love to know. I'm assuming that the library should only be included during development which usually happens on very recent browsers. Of course it makes sense to look at a website in development mode in IE11 sometimes, like when debugging a IE11 bug. Is that the use-case you have for having pseudo-localization work in IE11? I think we should support IE11 but I want to understand how it's being used a bit! I'll take a closer look asap.

gowthambalashanmugam commented 5 years ago

Hello @tryggvigy. Am using pseudo-localization in angular 6 project. imported module by " import { localize } from 'pseudo-localization' "

So when deploying build, the vendor.js will be created by merging all node module files as it is. So if the module developed on es6, instead of transpile to es5, the vendor file just clubbing npm, so on load in IE it throws error and angular is not bootstrapping. Please let me know for more inputs.

tryggvigy commented 5 years ago

I'm missing some context but wouldn't you want to exclude pseudo-localization dependency when deploying to production?

Are you using webpack? Can you conditionally include it in your bundle depending on the NODE_ENV environment variable? Thats quite a common way to for example exclude debug logging from the production bundle.

gowthambalashanmugam commented 5 years ago

Hello @tryggvigy. am using angular-cli (ng 6). not pure web-pack. am suggesting you to implement pseudo-localization in any angular project and check in IE11.

By the wat i want to exclude pseudo-localization in prod

tryggvigy commented 5 years ago

@gowthambalashanmugam This issue was fixed in https://github.com/tryggvigy/pseudo-localization/pull/16! Try to install the latest version and see if you issue is fixed. I'm closing the issue now assuming that it's fixed since we now transpile arrow functions and more