Repository navigation
build(helpers): upgrade memoize-one to v7 - #895
Conversation
memoize-one 7 ships only ESM. require(esm) returns the namespace, so the v6 `.default || require()` fallback is replaced by the named memoizeOne export, which Node >= 22.12 resolves and engines already requires. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
memoize-one 7 is ESM only:
require('memoize-one')returns the module namespace instead of the function.Change
packages/metascraper-helpers/src/index.js:const { memoizeOne } = require('memoize-one'), replacing the.default || require()fallback that only existed for the v6 dual buildpackages/metascraper-helpers/package.json:~6.0.0→~7.0.0The exported
memoizeOnekeeps its shape: same function, still carryingEqualityUrlAndHtmlDomandEqualityFirstArgument.require(esm)is unflagged on Node >= 22.12; engines requires >= 22.13.Tested
metascraper-helpers: 80 passedmemoizeOnethrough helpers: amazon 6, bluesky 6, citation 16, dribbble 4, iframe 18, imdb 3, instagram 14, pinterest 4, readability 8, reddit 8, soundcloud 3, spotify 28, telegram 9, tiktok 7, uol 5, x 19, youtube 9, all passedstandardon the file🤖 Generated with Claude Code
Note
Low Risk
Dependency bump with a small import fix in shared helpers; Node >= 22.13 already supports requiring ESM, and tests reportedly cover helpers and downstream plugins.
Overview
Bumps
memoize-oneto ~7.0.0 in@metascraper/helpersand updates how it is loaded for v7’s ESM-only package shape underrequire().The import in
packages/metascraper-helpers/src/index.jsnow usesconst { memoizeOne } = require('memoize-one'), dropping the v6.default || require()fallback. Behavior intended for consumers is unchanged: the samememoizeOneexport (includingEqualityUrlAndHtmlDomandEqualityFirstArgument) is still re-exported from helpers for plugins such as JSON-LD parsing.Reviewed by Cursor Bugbot for commit 98deca4. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit