I’ve been undisciplined studying apostrophe for a year and a few. So, I’m still a newbie, but I think maybe I could contribute to the lean philosophy.
This decision of remove jQuery or let the users choose not to use it was very good. jQuery was essential a decade ago, but now it’s kind of redundant, because most browsers provides a similar core api. Congratulations.
I understand that load everything onetime and let the browser cache is great, but just imagine… some modules need tons of javascript and css to work, and other modules not. Why load tons of javascript on a page that won’t use it? Imagine a user on a pieces-page index that only list a company team members. Why the javascript and the css related to the company e-commerce system would be loaded on that page?
I look at pages source code generated by apostrophe and I see lots of modules loaded. Everywhere. Why?
Yet… imagine a piece edited only by admins, but accessible to guests. This piece need a heavy javascript to edit action, but none to view. And the pushAssets ‘when’ option only have three options: always, user and now lean. Guests will have to load the script needed to edit by won’t use it.
Wouldn’t it be nice to have another load conditions? For instance:
- By path, like routes. Example: load xyz.js only on path ‘/products/*’.
- By user permissions. Example: load xyz.js only if user is allowed to edit ‘products’.
The same thought applies to css. On a project I’m working, admins will use apostrophe bars, menus and uis to edit pieces, but guests don’t. I still haven’t figured out how to remove them easily, when users are not admins. Despite it’s not a big deal, lean would be better.