Skip to content

Commit 0e85cd4

Browse files
LeaVeroucynthiatorgorhiaro
authored
Add first pass at principle about designing around third-party tools (#351)
Co-authored-by: Sangwhan "fish" Moon <[email protected]> Co-authored-by: Daniel Appelquist <[email protected]> Co-authored-by: Amy Guy <[email protected]>
1 parent d951f0d commit 0e85cd4

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

index.bs

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,58 @@ and doing cleanup as necessary (see above).
805805
is still [under discussion](https://github.com/whatwg/html/issues/6588).
806806
</div>
807807

808+
<h3 id="third-party-tools">Prioritize usability over compatibility with third-party tools</h3>
809+
810+
Design new features with usability as the primary goal, and compatibility with third-party tooling as a secondary goal.
811+
812+
The web platform benefits from a wide ecosystem of tooling
813+
to facilitate easier and faster development.
814+
A lot of the time, the syntax of an upcoming web platform feature
815+
may conflict with that of a third-party tool causing breakage.
816+
This is especially common as third-party tools are often used to prototype
817+
new web platform features.
818+
819+
In general, web platform features last a lot longer than most third-party tools,
820+
and thus giving them the optimal syntax and functionality should be of high priority.
821+
822+
In some cases, the conflict will introduce problems across a large number of
823+
web sites, necessitating the feature's syntax to be redesigned to avoid clashes.
824+
825+
<div class="example">
826+
<code>Array.prototype.contains()</code> had to be renamed to
827+
<code>Array.prototype.includes()</code> to avoid clashes with
828+
the identically named but incompatible method from PrototypeJS,
829+
a library that was in use in millions of websites.
830+
</div>
831+
832+
However, these cases should be exceptions.
833+
834+
When deciding whether to break third party tools with new syntax, there are several factors to consider,
835+
such as severity of the breakage,
836+
popularity of the third party tool,
837+
and many more.
838+
839+
Possibly the most important factor is how severely would the usability of the web platform feature be compromised
840+
if its syntax was changed to avoid breaking the third party tool?
841+
If several alternatives of similar usability are being considered,
842+
it is usually preferable to prioritize the ones that inconvenience third party tools the least.
843+
844+
<div class="example">
845+
When the CSS WG was designing [[CSS-GRID-1|CSS Grid Layout]],
846+
square brackets were chosen instead of parentheses for naming grid tracks
847+
to avoid breaking Sass, a popular preprocessor.
848+
</div>
849+
850+
However, if avoiding breaking the third party tool would lead to
851+
a *significant* negative impact on of the feature's usability,
852+
that is rarely an acceptable tradeoff,
853+
unless it causes significant breakage of live websites.
854+
855+
Languages should also provide mechanisms for extensibility
856+
that authors can use to extend the language
857+
without breaking future native functionality,
858+
to reduce such dilemmas in the future.
859+
808860
<h2 id="html">HTML</h2>
809861

810862
This section details design principles for features which are exposed via HTML.

0 commit comments

Comments
 (0)