danielmoncada / date-time-picker-moment-adapter

Moment.js adapter for https://github.com/danielmoncada/date-time-picker
MIT License
5 stars 9 forks source link

Upgrade to angular 14, compilation mode Ivy #5

Closed POFerro closed 2 years ago

POFerro commented 2 years ago

This PR upgrades angular dependency to >= 8 to support angular 14 and also turns on Ivy compilation mode, corrects the warning given by angular cli compilation encouraging authors to turn on Ivy compilation.

Thanks and best regards :) POFerro

moberwasserlechner commented 2 years ago

@POFerro I did the such upgrade lately and ran into an issue, with Angular's backward compatibility.

The Angular version the lib is developed in, has to match the lowest supported Angular version. So if you want to support Angular >=8 the lib must be developed with Angular 8 not Angular 14.

See https://angular.io/guide/creating-libraries#ensuring-library-version-compatibility for details.

Here's the error I got, when I tried using a Angular 14 developed lib in a Angular 12 project.

https://github.com/michaelbazos/angular-feather/pull/64#issuecomment-1184508185

danielmoncada commented 2 years ago

@moberwasserlechner what do you mean by 'the lib must be developed with ng 8'? does that mean we nee to install ng 8 again just to build it?

also @POFerro thanks for the PR. I can update it, but you missed changing the minor version number when you updated the major.

moberwasserlechner commented 2 years ago

@danielmoncada

My issue was directly related to

The Angular version used to build an application should always be the same or greater than the Angular versions used to build any of its dependent libraries. For example, if you had a library using Angular version 13, the application that depends on that library should use Angular version 13 or later. Angular does not support using an earlier version for the application.

I published the lib using Angular 14 but was not able to use it in a Angular 12 application.

moberwasserlechner commented 2 years ago

But that was only intended as a note: I myself would be more than happy if this lib supports Angular 14 as my application is on Angular 14 as well ;)

POFerro commented 2 years ago

Hi @moberwasserlechner , Thanks for the note, I never noticed that. @danielmoncada is it OK? Angular 14 is fine with you?

Regarding the version number, what should it be then? 1.2.1?

Thanks and best regards POFerro

danielmoncada commented 2 years ago

@POFerro updated the version since this now targets 14, also updated the packager, as the old script worked with ng < 14.