Mevrael / bunny

BunnyJS - Lightweight native (vanilla) JavaScript (JS) and ECMAScript 6 (ES6) browser library, package of small stand-alone components without dependencies: FormData, upload, image preview, HTML5 validation, Autocomplete, Dropdown, Calendar, Datepicker, Ajax, Datatable, Pagination, URL, Template engine, Element positioning, smooth scrolling, routing, inversion of control and more. Simple syntax and architecture. Next generation jQuery and front-end framework. Documentation and examples available.
https://bunnyjs.com
MIT License
486 stars 39 forks source link

Issue in IE 11 #32

Open flo720 opened 5 years ago

flo720 commented 5 years ago

Hi,

I have an issue with bunnyJS and Internet Explorer 11. When i test on IE 11, I have multiple issues about functions in constant. For exemple, we have an error "SCRIPT1002" in BunnyElement.js, line 4

export const BunnyElement = {

  getCurrentDocumentPosition(top = true) {
    //return Math.abs(document.body.getBoundingClientRect().y);
    return top ? window.scrollY : window.scrollY + window.innerHeight;
  },
[...]
}

We use webpack Encore, and we add babel polyfill. But it still not working.

Thank you very much

Apostata commented 5 years ago

Same Here, but with different type of error: SCRIPT1003: Expected ':' in line 12 of bunnyjs/src/file/file.js i'm using @babel/polyfill too and still the same.

Thanks in advance.

Apostata commented 5 years ago

I my case, I was able to solve using the dist file: bunny-js/dist/validation.min.js. Then, I made a copy of then minified file and where variables are defined as var, I change to window.{varName} and import has a module. import '../third-party/bunnyJs/validation.min';

Mevrael commented 5 years ago

I suppose apart from Babel Polyfill you also have to transpile ES6 syntax into ES5 for IE11. You might use Laravel Mix, assets-builder or Webpack for that.