ngx-filepond icon indicating copy to clipboard operation
ngx-filepond copied to clipboard

[Feature] Prepare for ivy distribution

Open jonyeezs opened this issue 3 years ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Is your feature request related to a problem? Please describe.

Angular 14 now encourages to publish libraries as ivy distribution. This speeds up the build time for packages.

Describe the solution you'd like

Here's some guides that could help:

  • https://blog.angular.io/upcoming-improvements-to-angular-library-distribution-76c02f782aa4
  • https://angular.io/guide/creating-libraries#getting-started
  • https://github.com/angular/ngcc-validation

Describe alternatives you've considered

No alternatives

jonyeezs avatar Aug 31 '22 05:08 jonyeezs

Thanks! I'm going to look into it.

rikschennink avatar Aug 31 '22 11:08 rikschennink

With Angular 16 Angular Compatibility Compiler (ngcc) will be removed and as a result ngx-filepond will no longer work.

VeitWeber avatar Feb 23 '23 16:02 VeitWeber

I've just published 6.0.2 which should solve the issue, let me know if I need to make any further modifications.

rikschennink avatar Feb 27 '23 11:02 rikschennink

Hi Rik! Thanks for your effort, will give it a try soon.

VeitWeber avatar Feb 27 '23 11:02 VeitWeber

Hej Rik! 6.0.3 still generates this warning:

⠙ Generating browser application bundles (phase: setup)...Processing legacy "View Engine" libraries:

  • ngx-filepond [es2015/esm2015] (https://github.com/pqina/ngx-filepond.git) Encourage the library authors to publish an Ivy distribution.

So ngx-filepond won't work with Angular 16.

I forked the repository and build a working example for Ivy / Angular 16.0 here. Hope this helps.

VeitWeber avatar Mar 01 '23 08:03 VeitWeber

@VeitWeber Thanks, is this done with Angular CLI? → https://angular.io/guide/creating-libraries#getting-started

rikschennink avatar Mar 01 '23 09:03 rikschennink

@VeitWeber Thanks, is this done with Angular CLI? → https://angular.io/guide/creating-libraries#getting-started

Yes!

VeitWeber avatar Mar 01 '23 09:03 VeitWeber

Thanks 🙏 I'll create a new version following your example 👍

rikschennink avatar Mar 01 '23 09:03 rikschennink

@VeitWeber Tried to get it to work but while the ngx-filepond library is building correctly it's not working in an actual app. Not sure why :/

rikschennink avatar Mar 07 '23 12:03 rikschennink

@rikschennink I would like to take a look at it, is there a branch for testing?

VeitWeber avatar Mar 07 '23 12:03 VeitWeber

@VeitWeber https://github.com/pqina/ngx-filepond/tree/feature/ivy-distribution

Tried to create a new demo project with Angular CLI but while it doesn't show any errors it doesn't load FilePond.

rikschennink avatar Mar 07 '23 12:03 rikschennink

The demo app will work if you add preserveSymlinks=true to it's tsconfig.json. AFAIK this is needed if the library is installed locally into the package.json and should not be required if you distribute it with npmjs.com. But maybe it depends on the Filepond main lib and is required for apps that use the Ivy build of ngx-filepond and it needs do be documented in the readme.md.

VeitWeber avatar Mar 07 '23 13:03 VeitWeber

@VeitWeber Aha! I only read that it should be added to angular.json, now it works. 🎉

rikschennink avatar Mar 07 '23 14:03 rikschennink

@VeitWeber Last question before I merge and publish. I'm wondering which versions of Angular work with this new build? Is it just 15.x or earlier as well? I apologise for asking but I'm just super out of the Angular loop.

rikschennink avatar Mar 07 '23 14:03 rikschennink

It think it will run on Angular >= 14.0.0

If you need some help to maintain the lib I would love to help :).

VeitWeber avatar Mar 07 '23 15:03 VeitWeber

@VeitWeber appreciate it, always welcome.

I've just published new release set version to 7

rikschennink avatar Mar 08 '23 14:03 rikschennink

Works great.

VeitWeber avatar Mar 09 '23 19:03 VeitWeber

So glad to hear that, I'll close this issue then. :)

rikschennink avatar Mar 10 '23 07:03 rikschennink

I've just published new release set version to 7

Thank you @rikschennink and @VeitWeber! 🙂

dtslvr avatar Mar 10 '23 09:03 dtslvr