arkon / ng-inline-svg

[Inactive] Angular directive for inserting an SVG file inline within an element.
https://echeung.me/ng-inline-svg/
MIT License
210 stars 88 forks source link

fix(NgInlineSvg): compatibility with Angular 4.3 #39

Closed BendingBender closed 7 years ago

BendingBender commented 7 years ago

BREAKING CHANGE: the module is now only compatible with Angular 4.3+ because it uses HttpClient instead of Http

Changes code so that it uses Angular's new HttpClient module instead of the soon to be deprecated Http module. Allows alls users of Angular 4.3+ to move to the new http module without having to package both, the old and the new modules, in production builds.

arkon commented 7 years ago

I was aware of the new module, but I wasn't aware that the old was deprecated. Did they officially say that?

While I would look to move to newer stuff at some point, it annoys me that it's so hard to support older versions of Angular at the same time.

BendingBender commented 7 years ago

Sorry, I've misunderstood this part. No, they didn't say that. But the interceptor support and the on-by-default XSRF protection are features that one doesn't want to miss.

Ngx-translate also made the transition and having to package both Http modules is not very practical.

I know that support for old versions is very important and this is IMHO the biggest issue with angular's development cycle since they went 2-beta. To be honest, I start to really dislike angular for this attitude.

arkon commented 7 years ago

I think I'll hold off for now until Angular 2 is a bit less common. I'll keep this PR around though, for whenever that is. :P

BendingBender commented 7 years ago

You could leave a big fat notice in the readme that clarifies that users of Angular <4.3 have to install the previous major version, like many other projects did. Or you could release this version under the @next dist-tag. This way users of both versions of the framework could use your lib without problems with the users of Angular >=4.3 being able to explicitly opt-in.

I just don't think that for most projects it's acceptable to have both Http libs in their bundle.

margaris23 commented 7 years ago

This PR is a must for those who need to move on with Angular 4.3.x which is stable enough and also provides new http related features. Please merge it.

arkon commented 7 years ago

Published as v4.0.0.