fershad · GitHub

Currently, guideline 3.14 & its success criteria mention "beneficial JavaScript". There's a few parts of this section which could be made more specific (or I just need clarification on).

Current text:

Success Criterion: Beneficial JavaScript
Improve sustainability through accessible and performant code implementations.

"Beneficial JavaScript" isn't a term I've come across in the frontend development discourse. Is there a reference for this term? Is this guideline related to using "vanilla" JavaScript rather than external libraries, or something else?

As I read this, my inclination was that this section is either referring to:

  • "Browser native JavaScript and APIs", and/or
  • "Standards-based JavaScript and APIs"

"Standards-based JavaScript" would reference something like ECMAScript which is stewarded by TC39. This kind of terminology can refer to both frontend and backend parts of the web stack.

Referencing "browser native JavaScript" feels more "webby" but is limited to the frontend of the stack. There's also the issue of differing browser compatibility for JS standards, something that is covered by the Baseline initiative which we could point to in supplemental material.

What is a sustainable API?

Current text:

Success Criterion: Sustainable APIs
Apply potential energy-reducing APIs (such as Battery Status, Compression Streams, Page Visibility, and Vibration) if they can improve the eco-efficiency of your website or application.

What exactly is a "sustainable API"? Again it's not a term that's used in the common web dev discourse, and it's not something that we can expect someone approaching these guidelines to understand. Being more explicit of this criteria could help improve understanding.

I think what we're trying to point at here is Implement APIs to enhance sustainability. For example, simply using the Battery Status API isn't a sustainability step, but using the Battery Status API to then make a decision about what processes to run on a user's device is a meaningful sustainability action.

What API requests are we talking about?

Current text

Success Criterion: API requests
When using an API, make sure you only call it when necessary. On the other side, make sure no unrequired data is sent by the API.

For this guideline, it seems like we're referring to JavaScript APIs. The wording of this criteria is somewhat confusing in that context - when I read it, I'm immediately led to think about requesting data from an external API (e.g. I'm getting weather data for my web app). Is that what we're talking about here, or are we still talking about JavaScript APIs (like Battery Status for example)?

Read the original on github.com ↗