jackocnr / intl-tel-input

A JavaScript plugin for entering and validating international telephone numbers
https://intl-tel-input.com
MIT License
7.54k stars 1.94k forks source link

ES5 Support on AngularJS App #1575

Closed iJerson closed 4 months ago

iJerson commented 4 months ago

Hi, On version - 18.1.4 onwards utils.js is build with ES6. Is there a way to get an ES5 build for utils.js file because our application currently doesn't support ES6. Or is there any other option you can suggest. Thanks you!

jackocnr commented 4 months ago

Can you tell me more about your use case - what exactly is it that doesn't support ES6? I thought there was pretty comprehensive support in 2024...

iJerson commented 4 months ago

this is an old application built with AngularJS and all of our third party libraries are included in the bundle. so when we build the application it failed because of the ES6 features(const, let, arrow functions, etc) in the library. Our application build successfully on v18.1.3 which is the current version of intl-tel-input we're using, but we need to upgrade to get the new update of libphonenumber.

jackocnr commented 4 months ago

when we build the application it failed because of the ES6 features(const, let, arrow functions, etc) in the library

What bundler/build tool are you using? Have you considered updating the config to allow ES6, which is the industry standard now? Or are you having to support some super old browser/version for some specific reason?

iJerson commented 4 months ago

We are using grails to build the application. No plans on upgrading to ES6 at the moment.

jackocnr commented 4 months ago

Looking online, they key seems to be to use babel to transpile the es6 to es5:

https://jurberg.github.io/blog/2015/02/28/es6-grails-plugin/

https://medium.com/@kevanahlquist/grails-and-modern-javascript-development-crossing-the-gap-e98aa65dd9be