Skip to content

fix: migrate lodash to lodash-es for ESM compatibility#66

Merged
rsbh merged 1 commit into
mainfrom
fix/lodash-es
May 14, 2026
Merged

fix: migrate lodash to lodash-es for ESM compatibility#66
rsbh merged 1 commit into
mainfrom
fix/lodash-es

Conversation

@rsbh
Copy link
Copy Markdown
Member

@rsbh rsbh commented May 14, 2026

Summary

  • Replace lodash with lodash-es for proper ESM module exports
  • Fixes does not provide an export named 'default' error in Vite dev
  • Updates @types/lodash to @types/lodash-es
  • Tree-shakeable imports

Test plan

  • bun run dev:examples:basic — no import errors
  • Search works (debounce)
  • Config validation works (uniqBy)

🤖 Generated with Claude Code

Replace lodash with lodash-es for proper ESM exports. Fixes
"does not provide an export named 'default'" error in Vite dev.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chronicle Ready Ready Preview, Comment May 14, 2026 4:33am

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Updated core dependencies to use more efficient module formats, improving build optimization and compatibility with modern JavaScript tooling standards.

Walkthrough

The PR migrates the Chronicle package from CommonJS lodash to ESM lodash-es. Package dependencies and type definitions are updated in package.json, then import statements in two source files are converted to use the ESM build's named exports.

Changes

Lodash to lodash-es migration

Layer / File(s) Summary
Package dependency update
packages/chronicle/package.json
devDependencies and dependencies are switched from lodash and @types/lodash to lodash-es and @types/lodash-es, retaining the 4.17.23 version.
Source file import updates
packages/chronicle/src/components/ui/search.tsx, packages/chronicle/src/types/config.ts
Import statements for debounce and uniqBy are updated from lodash submodule paths to named imports from lodash-es.

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: migrating from lodash to lodash-es for ESM compatibility, which is the primary focus of all file modifications.
Description check ✅ Passed The description is directly related to the changeset, explaining the rationale for replacing lodash with lodash-es and providing a clear test plan.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/lodash-es

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/chronicle/package.json (1)

26-26: 💤 Low value

Consider aligning @types/lodash-es version with lodash-es.

The type definitions are at version 4.17.12 while the implementation is at 4.17.23. While lodash's API is stable and this mismatch is unlikely to cause issues, aligning the versions ensures full type coverage for any newer features or fixes.

📦 Suggested version alignment

Check if @types/lodash-es has a version closer to 4.17.23:

-    "@types/lodash-es": "^4.17.12",
+    "@types/lodash-es": "^4.17.21",

Note: Verify the latest available @types/lodash-es version on npm before updating.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/chronicle/package.json` at line 26, Update the `@types/lodash-es`
dependency in package.json to match the lodash-es implementation version: locate
the "@types/lodash-es" entry and change its version from "4.17.12" to a version
aligned with "lodash-es" (e.g., "4.17.23" or the closest available on npm);
verify the exact latest compatible `@types/lodash-es` version on npm first, update
the package.json entry, and run your package manager (npm/yarn/pnpm) to
reinstall and ensure no type regressions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/chronicle/package.json`:
- Line 26: Update the `@types/lodash-es` dependency in package.json to match the
lodash-es implementation version: locate the "@types/lodash-es" entry and change
its version from "4.17.12" to a version aligned with "lodash-es" (e.g.,
"4.17.23" or the closest available on npm); verify the exact latest compatible
`@types/lodash-es` version on npm first, update the package.json entry, and run
your package manager (npm/yarn/pnpm) to reinstall and ensure no type
regressions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b065e43c-e83e-42a8-a4f4-77b06f61dd29

📥 Commits

Reviewing files that changed from the base of the PR and between 28eae37 and 44585ef.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • packages/chronicle/package.json
  • packages/chronicle/src/components/ui/search.tsx
  • packages/chronicle/src/types/config.ts

@rsbh rsbh merged commit e23cfae into main May 14, 2026
4 checks passed
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