Open nok opened 10 years ago
We are excited about this idea and have started looking at modules such as: https://github.com/lmccart/p5.js/blob/main/lib/addons/p5.dom.js
More discussion in processing/p5.js#522.
Just to clarify: This is not about the modularization of the library, that's in processing/p5.js#522. After modularization, this is about building into the website the ability to download a specific build of the website containing only the code that you need.
(If I'm wrong about that, please let me know.)
Based on the Modernizr example I believe that is correct; another example would be something along the lines of https://lodash.com/custom-builds
Yes, your additional examples are matching my example and the basic idea.
@lmccart Hi! I'd to know if this is still open for consideration? I really like this idea! I'd love to pitch this in my GSoC 17 proposal :smile: Could you please share any recent developments which you think would be related to this ? Thanks!
hi @sakshamsaxena, yes it's totally open. there's not really been any development on this but it'd be an exciting addition. the furthest we got was separating the src into folders and creating a "core" folder. i'd imagine this core would be the basis for any custom build of p5.js, and the other components could be based on the other folders in src (ex: typography, webgl, etc).
(@lmccart) @sakshamsaxena, if you need any help or support, we can build it together. 😄
Thanks for the encouragement! I'm hunting a couple more feature requests/pending bugs which I'd like to work on, apart from studying the code and fiddling with the source. Will soon get back with a solid proposal!
(Re)Activating the discussion.
Over the summer, I worked closely with @lmccart on generating a custom library with specific modules, as was the goal here, using Grunt. I think it works splendidly as of now, but is limited to CLI usage, and still needs to be tested out in production (still fingers crossed!). Though the aim was to make this available on the website too, but we underestimated the time required to get the basic task of building done.
Would be picking up the task from next week onwards, after some discussion of ideas and constraints on implementing this on the website! ( @nok Would love to hear from you again :smiley: )
currently, it is possible to create builds with custom combinations of modules. this happens right now as a grunt task. the next step is to add the website interface for allowing users to specify the modules they'd like to include and dynamically creating a build. the issue for the website portion of this task, to be completed first is here: https://github.com/processing/p5.js-website/issues/138
In the majority of cases I used canvas libs for simple drawings, but I had to download the complete library. In my view it's a huge disadvantage, because the libraries are almost fat.
It would be a huge advantage, if we could offer a download of a modular generated library. I imagine something like the Modernizr download page, where you can select parts of the library (primitives, lights, camrea, ...).
In addition we could add a seperate namespace.
What do you think?
Regards, Darius