Skip to content

Commit c0fc204

Browse files
keithamuskoddsson
andauthored
Simplify asteriks by hardcoding them
Co-authored-by: Kristján Oddsson <[email protected]>
1 parent 3c256de commit c0fc204

File tree

1 file changed

+31
-53
lines changed

1 file changed

+31
-53
lines changed

docs/index.html

Lines changed: 31 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
td[data-supported="false"] {
3434
background-color: red;
3535
}
36-
td[data-polyfill][data-supported="false"],
37-
td[data-polyfill] ~ [data-supported="false"],
38-
td[data-transpiled][data-supported="false"],
39-
td[data-transpiled] ~ [data-supported="false"]
36+
tr[data-polyfills] ~ tr td[data-polyfill] ~ [data-supported="false"],
37+
tr[data-polyfills] ~ tr td[data-polyfill][data-supported="false"],
38+
tr[data-transpiled] ~ tr td[data-code] ~ [data-supported="false"],
39+
tr[data-transpiled] ~ tr td[data-code][data-supported="false"]
4040
{
4141
background-color: lightseagreen;
4242
}
@@ -350,7 +350,7 @@
350350
<code>AbortSignal.abort</code>
351351
</a>
352352
</th>
353-
<td data-polyfilled data-polyfill="abortSignalAbort"></td>
353+
<td data-polyfill="abortSignalAbort">*</td>
354354
<td data-supported="true">93+</td>
355355
<td data-supported="true">93+</td>
356356
<td data-supported="true">88+</td>
@@ -364,7 +364,7 @@
364364
<code>AbortSignal.timeout</code>
365365
</a>
366366
</th>
367-
<td data-polyfilled data-polyfill="abortSignalAbort"></td>
367+
<td data-polyfill="abortSignalTimeout">*</td>
368368
<td data-supported="false">*</td>
369369
<td data-supported="false">*</td>
370370
<td data-supported="false">*</td>
@@ -378,7 +378,7 @@
378378
<code>AggregateError</code>
379379
</a>
380380
</th>
381-
<td data-polyfilled data-polyfill="aggregateError"></td>
381+
<td data-polyfill="aggregateError">*</td>
382382
<td data-supported="true">85+</td>
383383
<td data-supported="true">85+</td>
384384
<td data-supported="true">79+</td>
@@ -392,7 +392,7 @@
392392
<code>Array.at</code>
393393
</a>
394394
</th>
395-
<td data-polyfilled data-polyfill="arrayAt"></td>
395+
<td data-polyfill="arrayAt">*</td>
396396
<td data-supported="true">92+</td>
397397
<td data-supported="true">92+</td>
398398
<td data-supported="true">90+</td>
@@ -406,7 +406,7 @@
406406
<code>Crypto.randomUUID</code>
407407
</a>
408408
</th>
409-
<td data-polyfilled data-polyfill="cryptoRandomUUID"></td>
409+
<td data-polyfill="cryptoRandomUUID">*</td>
410410
<td data-supported="true">92+</td>
411411
<td data-supported="true">92+</td>
412412
<td data-supported="true">95+</td>
@@ -420,7 +420,7 @@
420420
<code>Element.replaceChildren</code>
421421
</a>
422422
</th>
423-
<td data-polyfilled data-polyfill="elementReplaceChildren"></td>
423+
<td data-polyfill="elementReplaceChildren">*</td>
424424
<td data-supported="true">86+</td>
425425
<td data-supported="true">86+</td>
426426
<td data-supported="true">78+</td>
@@ -434,7 +434,7 @@
434434
<code>EventTarget.addEventListener signal</code>
435435
</a>
436436
</th>
437-
<td data-polyfilled data-polyfill="eventAbortSignal"></td>
437+
<td data-polyfill="eventAbortSignal">*</td>
438438
<td data-supported="true">90+</td>
439439
<td data-supported="true">90+</td>
440440
<td data-supported="true">86+</td>
@@ -448,7 +448,7 @@
448448
<code>Object.hasOwn</code>
449449
</a>
450450
</th>
451-
<td data-polyfilled data-polyfill="objectHasOwn"></td>
451+
<td data-polyfill="objectHasOwn">*</td>
452452
<td data-supported="true">93+</td>
453453
<td data-supported="true">93+</td>
454454
<td data-supported="true">92+</td>
@@ -462,31 +462,21 @@
462462
<code>Promise.allSettled</code>
463463
</a>
464464
</th>
465-
<td data-polyfilled data-polyfill="promiseAllSettled"></td>
465+
<td data-polyfill="promiseAllSettled">*</td>
466466
<td data-supported="true">76+</td>
467467
<td data-supported="true">79+</td>
468468
<td data-supported="true">71+</td>
469469
<td data-supported="true">13+</td>
470-
</tr>
471-
<tr>
472-
<th>
473-
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/matchAll">
474-
<code>String.matchAll</code>
475-
</a>
476-
</th>
477-
<td data-code="'matchAll' in String.prototype"></td>
478-
<td data-supported="true">73+</td>
479-
<td data-supported="true">79+</td>
480-
<td data-supported="true">67+</td>
481-
<td data-supported="true">13+</td>
470+
<td data-supported="true">63+</td>
471+
<td data-supported="true">12.0+</td>
482472
</tr>
483473
<tr>
484474
<th>
485475
<a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback">
486476
<code>requestIdleCallback</code>
487477
</a>
488478
</th>
489-
<td data-polyfilled data-polyfill="promiseAllSettled"></td>
479+
<td data-polyfill="requestIdleCallback">*</td>
490480
<td data-supported="true">47+</td>
491481
<td data-supported="true">79+</td>
492482
<td data-supported="true">55+</td>
@@ -500,7 +490,7 @@
500490
<code>String.replaceAll</code>
501491
</a>
502492
</th>
503-
<td data-polyfilled data-polyfill="stringReplaceAll"></td>
493+
<td data-polyfill="stringReplaceAll">*</td>
504494
<td data-supported="true">85+</td>
505495
<td data-supported="true">85+</td>
506496
<td data-supported="true">77+</td>
@@ -514,13 +504,15 @@
514504
<code>Promise.any</code>
515505
</a>
516506
</th>
517-
<td data-polyfill="promiseAny"></td>
507+
<td data-polyfill="promiseAny">*</td>
518508
<td data-supported="true">85+</td>
519509
<td data-supported="true">85+</td>
520510
<td data-supported="true">79+</td>
521511
<td data-supported="true">14+</td>
512+
<td data-supported="false">*</td>
513+
<td data-supported="true">14.0+</td>
522514
</tr>
523-
<tr><th colspan="6">Native Syntax</th></tr>
515+
<tr><th colspan="8">Native Syntax</th></tr>
524516
<tr>
525517
<th>
526518
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Ranges#using_named_groups">
@@ -591,13 +583,14 @@
591583
<td data-supported="true">53+</td>
592584
<td data-supported="true">9.0+</td>
593585
</tr>
586+
<tr data-transpiled><th colspan="8">Transpiled Native Syntax</th></tr>
594587
<tr>
595588
<th>
596589
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining">
597590
<code>Optional Chaining Operator (?.)</code>
598591
</a>
599592
</th>
600-
<td data-code="window?.foo?.bar?.baz || true" data-transpiled></td>
593+
<td data-code="window?.foo?.bar?.baz || true">**</td>
601594
<td data-supported="true">80+</td>
602595
<td data-supported="true">80+</td>
603596
<td data-supported="true">74+</td>
@@ -611,7 +604,7 @@
611604
<code>Nullish Coalescing Operator (??)</code>
612605
</a>
613606
</th>
614-
<td data-code="window.foo ?? true" data-transpiled></td>
607+
<td data-code="window.foo ?? true">**</td>
615608
<td data-supported="true">80+</td>
616609
<td data-supported="true">80+</td>
617610
<td data-supported="true">72+</td>
@@ -625,7 +618,7 @@
625618
<code>Logical Nullish Assignment (??=)</code>
626619
</a>
627620
</th>
628-
<td data-code="let x; x ??= 1" data-transpiled></td>
621+
<td data-code="let x; x ??= 1">**</td>
629622
<td data-supported="true">85+</td>
630623
<td data-supported="true">85+</td>
631624
<td data-supported="true">79+</td>
@@ -636,10 +629,10 @@
636629
<tr>
637630
<th>
638631
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Public_class_fields#public_instance_fields">
639-
<code>Public Instance Class Fields</code>
632+
<code>Public Class Fields</code>
640633
</a>
641634
</th>
642-
<td data-code="class A{a=true};new A().a" data-transpiled></td>
635+
<td data-code="class A{a=true};new A().a">**</td>
643636
<td data-supported="true">72+</td>
644637
<td data-supported="true">79+</td>
645638
<td data-supported="true">69+</td>
@@ -653,7 +646,7 @@
653646
<code>Private Class Fields</code>
654647
</a>
655648
</th>
656-
<td data-code="class A{#a=true;get a(){return this.#a}};new A().a" data-transpiled></td>
649+
<td data-code="class A{#a=true;get a(){return this.#a}};new A().a">**</td>
657650
<td data-supported="true">74+</td>
658651
<td data-supported="true">79+</td>
659652
<td data-supported="true">90+</td>
@@ -667,7 +660,7 @@
667660
<code>Static Class Blocks</code>
668661
</a>
669662
</th>
670-
<td data-code="class A{static{this.a=true}};A.a" data-transpiled></td>
663+
<td data-code="class A{static{this.a=true}};A.a">**</td>
671664
<td data-supported="true">94+</td>
672665
<td data-supported="true">94+</td>
673666
<td data-supported="true">93+</td>
@@ -681,7 +674,7 @@
681674
<code>Decorators</code>
682675
</a>
683676
</th>
684-
<td data-code="function foo(cls){cls.a=true}@foo class A{};A.a" data-transpiled></td>
677+
<td data-code="function foo(cls){cls.a=true}@foo class A{};A.a">**</td>
685678
<td data-supported="false">**</td>
686679
<td data-supported="false">**</td>
687680
<td data-supported="false">**</td>
@@ -698,7 +691,7 @@
698691
</p>
699692
<p>
700693
<small>
701-
** This feature is used, but we Transpile it to a compatible syntax.
694+
** Not supported natively, but transpiled to a compatible syntax.
702695
</small>
703696
</p>
704697
<script>
@@ -728,11 +721,6 @@
728721
}
729722
Promise.resolve(supported).then((value) => {
730723
el.setAttribute('data-supported', Boolean(value))
731-
if (!value && el.hasAttribute('data-transpiled')) {
732-
if (!value) el.textContent = '**'
733-
} else if (!value && el.hasAttribute('data-polyfilled')) {
734-
if (!value) el.textContent = '*'
735-
}
736724
})
737725
}
738726
</script>
@@ -752,11 +740,6 @@
752740
}
753741
Promise.resolve(supported).then((value) => {
754742
el.setAttribute('data-supported', Boolean(value))
755-
if (!value && el.hasAttribute('data-transpiled')) {
756-
if (!value) el.textContent = '**'
757-
} else if (!value && el.hasAttribute('data-polyfilled')) {
758-
if (!value) el.textContent = '*'
759-
}
760743
})
761744
}
762745
for(const el of document.querySelectorAll('[data-polyfill]')) {
@@ -769,11 +752,6 @@
769752
}
770753
Promise.resolve(supported).then((value) => {
771754
el.setAttribute('data-supported', Boolean(value))
772-
if (!value && el.hasAttribute('data-transpiled')) {
773-
if (!value) el.textContent = '**'
774-
} else if (!value && el.hasAttribute('data-polyfilled')) {
775-
if (!value) el.textContent = '*'
776-
}
777755
})
778756
}
779757
</script>

0 commit comments

Comments
 (0)