What is e18e?

RocíoRocíoAugust 13, 2024
What is e18e?

What is e18e?

Do you know what l10n is? What about i18n? Don't confuse them with e18e, because they have little in common 💀.

e18e stands for "Ecosystem Performance" and is a frontend community initiative to share and highlight libraries and ideas to improve performance in the JavaScript ecosystem.

Aging package.json files are often plagued with obsolete dependencies in the deepest parts of the tree... This initiative fights to simplify dependency trees, eliminate obsolete ones, and improve the performance of common dependencies.

Its three areas of work are:

  • cleanup - clean up dependency trees and modernize popular tools and libraries in the ecosystem.
  • speedup - improve speed in parts of the ecosystem that many users depend on.
  • levelup - provide and document modern and lightweight alternatives to the utilities and libraries we all regularly use.

Resources

On their resources page, there are quite a few interesting things, for example:

  • eslint-plugin-depend: ESLint plugin to alert about replaceable dependencies.
  • eslint-plugin-barrel-files: ESLint plugin to avoid barrel files.

(Note: versions of these plugins also exist for Biome)

To analyze which dependencies can be replaced, these utilities are based on the Module Replacements package (also from the community). The module replacements are divided into three:

  • native: pseudopolyfills, functionality that is already native and for which you don't really need any library.
  • micro: micro-utilities, such as the npm package is-whitespace, which can be replaced with native/lighter alternatives.
  • preferred: this is an opinionated list of replacements for slightly larger libraries (bluebird-q replaces bluebird, lodash replaces underscore...).

Coding tips

  • Avoid generators in heavily used code paths: Currently, most JavaScript engines don't optimize calls to generator functions, which can have a big impact on performance if used extensively.
  • Avoid chaining array methods (.map().filter()...), as they involve creating and destroying intermediate arrays, increasing the work of the garbage collector.

Conclusion

After fiascos like XZ Utils, the community seems to be working hard to establish and renew practices in the JavaScript dependency system. If this initiative continues forward, it can have a very positive impact on the security and complexity of our dependencies, bundle size, etc... 🚀