V8 release v9.9

Published · Tagged with release

Every four weeks, we create a new branch of V8 as part of our release process. Each version is branched from V8’s Git main immediately before a Chrome Beta milestone. Today we’re pleased to announce our newest branch, V8 version 9.9, which is in beta until its release in coordination with Chrome 99 Stable in several weeks. V8 v9.9 is filled with all sorts of developer-facing goodies. This post provides a preview of some of the highlights in anticipation of the release.

JavaScript #

Intl.Locale extensions #

In v7.4 we launched the Intl.Locale API. With v9.9, we added seven new properties to the Intl.Locale object: calendars, collations, hourCycles, numberingSystems, timeZones, textInfo, and weekInfo.

The calendars, collations, hourCycles, numberingSystems, and timeZones property of Intl.Locale return an array of preferred identifiers of those in common use, designed to be use with other Intl API:

const arabicEgyptLocale = new Intl.Locale('ar-EG')
// ar-EG
// ['gregory', 'coptic', 'islamic', 'islamic-civil', 'islamic-tbla']
// ['compat', 'emoji', 'eor']
// ['h12']
// ['arab']
// ['Africa/Cairo']

The textInfo property of Intl.Locale returns an object to specify the information related to text. Currently it only has one property, direction, to indicate default directionality for text in the locale. It is designed to be used for HTML dir attribute and CSS direction property. It indicates the ordering of characters - ltr (left-to-right) or rtl (right-to-left):

// { direction: 'rtl' }
// { direction: 'ltr' }
// { direction: 'ltr' }

The weekInfo property of Intl.Locale returns an object to specify the information related to week. The firstDay property in the return object is a number, ranging from 1 to 7, indicating which day of the week is considered the first day, for calendar purposes. 1 specifies Monday, 2 - Tuesday, 3 - Wednesday, 4 - Thursday, 5 - Friday, 6 - Saturday, and 7 - Sunday. The minimalDays property in the return object is the minimum days required in the first week of a month or year, for calendar purposes. The weekend property in the return object is an array of integers, usually with two elements, encoded the same as firstDay. It indicates which days of the week are considered as part of the 'weekend', for calendar purposes. Notice that the number of days in the weekend are different in each locale and may not be contiguous.

// {firstDay: 6, weekend: [5, 6], minimalDays: 1}
// First day of the week is Saturday. Weekend is Friday and Saturday.
// The first week of a month or a year is a week which has at least 1
// day in that month or year.

Intl Enumeration #

In v9.9, we added a new function Intl.supportedValuesOf(code) that returns the array of supported identifiers in v8 for the Intl APIs. The supported code values are calendar, collation, currency,numberingSystem, timeZone, and unit. The information in this new method is designed to allow web developers to easily discover which value is supported by the implementation.

// ['buddhist', 'chinese', 'coptic', 'dangi', ...]

// ['big5han', 'compat', 'dict', 'emoji', ...]

// ['ADP', 'AED', 'AFA', 'AFN', 'ALK', 'ALL', 'AMD', ...]

// ['adlm', 'ahom', 'arab', 'arabext', 'bali', ...]

// ['Africa/Abidjan', 'Africa/Accra', 'Africa/Addis_Ababa', 'Africa/Algiers', ...]

// ['acre', 'bit', 'byte', 'celsius', 'centimeter', ...]

V8 API #

Please use git log branch-heads/9.8..branch-heads/9.9 include/v8\*.h to get a list of the API changes.

Developers with an active V8 checkout can use git checkout -b 9.9 -t branch-heads/9.9 to experiment with the new features in V8 v9.9. Alternatively you can subscribe to Chrome’s Beta channel and try the new features out yourself soon.