Skip to content

Conversation

Copy link

Copilot AI commented Nov 11, 2025

Removes lodash/lodash-es dependency across all packages, replacing with native JavaScript methods, VueUse composables, and minimal libraries (fast-deep-equal, rfdc).

Replacements by category

Array/Object methods → Native JS

  • indexOf, find, filter, mapArray.prototype methods
  • keyByObject.fromEntries with map
  • isEmptyObject.keys().length
  • differencefilter with Set
  • compactfilter(Boolean) with type guard
  • partition → Custom forEach implementation

Async utilities → VueUse

  • throttleuseThrottleFn (components, hub-features)
  • debounceuseDebounceFn (components) or custom helper (jsonforms)

Specialized functions → Minimal libraries

  • cloneDeeprfdc package
  • isEqualfast-deep-equal package
  • uniqueId → Custom counter implementations
  • maxBy → Manual loop
  • merge → Spread operator with manual header merging

Example changes

// Before
import { keyBy, partition } from "lodash-es";
const map = computed(() => keyBy(items, "id"));
const [included, excluded] = partition(array, predicate);

// After
const map = computed(() => 
  Object.fromEntries(items.map(item => [item.id, item]))
);
const included = [], excluded = [];
array.forEach(item => {
  (predicate(item) ? included : excluded).push(item);
});
// Before
import { throttle } from "lodash-es";
const handler = throttle(fn, 100);

// After
import { useThrottleFn } from "@vueuse/core";
const handler = useThrottleFn(fn, 100);

Packages removed

  • lodash-es from components, hub-features, jsonforms
  • @types/lodash-es from root devDependencies

Packages added

  • fast-deep-equal@3.1.3 (isEqual replacement, no vulnerabilities)
  • rfdc@1.4.1 (cloneDeep replacement, no vulnerabilities)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • vueuse.org
    • Triggering command: curl -s REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Replace all lodash/lodash-es usages with native code following https://raw.githubusercontent.com/you-dont-need/You-Dont-Need-Lodash-Underscore/refs/heads/master/README.md
Use fast-deep-equal/es6 npm package if a deep equal check is required.
Use rfdc npm package for cloneDeep.
Make sure tests still run (pnpm test:unit), linting passes (pnpm lint:js --fix) and type-check passed (pnpm type-check).


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@changeset-bot
Copy link

changeset-bot bot commented Nov 11, 2025

⚠️ No Changeset found

Latest commit: a01764d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

- Add fast-deep-equal and rfdc packages for isEqual and cloneDeep
- Replace lodash functions with native alternatives
- Use VueUse for throttle and debounce where available
- All tests pass, linting and type-check successful
Copilot AI changed the title [WIP] Replace lodash usages with native code and implement alternative packages Replace lodash/lodash-es with native JavaScript and lightweight alternatives Nov 11, 2025
Copilot AI requested a review from jschroeter November 11, 2025 12:39
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