Skip to content

feat!: remove built-in underscore.js dependency#27

Open
bflad wants to merge 1 commit into
mainfrom
bflad/remove-underscore
Open

feat!: remove built-in underscore.js dependency#27
bflad wants to merge 1 commit into
mainfrom
bflad/remove-underscore

Conversation

@bflad
Copy link
Copy Markdown
Member

@bflad bflad commented Mar 9, 2026

Summary

  • BREAKING CHANGE: underscore.js is no longer bundled and automatically loaded into the JavaScript runtime. If you depend on underscore.js, you can inject it yourself using WithJSFiles:
    engine := easytemplate.New(
        easytemplate.WithJSFiles("underscore-min.js", underscoreJS),
    )
  • Removed the pkg/underscore package (embedded JS, Go wrapper, and LICENSE)
  • Removed the underscore import and RunString(underscore.JS) initialization from internal/vm/vm.go
  • Replaced all test usages of _.each and _.reduce with native JavaScript equivalents (Array.forEach, Array.reduce)
  • Removed underscore references from README.md (feature list bullet and "Using Underscore.js" section)

BREAKING CHANGE: underscore.js is no longer bundled and automatically
loaded into the JavaScript runtime. If you depend on underscore.js,
you can inject it yourself using `WithJSFiles`:

    engine := easytemplate.New(
        easytemplate.WithJSFiles("underscore-min.js", underscoreJS),
    )

All test usages of `_.each` and `_.reduce` have been replaced with
native JavaScript equivalents (`Array.forEach`, `Array.reduce`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant