Pinegrow Community Support Forum

Components / Blocks -- Component Library Resources -- Automation


I wanted to ask if in the future assigning ‘Component Library Resources’ could be made to be automated in Pinegrow without the need for user interaction unless further required or desired.

Components / Blocks are a great and valuable resource for rapid development however linking resources can be a disadvantage when creating many components and thus rather time consuming.

Since all the resources (Javascript/CSS/Images/Etc.) are already referenced and called where/when used, couldn’t Pinegrow itself use these references and calls to parse and iterate through the item(s) and determine what exact resources are required for the Component / Block in an automated fashion for easier Component / Block creation?

It seems like everything exists for this to occur and would make creating Components / Blocks a lot more user friendly.

Thanks for any feedback, looking forward to hear your thoughts,


Rather quiet around here, perhaps this would have been better served under “Feature Request” ?

Anyone (85 views so far) ? :disappointed:

The simple ideal of using recursion by Pinegrow, as described above, to be able to determine the needed resources when a component is defined, seems doable.

No thoughts by anyone? :nerd: :ear:

I would have to agree that this seems doable. One of the things that dismayed me most about blocks was the huge overhead that got dumped in as soon as they were used.

I am reminded about my one any only experience with buying themes: the theme developers appeared to throw in everything to make the theme look great (sliders, fancy navigation, image galleries etc.) and, fair enough, it was easy enough to remove what one did not want in the html, but the problem was the js and css libraries were still there and determining which ones could be safely deleted was practically impossible. I also worry about unneeded items within the libraries and style.css as well.

If Pinegrow is use to develop exciting looking themes for sale to others, none of this matters. But to those of us who use it to develop a usable website, then resource bloat and slow loading times are very serious issues. Any help in optimising the end result is very valuable!

Thanks for replying @greyguru , at least I am not alone then, you made some good points. I would love to hear from others but more importantly the actual Pinegrow Developers.

@Pinegrow_User, @greyguru thanks for the detailed suggestion.

Auto-detecting all resources that might be needed for a set of blocks is not hard.

Auto-detecting minimal required resources for a particular component / block is much harder, especially for JS stuff.

But I guess having a smarter auto process that would work well at least for the non-JS stuff would be quite useful. I’ll tag this as feature request.

Personally, I’m not a fan of bloated themes and websites.

Thanks so much for responding @Matjaz and your valued feedback. Can you explain a little further the details or limitations concerning Javascript with this approach?

Perhaps I am missing some thought on why it becomes an issue, I felt all required resources would be capable and work well with this approach. Are they not just references to external resources used within the project, or do they (JS) get embedded in components in their entirety?

Seems like an algorithm could be devised to sort it all out within the projects. Thanks again for your feedback and any other input you can provide, many thanks.

I posted an official feature request here with added thoughts:

Would love a way to share blocks and grabbing CSS and JS from online blocks to be easier. Problem with using blocks is multiple css files and duplicate code like hundreds of h1, a, and body tags

Blocks for rapid development was one of main reason I purchased PG

One way I have worked around is I created a base theme with hundreds of blocks in a html file and all CSS in one CSS file. I have these set up as components and plan to convert to ACF flexible content if possible.

I then just drag in the component I need from Libary and when website is finished I use tools like unused-css to remove any unnecessary CSS same for JS.