home.social

#ecmascript — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #ecmascript, aggregated by home.social.

fetched live
  1. The global object in browsers, window, has ~229 enumerable properties (in Firefox in an empty document). So `{ ...window }` gives you a huge object. `document` in contrast only has one enumerable property, `location`, so `{ ...document }` is small.
    #ECMAScript

  2. The global object in browsers, window, has ~229 enumerable properties (in Firefox in an empty document). So `{ ...window }` gives you a huge object. `document` in contrast only has one enumerable property, `location`, so `{ ...document }` is small.
    #ECMAScript

  3. Random #ECMAScript fact: You can “safely” spread garbage into an object literal, including { ...undefined }, { ...0 }, { ...false }, { ...()=>{} }, { ...new Date }. Only enumerable own properties of objects are copied, basically what comes out of `Reflect.ownKeys(obj).filter((prop) => Object.getOwnPropertyDescriptor(obj, prop).enumerable)`.

    tc39.es/ecma262/#sec-runtime-s
    tc39.es/ecma262/#sec-copydatap

  4. Random #ECMAScript fact: You can “safely” spread garbage into an object literal, including { ...undefined }, { ...0 }, { ...false }, { ...()=>{} }, { ...new Date }. Only enumerable own properties of objects are copied, basically what comes out of `Reflect.ownKeys(obj).filter((prop) => Object.getOwnPropertyDescriptor(obj, prop).enumerable)`.

    tc39.es/ecma262/#sec-runtime-s
    tc39.es/ecma262/#sec-copydatap

  5. Модель исполнения JavaScript по спецификации ECMAScript: call stack, контексты, окружения и замыкания

    Я довольно долго был уверен, что понимаю, как работает call stack. Ну а что там понимать? Положил кадр, снял кадр, LIFO. Потом открыл спецификацию. Оказалось, за «стеком вызовов» стоит каркас из пяти сущностей, а половина привычных объяснений просто не совпадает с текстом стандарта. Замыкание — не фича языка, а побочный эффект того, что окружение живёт отдельно от кадра. «Область видимости» — вообще не сущность: такого термина там нет. А слов event loop, microtask и task queue в ECMA-262 ровно ноль. Проверяется грепом за минуту. Разбираю модель исполнения по первоисточнику: агент, контекст, окружения, джобы. Каждое утверждение сверено с текстом стандарта, номера параграфов проставлены — можно перепроверять за мной. Разобрать по спецификации

    habr.com/ru/articles/1063168/

    #JavaScript #ECMAScript #execution_context #контекст_выполнения #замыкания #область_видимости #ECMA262 #call_stack #event_loop #лексическое_окружение

  6. Fun with #JavaScript

    10:55:59.519 Symbol("t").toString()
    10:55:59.536 "Symbol(t)"
    10:56:06.138 [Symbol("t")].toString()
    10:56:06.157 Uncaught TypeError: can't convert symbol to string

    🤔 🤷 🫤 oh, well, you could, just one line up.

    Reason: The Array.toString() has a trip through Array.join() which uses the Ecmascript ToString abstraction which, for whatever reason, is defined as: if Symbol then throw. 💥

    tc39.es/ecma262/#sec-tostring

    #ecmascript #tostring

  7. Что нового в ECMAScript 2026. Павел Гжибек разбирает возможности новой спецификации: Array.fromAsync, Error.isError(), Math.sumPrecise для точного суммирования чисел с плавающей точкой, конвертация Uint8Array в Base64 и Hex, Iterator.concat() для объединения итераторов, доступ к исходному тексту в JSON.parse и Map.getOrInsert() для вставки значений. #ecmascript #js

    pawelgrzybek.com/whats-new-in-

  8. Что нового в ECMAScript 2026. Павел Гжибек разбирает возможности новой спецификации: Array.fromAsync, Error.isError(), Math.sumPrecise для точного суммирования чисел с плавающей точкой, конвертация Uint8Array в Base64 и Hex, Iterator.concat() для объединения итераторов, доступ к исходному тексту в JSON.parse и Map.getOrInsert() для вставки значений. #ecmascript #js

    pawelgrzybek.com/whats-new-in-

  9. What’s new in ECMAScript 2026. @pawelgrzybek walks through the features shipping in the new spec: Array.fromAsync, Error.isError(), Math.sumPrecise for accurate floating-point sums, Uint8Array Base64 and Hex conversion, Iterator.concat() for sequencing, JSON.parse source text access, and Map.getOrInsert() for upserts. #ecmascript #js

    pawelgrzybek.com/whats-new-in-

  10. What’s new in ECMAScript 2026. @pawelgrzybek walks through the features shipping in the new spec: Array.fromAsync, Error.isError(), Math.sumPrecise for accurate floating-point sums, Uint8Array Base64 and Hex conversion, Iterator.concat() for sequencing, JSON.parse source text access, and Map.getOrInsert() for upserts. #ecmascript #js

    pawelgrzybek.com/whats-new-in-

  11. Les nouveautés dans JavaScript en 2026, expliquées succintement avec des exemples.

    🔗 pawelgrzybek.com/whats-new-in-

    #JavaScript #ecmascript

  12. I have finally released version 1.0 of hyperguard library that I have written 4 years ago, but has been sitting in version 0.1, 0.2, and finally 0.3 without any update since.

    Version 1 improved the API, and some refactoring was made to remove the reliance of the `any` type.

    Anyways, check it out. github.com/shovon/hyperguard

    #TypeScript #JavaScript #NodeJS #BunJS #Deno #ECMA262 #ECMAScript

  13. I have finally released version 1.0 of hyperguard library that I have written 4 years ago, but has been sitting in version 0.1, 0.2, and finally 0.3 without any update since.

    Version 1 improved the API, and some refactoring was made to remove the reliance of the `any` type.

    Anyways, check it out. github.com/shovon/hyperguard

  14. I did a transition from Date to Temporal API on the backend side of one of my projects. The nice one is when you already use Intl.DateTimeFormat, you don't have to change anything in this area. Intl accepts both, Date and Temporal values.

    #ecmascript #temporal #node_js

  15. ESupgrade is finally on feature parity with Baseline 2025, with 2026 up next.

    Special thanks to @mdn for maintaining detailed browser compatibility data and @developers for the initiative!

    Moreover, thanks to all the projects that have already adopted the pre-commit hook and help to stop bugs.

    github.com/codingjoe/esupgrade

  16. ESupgrade is finally on feature parity with Baseline 2025, with 2026 up next.

    Special thanks to @mdn for maintaining detailed browser compatibility data and @developers for the #Baseline initiative!

    Moreover, thanks to all the projects that have already adopted the pre-commit hook and help to stop bugs.

    github.com/codingjoe/esupgrade

    #JavaScript #ECMAScript #Browser #OpenSource #AI #TypeScript

  17. Wenn du aus der Java-Welt kommst, wirken Begriffe wie JavaScript, TypeScript, Angular, React, Vue, Node.js oder npm am Anfang schnell wie ein einziger großer Themenblock. Genau da entsteht oft die eigentliche Verwirrung. Alles klingt ähnlich, vieles taucht im gleic...

    magicmarcy.de/angular-react-vu

    #Coding #JavaScript #Angular #TypeScript #React #Node #Vite #Webpack #ESLint #Maven #Paketmanager #ECMAScript #Programming

  18. Soon we can finally banish JavaScript to the ShadowRealm. @Wilto walks through the TC39 ShadowRealm proposal, which creates isolated execution contexts with their own pristine globals while running on the same thread as the host. With just two methods, evaluate() and importValue(), ShadowRealms could sandbox third-party scripts, ads, and test suites without polluting the main realm. Currently at Stage 2.7, not yet in browsers. #js #ecmascript

    css-tricks.com/soon-we-can-fin

  19. Soon we can finally banish JavaScript to the ShadowRealm. @Wilto walks through the TC39 ShadowRealm proposal, which creates isolated execution contexts with their own pristine globals while running on the same thread as the host. With just two methods, evaluate() and importValue(), ShadowRealms could sandbox third-party scripts, ads, and test suites without polluting the main realm. Currently at Stage 2.7, not yet in browsers. #js #ecmascript

    css-tricks.com/soon-we-can-fin

  20. Скоро мы наконец сможем отправить JavaScript в ShadowRealm. Мэт Маркиз разбирает предложение TC39 ShadowRealm, создающее изолированные контексты исполнения с собственными глобальными объектами в том же потоке, что и основной хост. Двух методов evaluate() и importValue() достаточно, чтобы изолировать сторонние скрипты, рекламу и тесты без загрязнения основного окружения. Сейчас на стадии 2.7, в браузерах пока нет. #js #ecmascript

    css-tricks.com/soon-we-can-fin

  21. Скоро мы наконец сможем отправить JavaScript в ShadowRealm. Мэт Маркиз разбирает предложение TC39 ShadowRealm, создающее изолированные контексты исполнения с собственными глобальными объектами в том же потоке, что и основной хост. Двух методов evaluate() и importValue() достаточно, чтобы изолировать сторонние скрипты, рекламу и тесты без загрязнения основного окружения. Сейчас на стадии 2.7, в браузерах пока нет. #js #ecmascript

    css-tricks.com/soon-we-can-fin

  22. RE: techhub.social/@vintprox/11239

    One schizo thread for a riddle that didn't even make it into the final game. I feel like it's a ploy #HerInteractive made for making their trailer look "futuristic". Well, as a developer myself, I'll say that this poor attempt at mockery won't go unseen.

    What you see here is some random snippet of FTP software written in Node.js. Whether it was stolen or not does not concern me (and believe me, I tried to find any matches with existing open source code on the Internet, to no avail). What concerns me is that they just had to obfuscate it - there is no reason for this whatsoever. No hidden clue in this, only a big ball of nothing.

    #NancyDrew #ND34 #NancyDrewMYsteryOfTheSevenKeys #NodeJS #ECMAScript #JavaScript

  23. RE: techhub.social/@vintprox/11239

    One schizo thread for a riddle that didn't even make it into the final game. I feel like it's a ploy made for making their trailer look "futuristic". Well, as a developer myself, I'll say that this poor attempt at mockery won't go unseen.

    What you see here is some random snippet of FTP software written in Node.js. Whether it was stolen or not does not concern me (and believe me, I tried to find any matches with existing open source code on the Internet, to no avail). What concerns me is that they just had to obfuscate it - there is no reason for this whatsoever. No hidden clue in this, only a big ball of nothing.

  24. [Перевод] Основные элементы экосистемы JavaScript по состоянию на 2026 год

    Ранее мы писали похожие статьи о CSS , но JavaScript заслуживает не меньшего внимания! Тем более что JavaScript лучше справляется с версионированием. Мы рассмотрим новые возможности самого языка, а также основные среды выполнения, фреймворки, библиотеки и инструменты.

    habr.com/ru/articles/1021182/

    #javascript #js #typescript #ts #nodejs #npm #vite #ecmascript #nextjs #react

  25. i made this game back in 2016 just as a demo to test my vizflow engine... and to vent at the politics at the time. kind of amazed it still works! and also kind of amazed that the politics of the times have only gotten worse!

    but, it might still serve its original purpose :)

    vizflow.github.io/vizflow/exam

    #html #webdev #games #FOSS #vizflow #electionFighter #election #fighter #politics #politricks #FLOSS #javascript #ecmascript #JS #gamedev #indie #indiegame #spritesheet #animation #visualization

  26. i made this game back in 2016 just as a demo to test my vizflow engine... and to vent at the politics at the time. kind of amazed it still works! and also kind of amazed that the politics of the times have only gotten worse!

    but, it might still serve its original purpose :)

    vizflow.github.io/vizflow/exam

    #html #webdev #games #FOSS #vizflow #electionFighter #election #fighter #politics #politricks #FLOSS #javascript #ecmascript #JS #gamedev #indie #indiegame #spritesheet #animation #visualization

  27. Temporal: девятилетний путь к исправлению времени в JavaScript. Джейсон Уильямс рассказывает, как предложение Temporal прошло от идеи до Stage 4, заменив устаревший Date API, унаследованный от Java в 1995 году. В статье описаны иммутабельные объекты, явная поддержка часовых поясов и наносекундная точность, а также temporal_rs — общая библиотека на Rust, позволяющая нескольким движкам использовать одну реализацию. #ecmascript #temporal

    bloomberg.github.io/js-blog/po

  28. Temporal: девятилетний путь к исправлению времени в JavaScript. Джейсон Уильямс рассказывает, как предложение Temporal прошло от идеи до Stage 4, заменив устаревший Date API, унаследованный от Java в 1995 году. В статье описаны иммутабельные объекты, явная поддержка часовых поясов и наносекундная точность, а также temporal_rs — общая библиотека на Rust, позволяющая нескольким движкам использовать одну реализацию. #ecmascript #temporal

    bloomberg.github.io/js-blog/po

  29. Temporal: the 9-year journey to fix time in JavaScript. @jasonwilliams traces how the Temporal proposal went from idea to Stage 4, replacing the legacy Date API inherited from Java in 1995. The article covers immutable objects, explicit timezone support, and nanosecond precision, along with temporal_rs, a shared Rust library that lets multiple engines collaborate on one implementation. #ecmascript #temporal

    bloomberg.github.io/js-blog/po

  30. Temporal: the 9-year journey to fix time in JavaScript. @jasonwilliams traces how the Temporal proposal went from idea to Stage 4, replacing the legacy Date API inherited from Java in 1995. The article covers immutable objects, explicit timezone support, and nanosecond precision, along with temporal_rs, a shared Rust library that lets multiple engines collaborate on one implementation. #ecmascript #temporal

    bloomberg.github.io/js-blog/po

  31. #TypeScript nerds, can you help me out?

    I have a type called DeepRequired that recursively makes optional properties in nested object required using dot notation as seen below.

    The problem is: It is only somewhat working. I believe, I'm on the right track somewhere but I can't get closer than this.

    Thanks in advance!

    1/2

    #FollowerPower #amCoding #amProgramming #softwareDevelopment #softwareEngineering #webDev #webDevelopment #JavaScript #ECMAScript

  32. CW: Angry rant about Javascript, including insults towards its homophobic inventor

    WTF!?

    So Javascript has these functions to get the nodes in a document…
    document.createTreeWalker and document.createNodeIterator that create a TreeWalker and a NodeIterator respectively.

    But because this language is dogshit invented by a complete and utter failure of a homophobic organism, those are of course
    not compatible with the standard iteration protocols of the language and you can’t just write document.createNodeIterator(document.body, NodeFilter.SHOW_TEXT).forEach(n => use(n));, because that would be way too easy!

    No,
    NodeIterators and TreeWalkers have their own incompatible interface and there isn’t even an easy way to convert them into an array or something similarly usable, because again, that would require to have more than room-temperature IQ when designing a language, and we all know that homophobes lack that!

    Seriously, how has this failure of an excuse for a programming language managed to stay the only language shipped in browsers? Why did google not just force dart into chrome and tell people to use something that’s at least slightly less shitty?

    Like how many different sequentially accessible container types that all have different and incompatible interfaces and are various degrees of difficult to turn into something usable does this crap have?

    #Javascript #ecmascript #js #webdev