Elderjs / elderjs

Elder.js is an opinionated static site generator and web framework for Svelte built with SEO in mind.
https://elderguide.com/tech/elderjs/
MIT License
2.12k stars 53 forks source link

Increase ElderAddExternalHelpers priority #230

Closed marceloomens closed 1 year ago

marceloomens commented 2 years ago

I suggest to increase the priority of the elderAddExternalHelpers hook registered on bootstrap. The "informal" hook contract mentions that the valid range of priority values is from 1 to 100. If the priority of the elderAddExternalHelpers is 1 (lowest) then there's no way to register another bootstrap hook that can meaningfully utilize helpers.

A workaround seems to be to simply ignore the informal spec and register a hook with priority 0. This hook will have access to functionality implemented by helpers.

See also the section on hook specification in the ElderJS doc: https://elderguide.com/tech/elderjs/#hook-specification