tylerhubert / rsql-criteria-typescript

RSQL Criteria Builder for Typescript
MIT License
14 stars 5 forks source link

commonjs-dependencies #16

Closed Jamforce closed 3 years ago

Jamforce commented 3 years ago

Hi,

When using togheter with Angular 10, I get this WARNING in console

WARNING in ...\node_modules\rsql-criteria-typescript\dist\lib\index.js depends on 'util'. CommonJS or AMD dependencies can cause optimization bailouts.

From https://angular.io/guide/build#configuring-commonjs-dependencies: It is recommended that you avoid depending on CommonJS modules in your Angular applications. Depending on CommonJS modules can prevent bundlers and minifiers from optimizing your application, which results in larger bundle sizes. Instead, it is recommended that you use ECMAScript modules in your entire application. For more information, see How CommonJS is making your bundles larger.

tylerhubert commented 3 years ago

Hello!

Thank you for the report. Can you please let me know which version of the library you are on?

A few weeks ago we committed some updates that would hopefully modernize and get rid of these warnings. I've gotten busy with work and haven't been able to fully verify if all of the warnings have disappeared on the latest 2.3.0 version though.

If you are on the latest version and still seeing this error, then I can continue looking into seeing if there is an updated version of util or if I need to use something else. Currently using it to know if an input is a number or not iirc.

Thank you!

Jamforce commented 3 years ago

Thank you for the quick response, Im on the latest version

I generally use https://ramdajs.com/docs/#is

tylerhubert commented 3 years ago

@Jamforce, sorry for the long delay in fixing this, but code was just merged to fix this.

Version 2.3.1 has been published to NPM: https://www.npmjs.com/package/rsql-criteria-typescript

tylerhubert commented 3 years ago

Closing this issue as the reliance on node's util package has been removed from the codebase.