atomicojs / atomico

Atomico a micro-library for creating webcomponents using only functions, hooks and virtual-dom.
https://atomicojs.dev
MIT License
1.16k stars 43 forks source link

ES5? #19

Closed lostfields closed 4 years ago

lostfields commented 4 years ago

Hi I'm pretty new to Rollup/Babel but I've tried to configure to pack a bundle to support IE >= 11 and Edge, but I'm having trouble with the "atomico" package since I can't get this transpiled from ES6 to ES5.

It complains about arrow functions since this isn't supported in IE11.

Sorry for the newb question, but am I missing something?

UpperCod commented 4 years ago

Hi, Atomico is distributed as the module es6 divided to optimize the load in modern browsers, but it can be grouped without problems forcing Babel to transform the module, eg:

babel({
    include : ["node_modules/atomico/**", "src/**"]
})

To improve your experience with old browsers I created this repo that exemplifies this process.

repo : https://github.com/atomicojs/old-browsers

example component , check with ie11: https://atomicojs.github.io/old-browsers/example/

example rollup.config.js : https://github.com/atomicojs/old-browsers/blob/master/example/rollup.config.js

I hope you find it useful.

lostfields commented 4 years ago

great, thank you so much. I really like this library - easy to convert from reactjs to atomico when you are using hooks :-)