-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace Handlebars with Template Strings #977
Comments
Partial work towards this can be found here: https://github.com/hapijs/lab/pull/978/files |
@hueniverse, I got this fully working. This change is backwards compatible. Template String HTML reporter can be enabled via With feature flag on, unit tests pass and coverage is at 100%. With feature flag off, all but one unit tests pass. It is important to note that the failed unit test is a false positive as the unit test itself was updated to support template strings. Meaning that when feature flag is off, all functionality works as before but runs one unit test that is meant to pass only when feature flag is on. It is possible to add backwards compatibility to the failed unit tests. That is, toggle between the appropriate assertions via the feature flag. Would love to get some guidance here. Looking forward to your feedback :) |
Just wanted to add on the "resolves [...] future Handlebars vulnerabilities" note -- this showed up in my NPM audit today:
|
@stevendesu, Handlebars has released v4.7.4 which deprecates use of optimist in favor of yargs. As an interim solution, while this issue is being reviewed, you can try updating to v4.7.4 by way of running |
Closing this issue for now as the vulnerability was addressed through a combination of PRs to Handlebars: |
Support plan
Context
What problem are you trying to solve?
Lab depends on Handlebars to generate HTML for coverage reports. While Handlebars is a great templating language, it seems to have fallen out of maintenance. There are currently almost 200 vulnerabilities ranging in severity from critical to low (albeit the overwhelming majority are low). In addition, some advisories just cannot be resolved without resorting to forced resolutions or exceptions via
nsprc
. That is,npm audit --fix
ornpm update --depth={{depth}}
do not work.With a relatively low-level of effort, we can remove handlebars dependency altogether by using template strings. For example, see https://github.com/hapijs/lab/pull/978/files.
ROI
reporters/html/partials/*.html
andreporters/reporter.html
Notes
Do you have a new or modified API suggestion to solve the problem?
The suggested feature does not require changes to the API.
The text was updated successfully, but these errors were encountered: