p5.js
p5.js copied to clipboard
Lightweight/moduler version of p5
Hi p5 Team.
As the web progresses and "weight" unfortunately also is a problem in the digital world – having frameworks, libraries, modules, plugins that are as lightweight as possible, could benefit a lot of people who don't have a fast internet connection. We, as developers, strive to achieve to create the smallest possible web applications. But small doesn't necessarily mean boring. I love p5. I love using p5 in every web project a can. But my problem is that p5, as of now, comes with a "weight" penalty, that's rarely outweighed by the wonderful things it can create.
So I would love to see p5 as a library, where you can pick and choose what functionally you need – and achieve that sweet spot between the "weight cost" and playful interactive web applications you can create with it.
How would this new feature help [increase access]
By optimizing p5 and slimming it down, people with slow internet connections wouldn't notice the "weight cost" of visiting a web application that's using p5.
Most appropriate sub-area of p5.js?
- [ ] Accessibility (Web Accessibility)
- [x] Build tools and processes
- [ ] Color
- [x] Core/Environment/Rendering
- [ ] Data
- [ ] DOM
- [ ] Events
- [ ] Friendly error system
- [ ] Image
- [ ] IO (Input/Output)
- [ ] Localization
- [ ] Math
- [ ] Unit Testing
- [ ] Typography
- [ ] Utilities
- [ ] WebGL
- [ ] Other (specify if possible)
New feature details:
Optimize p5 for a more modular approach like e.g. lodash, swyper, etc, where you import what you use, and don't import every you don't use.
There are some existing work done towards this end awhile ago: https://github.com/processing/p5.js/blob/main/tasks/build/combineModules.js
However it's not being used regularly and I'm not sure if it still works.
Thank you @adalberth. This topic is also mentioned in 'Minimising p5.min.js further for production #5740'. I am closing this issue for now to avoid repetition. We can continue this conversation in the issue #5740.