-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: Replace uptown with ES2015 classes #209
Conversation
Please feel free to ignore me as I'm just adding a thought here :) This is super cool. I think if you wanted to keep support for IE11 and non-Babel builds, Just a thought! |
@realityking If you run the code through the babel7, than you can get ES5 code that runs on every environment. And what get's distributed via npm will the babelified ES5 instead of original source code. |
@char0n Definitely an option. I saw that babel was removed from several Apiary packages so I wasn't sure if that was something that's wanted. Should I make that change? And what browsers should be supported? |
I removed Babel from Dredd and Dredd Transactions, as they run solely on Node.js at this moment. There have been thoughts about making them browser-compatible, but that's long-term idea with a lot of prerequisites. Until that happens, Babel would be only an obstacle to the development. |
Alright. I'll make a PR to add babel to minim. Any comment on desired browser support? |
|
This allows using modern Js features while maintaining compatability with older browsers.
Added babel to the PR 🙂 The browserified build more than 30KB smaller than before. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few comments.
Breaking change: Inheriting from a minim type now requires using native JS (class extends or prototypes) instead of uptown methods.
#209 removed some documentation coverage which causes other classes that reference the documentation in other libraries to fail.
#209 removed some documentation coverage which causes other classes that reference the documentation in other libraries to fail.
#209 removed some documentation coverage which causes other classes that reference the documentation in other libraries to fail.
Breaking change: Inheriting from a minim type now requires using native JS (class extends or prototypes) instead of uptown methods.
I'd like to propose removing the uptown dependency from minim and using ES2015 classes instead. This is a breaking change due to different semantics of ES2015 and uptown but it reduced code size & complexity and makes it easier for IDEs to understand the code (for autocomplete)
Perhaps the biggest downside is that users who want to use minim on the frontend will have to use Babel if they care about IE11 comparability. IMHO that's a fair trade off but others might feel otherwise.