Git Product home page Git Product logo

Comments (2)

joanllenas avatar joanllenas commented on May 23, 2024

Ok, that makes sense.
I will fix the readme and also the demo app to reflect this.

Thanks!

from ngx-date-fns.

joanllenas avatar joanllenas commented on May 23, 2024

@MickL I tested the bundle size with webpack-bundle-analyzer as you suggested but I think it's not working properly.
The command used to test tree shaking in this project is npm run analyze:app which uses source-map-explorer, and if you double-check with the actual main.js size, it makes sense.

date-fns v2.19.0

Screenshot 2021-03-14 at 13 17 12
Screenshot 2021-03-14 at 14 01 34

date-fns v2.16.1

Screenshot 2021-03-14 at 14 10 19
Screenshot 2021-03-14 at 13 56 39

Issues with webpack-bundle-analyzer

I don't know the exact details about why the tool is not working properly, but I found a couple of places where they recommend aginst using it for Angular:

(source)

While the Angular CLI uses Webpack for some of its bundling, it also makes additional optimizations on top of Webpack. Because of these optimizations, it's important to use the source-map-explorer to test the final output and not the webpack-bundle-analyzer that is commonly used with Webpack based applications.

(source)

The angular team strongly recommends to only use source-map-explorer to analyze your bundle size instead of webpack-bundle-analyzer. According to them, webpack-bundle-analyzer and a few other similar tools doesn't give the actual info pertaining to angular build process.

Thanks for taking the time to explore this issue and for the v2.16.1 issue finding. I will add a note to the readme.
Cheers!

from ngx-date-fns.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.