SlideShare une entreprise Scribd logo
1  sur  53
Télécharger pour lire hors ligne
From the proposal to
ECMAScript
Step by step
@romulocintra
What’s Standards
BODY and TC39 ?
1
@romulocintra
They’re Avenues for
unification & uniformization
● WHATWG
● W3C
● ISO
● ECMA
● Unicode
● …
@romulocintra
TC39 is the
Technical committee
that defines the
JavaScript language
@romulocintra
Marvel Studios
13
Delegates
● Implementers (Apple, Google, Mozilla, Microsoft …)
● Big Companies (Sony, PayPal, Netflix)
● Students and NPF (Universities, OpenJS F …)
Invited Experts
● Subject matter experts
● Community representatives
Contributors, Editors, Reviewers & Community
Who are they ?
Glossary …
❏ ECMA
❏ ECMA-262 …
❏ ECMAScript
❏ JavaScript
❏ TC-XX (TC39 , TC45)
@romulocintra
How
TC39 works?
2
@romulocintra
Consensus-based decision
Diverse set of people in the committee
Implementers , Practitioners, Community Experts
Objections and concerns to satisfy everyone’s
No stakeholder kept over another and , Backing rationales
@romulocintra
STAGES
Steps where proposal evolves and receives
feedback
1 + 4 Stages
When
4-8 Plenary
Meetings a year
Online or In person
Focus Groups and Incubator
Calls
Monthly or Biweekly
TG2 / Editors / Outreach /
Proposals / Educators / Tools
Monthly or Biweekly
Where
Where
The Process
3 Stage-by-stage
@romulocintra
STAGE 0 💡
Strawperson
Just an Idea
Explainer, Idea under discussion,
Strawperson Proposal
@romulocintra
@romulocintra
STAGE 1
Describe the shape of a solution it’s an idea
under discussion
Proposal ��
Devote time and have a “Champion”
Demos / Polyfills
Major changes
25
STAGE 1
Decimal
Philip Chimento, Andrew Paprocki, Jesse
Alama
function calculateBill(items, tax) {
let total = 0m;
for (let {price, count} of items) {
total += price * BigDecimal(count);
}
return BigDecimal.round(total * (1m + tax),
{maximumFractionDigits: 2, round: "up"});
}
let items = [{price: 1.25m, count: 5}, {price: 5m, count: 1}];
let tax = .0735m;
console.log(calculateBill(items, tax));
STAGE 1
Pattern Matching
Daniel Rosenwasser, Jack Works, Jordan Harband,
Mark Cohen, Ross Kirsling, Tab Atkins-Bittner
match (res) {
when ({ status: 200, body, ...rest }): handleData(body, rest)
when ({ status, destination: url }) if (300 <= status && status < 400):
handleRedirect(url)
when ({ status: 500 }) if (!this.hasRetried): do {
retry(req);
this.hasRetried = true;
}
default: throwSomething();
}
// Using Combinators `and` , `or` , `with`
match (command) {
when ([ 'go', dir and ('north' or 'east' or 'south' or 'west')]): go(dir);
when ([ 'take', item and /[a-z]+ ball/ and { weight }]): take(item);
default: lookAround()
}
// Built-in custom matchers
match (value) {
when (${Number}): ...
when (${BigInt}): ...
when (${String}): ...
when (${Array}): ...
default: ...
}
STAGE 1
Types Annotations
Daniel Rossenwaver, Rob Palmer,
Romulo Cintra
Optional ergonomic type annotations in JavaScript code
Types that don’t change JavaScript semantics
Direct execution of statically typed code
✅
✅
✅
Independent evolution of JavaScript and type-checkers
✅
Runtime effects
100% Compatible with TS, Flow…
❌
❌
@romulocintra
STAGE 2 Draft ��
Describe syntactic and semantic details
Form spec language - Initial Spec Text
Semantics and API are covered - not completed
TC39 Expects that feature would be developed in future
Experimental
@romulocintra
STAGE 2
Record & Tuple
Robin Ricard, Rick Button
const record = #{ prop: 1 };
const tuple = #[1, 2, 3];
// Simple Equality
#{ a: 1 } === #{ a:1 } // or #[1] === #[1]
// Nested Equality
#{ a: #{ b: 123 }} === #{ a: #{ b: 123 }}
// Order Independent
#{ a: 1, b: 2 } === #{ b: 2, a: 1}
@romulocintra
STAGE 3 Candidate ��
Refinement phase(Feedback from
implementers and users), almost ready to go
Completed Spec Text
Have Reviewers and Editors Signed off the spec
Coverage on Test262
Spec Compliant
Some browser might implement under a flag
Test262(Report)
STAGE 3 Intl.DurationFormat
Younies Mahmoud, Ujjwal Sharma
new Intl.DurationFormat("fr-FR", { style: "long" }).format({
hours: 1,
minutes: 46,
seconds: 40,
});
// => "1 heure, 46 minutes et 40 secondes"
STAGE 3 Temporal
Philipp Dunkel , Maggie Johnson-Pint,
Matt Johnson-Pint, Brian Terlson, Shane
Carr, Ujjwal Sharma, Philip Chimento,
Jason Williams, Justin Grant
const yearMonth = Temporal.PlainYearMonth.from({ year: 2020, month: 10 });
yearMonth.toString() => 2020-10
yearMonth.daysInMonth; // => 31
yearMonth.daysInYear; // => 366
const monthDay = Temporal.PlainMonthDay.from({ month: 7, day: 14 });
const date = monthDay.toPlainDate({ year: 2030 });
date.dayOfWeek; // => 7
date.dayOfYear // => 195
date.daysInMonth // => 31
date.daysInYear // => 365
date.inLeapYear // => false
let calcDate = Temporal.Now.plainDateISO(); // => 2021-11-29
calcDate.add({ days : 15 }); // => 2021-12-14
calcDate.subtract({ days : 15 }); // => 2021-11-14
calcDate.equals(calcDate); // => true
calcDate.equals(calcDate.add({ days : 2})); // => false
const time = Temporal.Instant.fromEpochSeconds(new Date);
Temporal.TimeZone.from('Europe/Berlin').getOffsetStringFor(time);
// => +01:00
Temporal.TimeZone.from('America/Vancouver').getOffsetStringFor(time);
// => -08:00
Temporal.TimeZone.from('Europe/Moscow').getOffsetStringFor(time);
// => +03:00
@romulocintra
STAGE 4 Finished ��
About to be include in the upcoming edition
of ECMAScript®
Merged into the Spec text
Two implementations that passes acceptance tests
Will be included on the upcoming Spec
Shipping
STAGE 4 NumberFormatV3*
Shane Carr
const nf = new Intl.NumberFormat("en-US", {
style: "currency",
currency: "CHF",
maximumFractionDigits: 0,
});
nf.formatRange(3, 5); // "CHF 3–5"
STAGE 4 Change array by Copy
^
Robin Ricard, Ashley Claymore
const sequence = [1, 2, 3];
sequence.toReversed(); // => [3, 2, 1]
sequence; // => [1, 2, 3]
const outOfOrder = new Uint8Array([3, 1, 2]);
outOfOrder.toSorted(); // => Uint8Array [1, 2, 3]
outOfOrder; // => Uint8Array [3, 1, 2]
const correctionNeeded = [1, 1, 3];
correctionNeeded.with(1, 2); // => [1, 2, 3]
correctionNeeded; // => [1, 1, 3]
Error: .cause Class Fields,
Private Instance
fields & methods…
.at()
Object: .hasOwn()
Intl.Segmenter
ECMAScript 2023
ES.next
June 2023
Collaboration & Help
Get involved !!!
4
@romulocintra
Write test262 conformance tests
Refine proposals in GitHub issues
Write documentation and
educational materials
Provide feedback on GitHub
��
��
��
��
Muchas Gracias
Thanks
Obrigado
Спасибо
@romulocintra

Contenu connexe

Similaire à From the proposal to ECMAScript – Step by Step

Data Science Challenge presentation given to the CinBITools Meetup Group
Data Science Challenge presentation given to the CinBITools Meetup GroupData Science Challenge presentation given to the CinBITools Meetup Group
Data Science Challenge presentation given to the CinBITools Meetup Group
Doug Needham
 
Running Intelligent Applications inside a Database: Deep Learning with Python...
Running Intelligent Applications inside a Database: Deep Learning with Python...Running Intelligent Applications inside a Database: Deep Learning with Python...
Running Intelligent Applications inside a Database: Deep Learning with Python...
Miguel González-Fierro
 
Drools New York City workshop 2011
Drools New York City workshop 2011Drools New York City workshop 2011
Drools New York City workshop 2011
Geoffrey De Smet
 

Similaire à From the proposal to ECMAScript – Step by Step (20)

R getting spatial
R getting spatialR getting spatial
R getting spatial
 
10. R getting spatial
10.  R getting spatial10.  R getting spatial
10. R getting spatial
 
Business Dashboards using Bonobo ETL, Grafana and Apache Airflow
Business Dashboards using Bonobo ETL, Grafana and Apache AirflowBusiness Dashboards using Bonobo ETL, Grafana and Apache Airflow
Business Dashboards using Bonobo ETL, Grafana and Apache Airflow
 
Real_World_0days.pdf
Real_World_0days.pdfReal_World_0days.pdf
Real_World_0days.pdf
 
Appcelerator droidcon15 TLV
Appcelerator droidcon15 TLVAppcelerator droidcon15 TLV
Appcelerator droidcon15 TLV
 
Economies of Scaling Software
Economies of Scaling SoftwareEconomies of Scaling Software
Economies of Scaling Software
 
Refactoring at Large
Refactoring at LargeRefactoring at Large
Refactoring at Large
 
Cloudera Data Science Challenge
Cloudera Data Science ChallengeCloudera Data Science Challenge
Cloudera Data Science Challenge
 
Data Science Challenge presentation given to the CinBITools Meetup Group
Data Science Challenge presentation given to the CinBITools Meetup GroupData Science Challenge presentation given to the CinBITools Meetup Group
Data Science Challenge presentation given to the CinBITools Meetup Group
 
Running Intelligent Applications inside a Database: Deep Learning with Python...
Running Intelligent Applications inside a Database: Deep Learning with Python...Running Intelligent Applications inside a Database: Deep Learning with Python...
Running Intelligent Applications inside a Database: Deep Learning with Python...
 
Standardizing JavaScript Decorators in TC39 (Full Stack Fest 2019)
Standardizing JavaScript Decorators in TC39 (Full Stack Fest 2019)Standardizing JavaScript Decorators in TC39 (Full Stack Fest 2019)
Standardizing JavaScript Decorators in TC39 (Full Stack Fest 2019)
 
The State of JavaScript (2015)
The State of JavaScript (2015)The State of JavaScript (2015)
The State of JavaScript (2015)
 
Jsr310
Jsr310Jsr310
Jsr310
 
Beyond PHP - it's not (just) about the code
Beyond PHP - it's not (just) about the codeBeyond PHP - it's not (just) about the code
Beyond PHP - it's not (just) about the code
 
How to Apply Design Principles in Practice
How to Apply Design Principles in PracticeHow to Apply Design Principles in Practice
How to Apply Design Principles in Practice
 
Drools New York City workshop 2011
Drools New York City workshop 2011Drools New York City workshop 2011
Drools New York City workshop 2011
 
Practical Magic with Incanter
Practical Magic with IncanterPractical Magic with Incanter
Practical Magic with Incanter
 
Java 8 Date and Time API
Java 8 Date and Time APIJava 8 Date and Time API
Java 8 Date and Time API
 
(Ab)using 4d Indexing
(Ab)using 4d Indexing(Ab)using 4d Indexing
(Ab)using 4d Indexing
 
FluentMigrator - Dayton .NET - July 2023
FluentMigrator - Dayton .NET - July 2023FluentMigrator - Dayton .NET - July 2023
FluentMigrator - Dayton .NET - July 2023
 

Plus de Igalia

Building End-user Applications on Embedded Devices with WPE
Building End-user Applications on Embedded Devices with WPEBuilding End-user Applications on Embedded Devices with WPE
Building End-user Applications on Embedded Devices with WPE
Igalia
 
Automated Testing for Web-based Systems on Embedded Devices
Automated Testing for Web-based Systems on Embedded DevicesAutomated Testing for Web-based Systems on Embedded Devices
Automated Testing for Web-based Systems on Embedded Devices
Igalia
 
Running JS via WASM faster with JIT
Running JS via WASM      faster with JITRunning JS via WASM      faster with JIT
Running JS via WASM faster with JIT
Igalia
 
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por IgaliaIntroducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Igalia
 

Plus de Igalia (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Building End-user Applications on Embedded Devices with WPE
Building End-user Applications on Embedded Devices with WPEBuilding End-user Applications on Embedded Devices with WPE
Building End-user Applications on Embedded Devices with WPE
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Automated Testing for Web-based Systems on Embedded Devices
Automated Testing for Web-based Systems on Embedded DevicesAutomated Testing for Web-based Systems on Embedded Devices
Automated Testing for Web-based Systems on Embedded Devices
 
Embedding WPE WebKit - from Bring-up to Maintenance
Embedding WPE WebKit - from Bring-up to MaintenanceEmbedding WPE WebKit - from Bring-up to Maintenance
Embedding WPE WebKit - from Bring-up to Maintenance
 
Optimizing Scheduler for Linux Gaming.pdf
Optimizing Scheduler for Linux Gaming.pdfOptimizing Scheduler for Linux Gaming.pdf
Optimizing Scheduler for Linux Gaming.pdf
 
Running JS via WASM faster with JIT
Running JS via WASM      faster with JITRunning JS via WASM      faster with JIT
Running JS via WASM faster with JIT
 
To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!
 
Implementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamerImplementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamer
 
8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in Mesa8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in Mesa
 
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por IgaliaIntroducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
 
2023 in Chimera Linux
2023 in Chimera                    Linux2023 in Chimera                    Linux
2023 in Chimera Linux
 
Building a Linux distro with LLVM
Building a Linux distro        with LLVMBuilding a Linux distro        with LLVM
Building a Linux distro with LLVM
 
turnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUsturnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUs
 
Graphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devicesGraphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devices
 
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOSDelegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
 
MessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the webMessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the web
 
Replacing the geometry pipeline with mesh shaders
Replacing the geometry pipeline with mesh shadersReplacing the geometry pipeline with mesh shaders
Replacing the geometry pipeline with mesh shaders
 
I'm not an AMD expert, but...
I'm not an AMD expert, but...I'm not an AMD expert, but...
I'm not an AMD expert, but...
 
Status of Vulkan on Raspberry
Status of Vulkan on RaspberryStatus of Vulkan on Raspberry
Status of Vulkan on Raspberry
 

Dernier

Dernier (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 

From the proposal to ECMAScript – Step by Step

  • 1. From the proposal to ECMAScript Step by step @romulocintra
  • 3. @romulocintra They’re Avenues for unification & uniformization ● WHATWG ● W3C ● ISO ● ECMA ● Unicode ● …
  • 4. @romulocintra TC39 is the Technical committee that defines the JavaScript language
  • 6. 13 Delegates ● Implementers (Apple, Google, Mozilla, Microsoft …) ● Big Companies (Sony, PayPal, Netflix) ● Students and NPF (Universities, OpenJS F …) Invited Experts ● Subject matter experts ● Community representatives Contributors, Editors, Reviewers & Community Who are they ?
  • 7. Glossary … ❏ ECMA ❏ ECMA-262 … ❏ ECMAScript ❏ JavaScript ❏ TC-XX (TC39 , TC45) @romulocintra
  • 9. @romulocintra Consensus-based decision Diverse set of people in the committee Implementers , Practitioners, Community Experts Objections and concerns to satisfy everyone’s No stakeholder kept over another and , Backing rationales
  • 10. @romulocintra STAGES Steps where proposal evolves and receives feedback 1 + 4 Stages
  • 11. When 4-8 Plenary Meetings a year Online or In person Focus Groups and Incubator Calls Monthly or Biweekly TG2 / Editors / Outreach / Proposals / Educators / Tools Monthly or Biweekly
  • 12. Where
  • 13. Where
  • 15. @romulocintra STAGE 0 💡 Strawperson Just an Idea Explainer, Idea under discussion, Strawperson Proposal
  • 17. @romulocintra STAGE 1 Describe the shape of a solution it’s an idea under discussion Proposal �� Devote time and have a “Champion” Demos / Polyfills Major changes
  • 18. 25
  • 19. STAGE 1 Decimal Philip Chimento, Andrew Paprocki, Jesse Alama
  • 20. function calculateBill(items, tax) { let total = 0m; for (let {price, count} of items) { total += price * BigDecimal(count); } return BigDecimal.round(total * (1m + tax), {maximumFractionDigits: 2, round: "up"}); } let items = [{price: 1.25m, count: 5}, {price: 5m, count: 1}]; let tax = .0735m; console.log(calculateBill(items, tax));
  • 21. STAGE 1 Pattern Matching Daniel Rosenwasser, Jack Works, Jordan Harband, Mark Cohen, Ross Kirsling, Tab Atkins-Bittner
  • 22. match (res) { when ({ status: 200, body, ...rest }): handleData(body, rest) when ({ status, destination: url }) if (300 <= status && status < 400): handleRedirect(url) when ({ status: 500 }) if (!this.hasRetried): do { retry(req); this.hasRetried = true; } default: throwSomething(); }
  • 23. // Using Combinators `and` , `or` , `with` match (command) { when ([ 'go', dir and ('north' or 'east' or 'south' or 'west')]): go(dir); when ([ 'take', item and /[a-z]+ ball/ and { weight }]): take(item); default: lookAround() }
  • 24. // Built-in custom matchers match (value) { when (${Number}): ... when (${BigInt}): ... when (${String}): ... when (${Array}): ... default: ... }
  • 25. STAGE 1 Types Annotations Daniel Rossenwaver, Rob Palmer, Romulo Cintra
  • 26.
  • 27.
  • 28.
  • 29. Optional ergonomic type annotations in JavaScript code Types that don’t change JavaScript semantics Direct execution of statically typed code ✅ ✅ ✅ Independent evolution of JavaScript and type-checkers ✅
  • 30. Runtime effects 100% Compatible with TS, Flow… ❌ ❌
  • 31. @romulocintra STAGE 2 Draft �� Describe syntactic and semantic details Form spec language - Initial Spec Text Semantics and API are covered - not completed TC39 Expects that feature would be developed in future Experimental
  • 33. STAGE 2 Record & Tuple Robin Ricard, Rick Button
  • 34. const record = #{ prop: 1 }; const tuple = #[1, 2, 3]; // Simple Equality #{ a: 1 } === #{ a:1 } // or #[1] === #[1] // Nested Equality #{ a: #{ b: 123 }} === #{ a: #{ b: 123 }} // Order Independent #{ a: 1, b: 2 } === #{ b: 2, a: 1}
  • 35. @romulocintra STAGE 3 Candidate �� Refinement phase(Feedback from implementers and users), almost ready to go Completed Spec Text Have Reviewers and Editors Signed off the spec Coverage on Test262 Spec Compliant Some browser might implement under a flag
  • 37.
  • 38. STAGE 3 Intl.DurationFormat Younies Mahmoud, Ujjwal Sharma
  • 39. new Intl.DurationFormat("fr-FR", { style: "long" }).format({ hours: 1, minutes: 46, seconds: 40, }); // => "1 heure, 46 minutes et 40 secondes"
  • 40. STAGE 3 Temporal Philipp Dunkel , Maggie Johnson-Pint, Matt Johnson-Pint, Brian Terlson, Shane Carr, Ujjwal Sharma, Philip Chimento, Jason Williams, Justin Grant
  • 41. const yearMonth = Temporal.PlainYearMonth.from({ year: 2020, month: 10 }); yearMonth.toString() => 2020-10 yearMonth.daysInMonth; // => 31 yearMonth.daysInYear; // => 366 const monthDay = Temporal.PlainMonthDay.from({ month: 7, day: 14 }); const date = monthDay.toPlainDate({ year: 2030 }); date.dayOfWeek; // => 7 date.dayOfYear // => 195 date.daysInMonth // => 31 date.daysInYear // => 365 date.inLeapYear // => false
  • 42. let calcDate = Temporal.Now.plainDateISO(); // => 2021-11-29 calcDate.add({ days : 15 }); // => 2021-12-14 calcDate.subtract({ days : 15 }); // => 2021-11-14 calcDate.equals(calcDate); // => true calcDate.equals(calcDate.add({ days : 2})); // => false
  • 43. const time = Temporal.Instant.fromEpochSeconds(new Date); Temporal.TimeZone.from('Europe/Berlin').getOffsetStringFor(time); // => +01:00 Temporal.TimeZone.from('America/Vancouver').getOffsetStringFor(time); // => -08:00 Temporal.TimeZone.from('Europe/Moscow').getOffsetStringFor(time); // => +03:00
  • 44. @romulocintra STAGE 4 Finished �� About to be include in the upcoming edition of ECMAScript® Merged into the Spec text Two implementations that passes acceptance tests Will be included on the upcoming Spec Shipping
  • 46. const nf = new Intl.NumberFormat("en-US", { style: "currency", currency: "CHF", maximumFractionDigits: 0, }); nf.formatRange(3, 5); // "CHF 3–5"
  • 47. STAGE 4 Change array by Copy ^ Robin Ricard, Ashley Claymore
  • 48. const sequence = [1, 2, 3]; sequence.toReversed(); // => [3, 2, 1] sequence; // => [1, 2, 3] const outOfOrder = new Uint8Array([3, 1, 2]); outOfOrder.toSorted(); // => Uint8Array [1, 2, 3] outOfOrder; // => Uint8Array [3, 1, 2] const correctionNeeded = [1, 1, 3]; correctionNeeded.with(1, 2); // => [1, 2, 3] correctionNeeded; // => [1, 1, 3]
  • 49. Error: .cause Class Fields, Private Instance fields & methods… .at() Object: .hasOwn() Intl.Segmenter
  • 51. Collaboration & Help Get involved !!! 4
  • 52. @romulocintra Write test262 conformance tests Refine proposals in GitHub issues Write documentation and educational materials Provide feedback on GitHub �� �� �� ��