refactor: remove lodash dependency and fix @types in prod deps#2252
Open
bjnewman wants to merge 2 commits intorun-llama:mainfrom
Open
refactor: remove lodash dependency and fix @types in prod deps#2252bjnewman wants to merge 2 commits intorun-llama:mainfrom
bjnewman wants to merge 2 commits intorun-llama:mainfrom
Conversation
- Replace lodash with native JS equivalents: - _.isNil(x) → x == null - _.isObject(x) before instanceof → removed (unnecessary) - _.values(obj) → Object.values(obj) - _.get(obj, key, default) → obj[key] ?? default - _.fromPairs/sortBy/toPairs → Object.fromEntries/sort - Move @types/node from dependencies to devDependencies in: - @llamaindex/core - @llamaindex/llamaindex - @llamaindex/experimental - Remove lodash and @types/lodash from: - @llamaindex/llamaindex - @llamaindex/experimental - Fix MCP test compatibility by updating: - @modelcontextprotocol/sdk: ^1.13.0 → ^1.25.3 - @modelcontextprotocol/server-filesystem: ^2025.7.1 → ^2026.1.14 - Add native-replacements.test.ts (28 tests) validating JS behavior Bundle size reduction: ~70KB from lodash removal
🦋 Changeset detectedLatest commit: 8f6a061 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remove lodash dependency (~70KB bundle savings) by replacing with native JS:
_.isNil(x)→x == null_.isObject(x)beforeinstanceof→ removed (unnecessary guard)_.values(obj)→Object.values(obj)_.get(obj, key, default)→obj[key] ?? default_.fromPairs/sortBy/toPairs→Object.fromEntries([...Object.entries()].sort())Move
@types/nodefrom dependencies to devDependencies in:@llamaindex/core@llamaindex/llamaindex@llamaindex/experimentalRemove
lodashand@types/lodashfrom:@llamaindex/llamaindex@llamaindex/experimentalFix MCP test compatibility by updating:
@modelcontextprotocol/sdk:^1.13.0→^1.25.3@modelcontextprotocol/server-filesystem:^2025.7.1→^2026.1.14Add
native-replacements.test.tswith 28 tests validating native JS equivalentsMotivation
Part of the e18e ecosystem cleanup initiative. This PR:
@types/*packages in production dependencies (should be devDependencies)MCP Version Fix Details
The MCP test (
packages/tools/tests/mcp.test.ts) was failing locally with:Root cause:
@modelcontextprotocol/sdk@1.13.0validates that tool responses includeinputSchema.type === "object", but@modelcontextprotocol/server-filesystem@2025.7.1returns tools without that field.The version bump to SDK 1.25.3 and server-filesystem 2026.1.14 resolves this compatibility issue. This appears to be a pre-existing issue that was masked by turbo's remote caching (
TURBO_REMOTE_ONLY=truein CI).Test plan
🤖 Generated with Claude Code