jerel / ember-cli-loading-slider

A YouTube like loading indicator for EmberJS packaged as an Ember CLI add-on.
MIT License
116 stars 36 forks source link

Update Readme and move mixing to addon/ #23

Closed mszoernyi closed 6 years ago

mszoernyi commented 8 years ago

We are using the loading slider in one of our addons. I wasn't able to import the mixing for shared routes in my addon and in general its's a good idea to encapsulate addon code in the addon folder.

Having the files on addon allows a consuming app to override and extending the component or service.

eg. in consuming app or addon

app/components/loading-slider.js

import LoadingSliderComponent from 'ember-cli-loading-slider/components/loading-slider';

export default LoadingSliderComponent.extend({
  ...
});

this would not work if files are in the app tree already. I've added a default.css for importing to make the start for new users easier. This way this addon can add new styles as well with default presentations and users can import the defaults and just manage own customisation.

eg.

@import 'ember-cli-loading-slider/default';

.loading-slider {
  z-index: 999999;
}

.loading-slider span {
  background-color: green;
}

What's new

Important

This is a breaking change due to the changed import paths. I thought about adding the mixing to the app/ tree as well but I would say everyone should change the path. It's easier to maintain anyway because it's always the same import even for nested components or pod-file structures.

Change all import LoadingSliderMixin from '../mixins/loading-slider'; to import LoadingSliderMixin from 'ember-cli-loading-slider/mixins/loading-slider';

willviles commented 7 years ago

@jerel @mszoernyi, any update with this PR? I've been using the remerge/ember-cli-loading-slider fork in my production app, but would be nice to get this merged in to master!

jerel commented 7 years ago

If the community prefers it as an addon I'm happy to merge it once it's brought up to date

jerel commented 6 years ago

Closing as master now has been upgraded for Ember 3.0