OpenEnergyDashboard / OED

Open Energy Dashboard (OED)
Mozilla Public License 2.0
73 stars 252 forks source link

Only import essential from lodash #1286

Open nlin21 opened 3 days ago

nlin21 commented 3 days ago

Description

Changed lodash imports to import the essential functions, rather than all (). moment.js is getting deprecated, so no changes were made to imports involving that library. Imports from react (`import as React from 'react`) were not changed, as it would take a lot of work to determine the essential functions.

Fixes #1190

Type of change

Checklist

Limitations

Look into how to change React imports to only import the essential functions.

huss commented 1 day ago

Thanks to @nlin21 for doing this work. If I search for ' _ ' or 'lodash', I find a number of require('lodash') in src/server that don't specify the name. Is it possible to clean those up too? It seems some are imported and not used so they could be eliminated.

nlin21 commented 17 hours ago

Hi Steve, I have updated the requires() statements from lodash in those files. I have also removed any unused requires() statements.