Skip to content

chore: replace lodash with eta for config templating#4208

Merged
erickzhao merged 2 commits into
mainfrom
claude/remove-lodash-dependency-KcYwN
Apr 9, 2026
Merged

chore: replace lodash with eta for config templating#4208
erickzhao merged 2 commits into
mainfrom
claude/remove-lodash-dependency-KcYwN

Conversation

@MarshallOfSound
Copy link
Copy Markdown
Member

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • The changes are appropriately documented (if applicable).
  • The changes have sufficient test coverage (if applicable).
  • The testsuite passes successfully on my local machine (if applicable).

Summarize your changes:

This PR replaces the lodash template function with eta for rendering configuration templates. The changes include:

  1. Dependency updates: Removed lodash and @types/lodash dependencies, added eta as a replacement for template rendering functionality.

  2. Template rendering refactor: Updated renderConfigTemplate() in forge-config.ts to use eta.renderString() instead of lodash's template() function. The eta template engine supports the same <%= %> placeholder syntax and provides better performance.

  3. Code cleanup: Removed unused merge() import from upgrade-forge-config.spec.ts and import.ts. Refactored test fixtures in upgrade-forge-config.spec.ts to use factory functions instead of shared mutable objects, improving test isolation.

  4. Test coverage: Added comprehensive test case for template interpolation covering simple placeholders, nested object access, and untouched plain strings.

Test Plan:

The existing test suite covers the template rendering functionality. New test case validates that <%= %> placeholders are correctly interpolated from the template object, including nested property access.

https://preview.claude.ai/code/session_01XkV7W4FyKPut4S21cZZY5U

claude added 2 commits April 8, 2026 22:52
Replace `_.template` in `renderConfigTemplate` with an inline `<%= %>`
interpolator, drop the unused `_.merge` call in the import command (its
result was never persisted), and use a factory in the upgrade-forge-config
spec instead of `_.merge` for cloning.
Replace the hand-rolled `<%= %>` interpolation with `eta`, configured
with `useWith`/`autoEscape: false`/`autoTrim: false` to match the
previous lodash template semantics.
@MarshallOfSound MarshallOfSound requested a review from a team as a code owner April 8, 2026 23:00
@MarshallOfSound MarshallOfSound changed the title Replace lodash with eta for template rendering chore: replace lodash with eta for config templating Apr 8, 2026
@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedeta@​3.5.09910010087100

View full report

@erickzhao erickzhao added this pull request to the merge queue Apr 9, 2026
Merged via the queue into main with commit b3df407 Apr 9, 2026
14 of 15 checks passed
@erickzhao erickzhao deleted the claude/remove-lodash-dependency-KcYwN branch April 9, 2026 17:45
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.

3 participants