Skip to content

v10.0.0

Latest

Choose a tag to compare

@bgub bgub released this 30 Nov 23:49

Breaking changes

  • renderFile options are now a separate argument: renderFile(filename, data, options?, callback?). Values in template data no longer configure the engine (including autoEscape, cache, views, data.settings, and data.options). This fixes a security issue where user-controlled render data could disable escaping; an advisory will follow.
  • Express: app.engine('sqrl', Sqrl.renderFile) still works, but Express locals (cache, settings) no longer configure Squirrelly. Use a small wrapper to pass cache/views. See the migration guide.
  • Callbacks: render and renderFile share the (data, options?, callback?) forms. Callbacks work with sync templates and are called exactly once.
  • Types: TemplateFunction returns string | Promise<string>.

Fixes

  • Linear-time parsing of long literal text (#271, thanks @VadimToptunov)
  • ESM bundle no longer requires require at import time, fixing Vite/browser imports (#272, thanks @draarivpatel-ui)
  • useWith: true no longer breaks when data has a cb field

Maintenance

  • CI moved to GitHub Actions; Travis and Coveralls removed

Thanks to Vishal Suwalka for responsibly reporting the security issue.