Skip to content

build(helpers): upgrade memoize-one to v7 - #895

Merged
Kikobeats merged 1 commit into
masterfrom
Kikobeats/memoize-one-v7
Nov 26, 2026
Merged

Kikobeats merged 1 commit into
masterfrom
Kikobeats/memoize-one-v7

Conversation

@Kikobeats

@Kikobeats Kikobeats commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

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 build
  • packages/metascraper-helpers/package.json: ~6.0.0 → ~7.0.0

The exported memoizeOne keeps its shape: same function, still carrying EqualityUrlAndHtmlDom and EqualityFirstArgument. require(esm) is unflagged on Node >= 22.12; engines requires >= 22.13.

Tested

  • metascraper-helpers: 80 passed
  • Every plugin that calls memoizeOne through 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 passed
  • standard on 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-one to ~7.0.0 in @metascraper/helpers and updates how it is loaded for v7’s ESM-only package shape under require().

The import in packages/metascraper-helpers/src/index.js now uses const { memoizeOne } = require('memoize-one'), dropping the v6 .default || require() fallback. Behavior intended for consumers is unchanged: the same memoizeOne export (including EqualityUrlAndHtmlDom and EqualityFirstArgument) 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

  • Chores
    • Updated an internal package dependency.

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>
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The helper package updates its memoize-one dependency range from ~6.0.0 to ~7.0.0 and switches to importing the named memoizeOne export.

Changes: memoize-one upgrade

Layer / File(s) Summary
Dependency and named import
packages/metascraper-helpers/package.json, packages/metascraper-helpers/src/index.js
The dependency range changes to ~7.0.0. The import uses the named memoizeOne export instead of the default-export lookup and CommonJS fallback.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Other

Possibly related PRs

Merge Risk: Minimal · up to 98dec

This is a small dependency upgrade with a matching import change. No concrete merge-blocking risk was identified, and it can be reverted easily.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "build(helpers): upgrade memoize-one to v7" matches the main change. The PR bumps memoize-one from ~6.0.0 to ~7.0.0 in metascraper-helpers and updates the import to the named memoizeOne expo…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "build(helpers): upgrade memoize-one to v7" matches the main change. The PR bumps memoize-one from ~6.0.0 to ~7.0.0 in metascraper-helpers and updates the import to the named memoizeOne export. The title is short, specific, and names the affected package. It does not cover the import change, which is expected for a title.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a3b25267-061e-42ef-9f2d-74012d701ebd
Commits

Reviewing files that changed from the base of the PR and between b4346f1 and 98deca4.

Files selected for processing: 2

  • packages/metascraper-helpers/package.json
  • packages/metascraper-helpers/src/index.js

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Status

Coverage is 95.213% — Kikobeats/memoize-one-v7 into master. No base build found for master.

@Kikobeats
Kikobeats merged commit 870cb78 into master Nov 26, 2026
67 checks passed
@Kikobeats
Kikobeats deleted the Kikobeats/memoize-one-v7 branch November 26, 2026 08:27
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.

2 participants