— Brian Moeskau (@bmoeskau)
— Ben Lesh (@benlesh)
Released April 25
useOptimistic
/ useActionState
/ useFormStatus
use
APIReleased May 21
Fine-grained reactivity goes fullstack
Web platform features that are ready to use in your projects today.
How do features become Baseline?
* Chrome / Firefox (desktop + Android), Safari (macOS + iOS), Edge
Intl.Segmenter
Baseline Available as of April 16
Locale-sensitive text segmentation to split a string into words, sentences, or graphemes.
const segmenter = new Intl.Segmenter('en', { granularity: 'word' });
const segments = segmenter.segment('This has four words!');
Array.from(segments).map((segment) => segment.segment);
// ['This', ' ', 'has', ' ', 'four', ' ', 'words', '!']
Intl.Segmenter
Baseline Available as of April 16
Handy for parsing other locales easily:
const segmenter = new Intl.Segmenter('ja', { granularity: 'word' });
const segments = segmenter.segment('これは日本語のテキストです');
Array.from(segments).map((segment) => segment.segment);
// ['これ', 'は', '日本語', 'の', 'テキスト', 'です']
light-dark()
Baseline Available as of May 13
Previously, only built-in system
colors could react to color-scheme
changes:
:root {
color-scheme: dark;
}
body {
background-color: Canvas;
}
a {
color: LinkText;
}
light-dark()
Baseline Available as of May 13
Now custom classes can also react to color-scheme
(simplifies the prefers-color-dark
approach):
:root {
color-scheme: light dark;
--primary-color: light-dark(#333, #fafafa);
--primary-background: light-dark(#e4e4e4, #121212);
--highlight-color: light-dark(hotpink, lime);
}
Baseline Available as of May 14
Control a device's screen wake behavior, ensuring uninterrupted interactions with web applications.
Use cases:
Baseline Available as of May 14
let wakeLock = null;
const requestWakeLock = async () => {
try {
wakeLock = await navigator.wakeLock.request();
wakeLock.addEventListener('release', () => {
// do something after released
});
}
};
await requestWakeLock();
// release it some time later:
wakeLock.release();
Baseline Available as of May 14
Transform a given value according to another step value.
// rounding:
font-size: round(nearest, var(--my-font-size), 1rem);
opacity: round(.56, 0.1); /* 0.6 */
// remainder:
margin: rem(18px, 5px); /* 3px */
Announced May 14
See the entire web platform mapped as a set of features, along with their support in browsers.
TEXTAREA incorrectly applying ROWS= and COLS= (horizontal / vertical scrollbar extra space, with overlay scrollbars disabled)
Published May 8
scroll-timeline
Brian Moeskau