Giter VIP home page Giter VIP logo

Comments (5)

jamesrweb avatar jamesrweb commented on April 27, 2024 2

@yevdyko any updates here?

from react.

yevdyko avatar yevdyko commented on April 27, 2024 1

@jamesrweb sure thing, I will check the bundle sizes to see if it can apply to us, and thanks for pointing that out @JeffML

from react.

jamesrweb avatar jamesrweb commented on April 27, 2024 1

I looked into this issue and the outcome is:

  1. p5 does use the minified version by default in the current version at least (didn't check others)
  2. The minified version is 1,029.38 kB by default and 260.21 kB when gzipped
  3. We could reduce upfront load by using React.lazy and more aggressive code-splitting in the vite build but in my testing this only saved less than 0.5% of the current bundle size and that took quite a bit of configuring to do. Not sure if it is worth the future administration for such little gain. I will consider it.

So to answer the original questions from @JeffML:

  1. Yes, by default from p5 themselves, in the upstream dependency.
  2. Not unless you import it yourself and there is also a p5/lib/addons/p5.sound.min file available for import also FYI.
  3. No since we rely on the upstream p5 dependency and since they use p5/lib/p5.min by default as the main entrypoint, we are already using the minified version. We don't use sound or other plugins and so optimization routes for us are either further code-splitting of the internal components (but these are already extremely small) or applying fixes upstream which depends on the p5 maintainers.

Anyway, closing this issue for now. Thanks for raising the issue, it was interesting to look into 😄.

from react.

jamesrweb avatar jamesrweb commented on April 27, 2024

@yevdyko can you take a look into this, maybe the imported values should be updated.

Thanks @JeffML for the topic. If it's something we can change or brings benefits, we will! Appreciate it.

from react.

yevdyko avatar yevdyko commented on April 27, 2024

@jamesrweb Moreover, after releasing a new version of the package in #325, where p5 moved to a peer dependency, this becomes irrelevant to the package itself. Which seems like the right solution to me.

from react.

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.