Registry / devops / ember-cli-lodash-subset

ember-cli-lodash-subset

JSON →
library2.0.1jsnpmunverified

ember-cli-lodash-subset is an Ember CLI addon designed to optimize application startup times by creating a custom, trimmed-down build of Lodash. It leverages Rollup and `lodash-es` to selectively include only the Lodash functions explicitly defined in its `lodash.subset.js` configuration. This approach aims to reduce the overall JavaScript bundle size, offering a 20-30% improvement in Ember CLI startup performance by eliminating unused Lodash utilities. The current version is 2.0.1, published several years ago. There is no active development or regular release cadence for this specific package. While it offered significant benefits upon its release, modern Ember CLI applications typically achieve similar tree-shaking benefits for Lodash by directly using `lodash-es` with `ember-auto-import`, making this addon largely superseded and less relevant in current Ember development workflows.

devops
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

The addon makes Lodash functions available under the 'lodash' path, not 'lodash-es' directly, even though it uses 'lodash-es' for its build. Named imports are preferred for tree-shaking.

import { get } from 'lodash';

While possible, importing the entire Lodash object (`_`) via a default import largely negates the bundle size optimization benefits of this addon, as it prevents effective tree-shaking.

import _ from 'lodash';

Specific functions should be imported directly from 'lodash' (the alias provided by the addon) rather than deeper paths like 'lodash/debounce'.

import { debounce } from 'lodash';

Demonstrates installing the addon, then importing and using `debounce` and `isEmpty` from the custom Lodash subset within an Ember component for a debounced search input.

import Ember from 'ember'; import Component from '@ember/component'; import { debounce } from 'lodash'; import { isEmpty } from 'lodash'; export default Component.extend({ searchQuery: '', init() { this._super(...arguments); // Define a debounced version of the search action this.debouncedSearch = debounce(this.performSearch, 500); }, actions: { updateSearchQuery(event) { this.set('searchQuery', event.target.value); this.debouncedSearch(); }, performSearch() { const query = this.get('searchQuery'); if (isEmpty(query)) { console.log('Search query is empty, doing nothing.'); return; } console.log(`Searching for: ${query}`); // In a real app, you'd trigger a service call or route transition here. } }, willDestroyElement() { this._super(...arguments); // Ensure debounce is cancelled to prevent memory leaks this.debouncedSearch.cancel(); } });
Debug
Known footguns
deprecatedThe `ember-cli-lodash-subset` addon is largely superseded by modern Ember CLI features, specifically `ember-auto-import` (available since Ember v3.x) used with `lodash-es`. These allow direct NPM package imports and efficient tree-shaking of Lodash, often achieving similar or better optimization without this addon.
gotchaThis addon provides only a *subset* of Lodash. If a Lodash function is not explicitly listed in the `lodash.subset.js` configuration within the addon's source, attempting to import or use it will result in a runtime error (e.g., 'X is not a function' or 'Cannot read properties of undefined').
breakingThis package is no longer actively maintained. Its GitHub repository shows no recent activity, and its last known publication was several years ago. It may not be compatible with newer versions of Node.js, Ember CLI, or other ecosystem dependencies, leading to build failures or unexpected runtime behavior.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
9 hits · last 30 days
gptbot
4
ahrefsbot
4
script
1
Resources