UserFrosting
UserFrosting copied to clipboard
Script hooks for client-side assets
The frontend ecosystem has evolved considerably since UF v4 first released. Some projects utilising UF have also reimplemented their own custom frontends, which introduces manual build steps. We can do better.
The vision here is that UF will have some general hooks which sprinkles can utilise to run build steps within a given sprinkles scope.
Hooks would exist for the following;
-
uf-pre-bundle
which runs first in the built-inuf-bundle
-
uf-pre-assets-install
which runs first in the built-inuf-assets-install
, intended as a hook for runningnpm i
in sprinkles -
uf-clean
which runs in parallel with the built-inuf-clean
-
test
, which is an already established convention in the NPM ecosystem. This would be run as part of thebakery test
command (with flags to opt-out). I plan on utilising this hook to provide test coverage of our JS scripts.
These hooks would be defined in a sprinkles package.json
. A few other changes would be introduced to support this, mainly to account for the existing usage of package.json
.
Work on this would occur after https://github.com/userfrosting/UserFrosting/issues/1148
Some projects utilising UF have also reimplemented their own custom frontends, which introduces manual build steps.
Might be worth exploring Vue.js integration and/or documenting it on learn.
That was something I was thinking about. A starter sprinkle to demonstrate correct usage, along with supporting docs at learn would be the target.
Not relevant in UF5 anymore