Soon We Can Banish JavaScript to the ShadowRealm

TC39에서 제안 중인 ShadowRealm API는 JavaScript 실행 환경인 realm의 새로운 형태로, 별도의 스레드를 사용하지 않고도 코드 격리를 가능하게 한다. ShadowRealm은 독립적인 전역 객체와 내장 객체를 가지며, 메인 스레드에서 실행되지만 외부 realm과 전역 상태를 공유하지 않아 전역 오염 문제를 해결할 수 있다. 이를 통해 테스트 격리, 서드파티 코드 분리 등 다양한 활용이 기대되며, 현재는 표준이나 브라우저에 구현되지 않은 이론적 개념이다.

https://css-tricks.com/soon-we-can-finally-banish-javascript-to-the-shadowrealm/

#javascript #tc39 #shadowrealm #realm #isolation

Soon We Can Finally Banish JavaScript to the ShadowRealm | CSS-Tricks

The proposed ShadowRealm API introduces a new kind of realm specifically designed for isolation, and only that.

CSS-Tricks

Why is ` not allowed in JS object property definitions.

const a = { `thing`: `value` } // OH NO ERROR!

Why???

const a = {};
a[`thing`] = `value // THIS IS COOL!

const a= `thing`;
const b = { [a]: `value` } // THIS IS ALSO COOL!!

... are strings just too hard, #tc39

🤣 Ah, the elusive quest to cancel a #JavaScript promise—like trying to "unsubscribe" from those pesky emails, except sometimes a mysterious force lets you do it. 🤦‍♂️ TC39's valiant crusade for #cancellation ended in a Shakespearean tragedy of "to cancel, or not to cancel." Spoiler: you're still stuck with dangling promises and digital clutter. 📧🔄
https://www.inngest.com/blog/hanging-promises-for-control-flow #Promise #TC39 #TechHumor #DigitalClutter #ProgrammerLife #HackerNews #ngated
You can't cancel a JavaScript promise (except sometimes you can) - Inngest Blog

A promise that never resolves is a surprisingly clean way to interrupt an async function.

🌗 Temporal:修正 JavaScript 時間問題的九年征程
➤ JavaScript 時間處理的革新之路:從 Date 物件的困境到 Temporal 的崛起
https://bloomberg.github.io/js-blog/post/temporal/
JavaScript 的 `Date` 物件自 1995 年從 Java 移植以來,因其可變性、月份計算不一致及日期字串解析模糊等問題,長期困擾著開發者。隨著網路應用日益複雜,開發者轉向使用 Moment.js 等第三方函式庫以彌補 `Date` 的不足,這些函式庫雖提供不可變性與豐富功能,卻也因需打包大量語系和時區資料而導致應用程式體積膨脹。為瞭解決此核心問題,Moment.js 維護者 Maggie Johnson-Pint 於 2017 年向 TC39 提出「Temporal」提案,旨在提供一個全新的、不可變且具備第一類時區與日曆支援的日期時間 API。此提案迅速獲得肯定並進入第一階段,目前由多方專家(包括 Bloo
#JavaScript #Temporal #TC39 #時間處理 #軟體工程 #標準化
Temporal: The 9-Year Journey to Fix Time in JavaScript

JavaScript's Date object has been a source of bugs for three decades. Temporal, which just reached Stage 4, is a modern replacement with immutable types, first-class time zone and calendar support, and nanosecond precision. This is the story of how Bloomberg, Igalia, and the TC39 community spent nine years turning an idea into a shipping standard.

Bloomberg JS Blog

I feel like the currently-proposed TC39 Observables lacking some value that can be supplied upon "completion" is a mistake.

#RxJS #Observables #TC39 #ECMA262

Am I the only one to think that it's good that cancellable promises never made it into any specs whatsoever?

#JavaScript #ECMAScript #ECMA262 #TC39

Getting information about the status of #TC39 proposals is a horrible process: As a developer, I want to know how far along the "Pattern matching" feature is.

So I google "TC39 Pattern Matching". First result is this GitHub repo: https://github.com/tc39/proposal-pattern-matching. It says in the readme "Status: Stage 1" (I assume that's not true anymore). So I check the official "proposals" repo (https://github.com/tc39/proposals), and search for "pattern": Nothing, no results at all. I guess they only track Stage 2.

GitHub - tc39/proposal-pattern-matching: Pattern matching syntax for ECMAScript

Pattern matching syntax for ECMAScript. Contribute to tc39/proposal-pattern-matching development by creating an account on GitHub.

GitHub
そういえばEcma InternationalのTC39-TG5、つまりJSの規格を決めてる方々が主催のワークショップにご招待いただきました。「でもEcmaのEってEuropeでしょ、遠いよね?」という方、ご心配なく。Internationalに東京で開催する会です。しかもむっちゃ駅チカな丸ビル。
規格に詳しい方々にダメ出しを大量にいただく覚悟ですが、ともかくよろしくお願いします。 #tc39
https://github.com/tc39/tg5/blob/main/workshops/2025/111.md
tg5/workshops/2025/111.md at main · tc39/tg5

TC39-TG5: Experiments in programming language standardization. https://ecma-international.org/task-groups/tc39-tg5/ - tc39/tg5

GitHub

Every so often I get an email notification from some starred bug report about TC39 decorators, and I peek at what's going on, and it seems like the current situation is that it's fully standardized but all 3 browsers went "This is complicated and we don't feel like implementing it" 😞

#JavaScript #Decorators #TC39

Promise.try: единый вход для sync/async и единая обработка ошибок

Привет, Хабр! Не раз ловил себя на том, как в код-ревью всплывает одна и та же проблема: часть наших функций синхронные, часть асинхронные, а часть ведут себя как шрёдингеровские коты и делают вид, что синхронны, пока не дотронешься. В итоге в одном месте у нас try/catch, в другом .catch , где-то внезапно падает исключение, а в соседнем модуле молча утекает Promise. С появлением нативного Promise.try стало проще навести порядок и избавиться от разнобоя. Фича прошла процесс стандартизации в TC39 и включена в спецификацию ECMAScript 2026, при этом уже с января доступна в актуальных движках. Можно перестать спорить про обёртку из Promise.resolve().then и получить единый вход для sync/async с нормальной обработкой ошибок.

https://habr.com/ru/companies/otus/articles/940298/

#js #Promisetry #JavaScript #ECMAScript_2026 #TC39 #синхронный_код #асинхронный_код

Promise.try: единый вход для sync/async и единая обработка ошибок

Привет, Хабр! Не раз ловил себя на том, как в код‑ревью всплывает одна и та же проблема: часть наших функций синхронные, часть асинхронные, а часть ведут себя...

Хабр