Support user-added filters
- Dominant language
- JavaScript
- Stars
- 2.9k
- Forks
- 461
- PR merge metrics
- No merged PRs in 30d
Description
Currently all filters are hard-coded into dust.js. Helpers can be user added and this is a supported extension point. Filters are useful for a different set of problems than helpers and could easily be made user-extendable in much the same manner.
I would suggest that filter names of the form x- be designated for user-extensions leaving the rest of the namespace for language expansion. Otherwise we would always be facing a backward-compatibility risk.
To increase the flexibility I would suggest passing context on down to the filters as mentioned in Issue 204. This gives them more flexibility. A benefit of filter extensions is that the resulting object can still be passed as a param, etc unlike when a helper is used.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the filter implementation in dust.js and compare it with the existing user-added helper extension point. Review Issue 204 for the proposed context handling. Done means user-defined x- filters can receive context while preserving the existing filter namespace and allowing their results to be used as parameters.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100