Skip to content

Replace lodash with eta#3489

Merged
swissspidy merged 3 commits intoGoogleChrome:v7from
rtritto:replace-lodash
Apr 27, 2026
Merged

Replace lodash with eta#3489
swissspidy merged 3 commits intoGoogleChrome:v7from
rtritto:replace-lodash

Conversation

@rtritto
Copy link
Copy Markdown
Contributor

@rtritto rtritto commented Apr 1, 2026

lodash v4.18.0 introduced the issue lodash/lodash#6167 with lodash.template.

E.g.:

Error: Unable to generate service worker from template. 'assignWith is not defined'
    at populateSWTemplate (C:\Users\<USER>\AppData\Local\Yarn\Berry\cache\workbox-build-npm-7.4.0-c84561662c-10c0.zip\node_modules\workbox-build\build\lib\populate-sw-template.js:76:15)
    at writeSWUsingDefaultTemplate (C:\Users\<USER>\AppData\Local\Yarn\Berry\cache\workbox-build-npm-7.4.0-c84561662c-10c0.zip\node_modules\workbox-build\build\lib\write-sw-using-default-template.js:28:73)
    at generateSW (C:\Users\<USER>\AppData\Local\Yarn\Berry\cache\workbox-build-npm-7.4.0-c84561662c-10c0.zip\node_modules\workbox-build\build\generate-sw.js:95:23)

lodash.template is also deprecated (soruce lodash.template):

This package is deprecated. Use https://socket.dev/npm/package/eta instead.

lodash is used only in the workbox-build package (it uses lodash.template) and it can be replaced with eta (https://www.npmjs.com/package/eta).
The @types/lodash dependency at root package.json can also be removed.

@google-cla
Copy link
Copy Markdown

google-cla Bot commented Apr 1, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@rtritto
Copy link
Copy Markdown
Contributor Author

rtritto commented Apr 1, 2026

@google-cla I signed the CLA

@rtritto
Copy link
Copy Markdown
Contributor Author

rtritto commented Apr 10, 2026

FYI @swissspidy

@rtritto
Copy link
Copy Markdown
Contributor Author

rtritto commented Apr 27, 2026

@swissspidy all test passed, please can you review?

Copy link
Copy Markdown
Collaborator

@swissspidy swissspidy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR

@swissspidy swissspidy merged commit 8e6df29 into GoogleChrome:v7 Apr 27, 2026
3 checks passed
@rtritto rtritto deleted the replace-lodash branch April 27, 2026 13:02
@rtritto
Copy link
Copy Markdown
Contributor Author

rtritto commented Apr 27, 2026

@swissspidy thanks!

PS: next time you merge a PR, I reccomend you to use squash instead of merge: by this way you'll only have 1 commit in the history

@jayaddison
Copy link
Copy Markdown

NB: this appears to have been due to a CLI mapping that was not updated during the release of various lodash packages at v4.18.0 -- a fixup release v4.18.1 has recently been published that should repair those: https://github.com/lodash/lodash/releases/tag/4.18.1

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