paint tim­ing API

Web Designer - - Javascript in 2019 -

Per­for­mance will be a big fo­cus in 2019. Get­ting file sizes down can help, but there is more to per­for­mance than what gets down­loaded to the browser. The browser ‘paints’ its con­tents on­screen ev­ery time some­thing changes. Un­til that first paint hap­pens, users will be left star­ing at a blank screen. When it gets hung up in other de­tails, such as down­load­ing as­sets or pro­cess­ing Javascript, the time to that first paint can take longer.

The Paint Tim­ing API keeps de­tailed in­for­ma­tion on two events – the first paint and the first ‘con­tent­ful’ paint, which refers to some­thing more than just styling, such as text or an im­age.

The Per­for­manceob­server in­ter­face de­scribes what to do when these events oc­cur. This can then be used to send the data to a server for anal­y­sis later on.

Right now, this is only avail­able in Chrome and Opera, but other browsers such as Edge and Sa­fari have both shown an in­ter­est and will pos­si­bly in­clude it in the fu­ture. • w3.org/tr/paint-tim­ing

Newspapers in English

Newspapers from UK

© PressReader. All rights reserved.