Skip to main content

Copy of some Draft Web Development Guidelines

Dependencies are appropriately used and maintained

While JavaScript may not cause the most website bloat, it can cause very high emissions in terms of CPU load due to the rendering process, thereby it makes sense to consider the use of dependencies and third-party code carefully.

Criteria: Dependency management

Machine-testable

Prevent developers from downloading and installing JavaScript libraries to run locally (client-side) when they are not needed by checking for unused dependencies and uninstalling those that aren't needed and removing them from your package.json file.

Resources

Criteria: Dependency necessity

Machine-testable

Only use libraries where necessary as this will reduce the amount of JavaScript that has to be downloaded and parsed by the browser. Consider whether you can use a native JavaScript API instead. Check the package size, and whether individual modules can be installed and imported rather than the whole library.

Resources

Criteria: Dependency updates

Machine-testable

Regularly check dependencies and keep them up-to-date.

Resources

Impact: Medium, Effort: Low

GRI Impact of Dependencies are appropriately used and maintained
GRI Impact
materials Low
energy Low
water Low
emissions Low
Benefits of this guideline
  • Environment: Developer's machines do not need to waste energy installing and / or rendering packages that are not needed.
  • Security: Third-party code can contain bugs and security issues. Keeping packages up-to-date and using fewer third-party libraries reduces the likelihood of security flaws.
  • Performance: Reduction in client-side JavaScript normally results in faster websites.

Example

Tags: