knownasilya / ember-toggle

Checkbox based Toggle Switches for Ember
http://knownasilya.github.io/ember-toggle/
MIT License
112 stars 52 forks source link

Migrate away from old style shims #79

Closed webark closed 7 years ago

webark commented 7 years ago

I recently upgraded to the ember shims beta that uses the new module import syntax, and was getting deprication errors due to the use of things like import Component from 'ember-component';

I suggest that we switch to using the default global Ember import, and then we could possibly do the constant destructuring. What are you're thoughts @knownasilya @rwwagner90 ?

webark commented 7 years ago

wanted to get feed back before issuing a PR.

knownasilya commented 7 years ago

I'm for that. In general I use the defaults.

RobbieTheWagner commented 7 years ago

@webark I'd really prefer to keep using shims. We should switch them out for the new ones when they drop.

webark commented 7 years ago

hmm.. ok. This is just the only addon in my project that is using them and throwing the deprecation warning.

RobbieTheWagner commented 7 years ago

I just don't think we should migrate backwards away from shims, when the point of migrating to shims was to be ready for module unification.

webark commented 7 years ago

ya. the only issue with switching them to the new ones when they land, which is looks like it will be in beta for 2.15, is that, and just quoting the meeting notes,

i think the short answer is that addons don't use the shims. Someone should make an addon babel plugin to convert to the globals API. Addons can't guarantee the version of shims it will be used with.

which makes sense if I'm reading it right. https://github.com/emberjs/core-notes/blob/master/ember-cli/2017-06/june-15.md

webark commented 7 years ago

though longterm it looks like, at least ones the moudle api lands, then will want addon devs to be using the new shims/module syntax https://github.com/emberjs/rfcs/blob/master/text/0176-javascript-module-api.md#addons

RobbieTheWagner commented 7 years ago

@webark we definitely want to use the modules when they drop. I'm okay with temporarily moving back I suppose, but we'll need to move back to modules again soon.

knownasilya commented 7 years ago

https://github.com/netguru/eslint-plugin-ember/blob/master/docs/rules/no-old-shims.md looks like that rule can be used with eslint --fix. @webark have time to take a stab?

webark commented 7 years ago

ya, i can look into that today.