What’s new in Chromium 63 and Opera 50
Opera 50 (based on Chromium 63) for Mac, Windows, Linux is out! To find out what’s new for users, see our Desktop blog post. Here’s what it means for web developers.
Dynamic module imports
New JavaScript module import syntax allows developers to dynamically load code into modules and scripts at runtime. This makes it possible to load parts of an application lazily, which can be used to improve application start-up time or to avoid loading seldom used parts until they are actually needed.
button.addEventListener('click', event => {
import('./dialogBox.js')
.then(dialogBox => {
dialogBox.open();
})
.catch(error => {
/* Error handling */
});
});
The code example above shows how to use the import(specifier) function to import JavaScript after an event.
Async iterators and generators
Asynchronous iteration is made more convenient with the addition of asynchronous generator functions
async function* generateAsync() {
while(condition) {
const an_object = await produceAnObject();
yield an_object.some_property;
}
}
and the asynchronous iteration protocol
for await (const item of generateAsync()) {
console.log({ item });
}
Read more about this syntax and its possibilites on Jake Archibald’s blog or in this summary of the “Asynchronous Iteration” proposal.
Device Memory API
Using the new Device Memory API developers can estimate the total amount of RAM on the device. This information could be used to deliver a suitably scaled version of the site to lower-end devices, or help put collected performance data into context to better understand the behavior of a web application.
Other web platform features in this release
Blink > CSS
- Developers can now make pixel-level adjustments using the new Q length unit, which is especially useful on small viewports.
Blink > Fonts
- font-variant-east-asian is now supported, allowing developers to control the usage of alternate glyphs for East Asian languages like Japanese and Chinese.
Blink > HTML
- To improve interoperability, Opera will fire
beforeprint
andafterprint
events as part of the printing standard, allowing developers to annotate the printed copy and edit the annotation after the printing command is done executing.
Blink > JavaScript
- Using
Promise.prototype.finally()
, a callback can now be registered to be invoked after aPromise
has been either fulfilled or rejected. - The
Intl.PluralRules
API allows developers to build applications that understand pluralization of a given language by indicating which plural form applies for a given number and language.
Blink > MediaStream
MediaStreamTrack.applyConstraints()
is now supported for local videoMediaStreamTracks
, including tracks obtained fromgetUserMedia()
, capture from media elements or screen capture.
Blink > Network
- Version 2 of NT LAN Manager (NTLM) API is now shipped, enabling applications to authenticate remote users and provide session security when requested by the application.
Blink > Storage
- The localStorage and sessionStorage APIs now use
getItem()
rather than an anonymous getter, so attempting to access a key usinggetItem()
will now returnnull
rather thanundefined
. Thanks to Intel for the contribution! - To improve developer experience, the methods on sessionStorage and localStorage such as
getItem()
,removeItem()
, andclear()
are now enumerable. Thanks to Intel for making this happen!
Deprecations and interoperability improvements
Blink > Bindings
- To improve interoperability, a TypeError is now thrown by
EventTarget.addEventListener()
andEventTarget.removeEventListener()
when the callback argument is not anEventListener
,null
, orundefined
. - Also to improve interoperability, instance properties with a
Promise
type now return a rejected promise instead of throwing an exception when the property access fails.
Blink > CSS
- The
/deep/
or>>>
selector, as well as::shadow
, are now removed from CSS dynamic profile, following their deprecation in Opera 32 / Chromium 45.
Blink > DOM
- To improve interoperability,
HTMLAllCollection
,HTMLCollection
,HTMLFormControlsCollection
andHTMLOptionsCollection
are no longer enumerable, so they are now left out of calls toObject.keys()
orfor-in
loops.
What’s next?
If you’re interested in experimenting with features that are in the pipeline for future versions of Opera, we recommend following our Opera Developer stream.