neocotic / europa

Library for converting HTML into valid Markdown
MIT License
158 stars 24 forks source link

Rewrite source code to use ES2015 and transpile using Babel #78

Closed neocotic closed 6 years ago

neocotic commented 6 years ago

This PR involves replacing Nevis for OOP style with ES2015 classes as well as implementing more ES2015 features in the source code and using Bable to transpile it for browsers.

Europa Node requires no transpiling as it only supports versions of Node.js that provide ES2015 compatibility so this is really about Europa for the browser. That said; all packages have been tweaked to take advantage of ES2015 features, specifically ES2015 classes.

Since we're no longer using Nevis for our OOP API, this is technically a breaking change as the static extend methods will no longer be available.

I had planned on doing all of this for the Europa (v4) release but I decided not to because, at the time, Babel and Rollup/Browserify/Webpack would all result in extremely bloated distribution files, which was unacceptable. However, today I found that using this combination only caused a slightly increase of 4KB. I find this an acceptable trade-off for source code that is easier to maintain and hopefully it will tools improve and support for older browser versions are dropped.