Английский Технологии
14.08.2026 Читать источник
Apple Safari внедрил нативную поддержку управления ресурсами и новые возможности WebAssembly

Команда WebKit выпустила предварительную версию Safari 250, добавив полную поддержку стандарта TC39 Explicit Resource Management и улучшив работу с потоковыми данными. Обновление также включает поддержку многопамяти в WebAssembly и новые свойства CSS для точного контроля типографики.
Перевод ИИ
Текст статьи доступен на языке оригинала.
Нажмите кнопку «Перевести статью» выше, чтобы сгенерировать перевод с помощью ИИ.
Оригинальный контент
TypeScript developers have been writing using for over two years — and transpiling it away, because Safari didn't support it natively. That era ended yesterday. Apple's WebKit team shipped Safari Technology Preview 250 on August 13, 2026, delivering full support for the TC39 Explicit Resource Management proposal, which advanced to ECMAScript Stage 4 in 2025 and is now a ratified part of the standard. With all three major JavaScript engines now implementing using and await using, the feature is no longer a transpilation target — it is a production runtime capability developers can ship to without a polyfill.
The release also brings two significant WebAssembly additions — multi-memory support and relaxed SIMD instructions — along with streaming upload support in fetch(), SVG clipboard API support, and five new CSS text properties. STP 250 is available now for macOS Golden Gate and macOS Tahoe through System Settings → General → Software Update from Apple's developer resources page.
What Explicit Resource Management Does — and Why the Cross-Browser Milestone Matters
JavaScript has never had a built-in mechanism for guaranteeing that a resource's cleanup logic runs when it goes out of scope. The standard workaround is a try/finally block: open the resource, wrap the work in try, put the cleanup call in finally, and hope no one forgets either half. When multiple resources are involved, the nesting compounds; when cleanup itself can throw, the original error can get swallowed.
The TC39 Explicit Resource Management proposal introduces using and await using declarations that bind a resource to the enclosing block scope. When execution leaves the block — normally, via return, or via an exception — the engine automatically calls the resource's [Symbol.dispose]() method (or [Symbol.asyncDispose]() for the async form). Multiple resources declared with using in the same block are disposed in last-in-first-out order, meaning the most recently opened resource is closed first — the order a developer would choose manually.
The proposal also ships DisposableStack and AsyncDisposableStack, which aggregate multiple disposable resources and guarantee LIFO teardown even when individual disposals throw. A new SuppressedError type wraps both the original exception and any error thrown during disposal, so neither gets silently swallowed.
The V8 team documented the feature as providing a deterministic approach to managing the lifecycle of resources like file handles and network connections. In practice, any object that implements [Symbol.dispose]() can be declared with using — database connection wrappers, file handles in Node.js, stream readers, mutex locks, and custom cleanup handlers all become candidates.
What makes STP 250 a milestone is the engine landscape. V8 (powering Chrome and Node.js) and SpiderMonkey (powering Firefox) already had implementations in place. WebKit's addition in STP 250 completes cross-engine coverage among the three major JavaScript runtimes. For TypeScript developers who adopted using when TypeScript 5.2 shipped transpilation support in 2023, the transition to native browser support is now a realistic upgrade path rather than a distant goal.
Iterator Combinators: Parallel Traversal Gets a Native API
STP 250 also adds Iterator.zip() and Iterator.zipKeyed() from the TC39 Joint Iteration proposal. These methods pair corresponding elements from two or more iterables into a single traversal without converting either to an array first.
Iterator.zip() yields arrays of matched elements — conceptually the same as Python's zip(). Iterator.zipKeyed() yields plain objects whose keys are taken from the input iterables' names, making the results self-describing rather than positionally indexed. Both are lazy: elements are pulled from the source iterables only as the combined iterator advances, which keeps them efficient for large or infinite sequences.
WebAssembly Relaxed SIMD: What Safari Was Missing and Why It Mattered
WebAssembly has supported fixed-width 128-bit SIMD instructions since they were standardized in 2024, but that specification required strict cross-platform determinism — every SIMD operation produces exactly the same result on every CPU. That constraint forced all Wasm engines to use the lowest-common-denominator instruction mapping rather than the fastest one available on a given chip.
Relaxed SIMD lifts that constraint deliberately. For a defined set of operations, implementations are permitted to choose among a range of acceptable outputs — allowing them to select the platform-native instruction (for example, an AVX2 fused multiply-add on Intel x86, or a NEON equivalent on ARM) that delivers better throughput than fixed SIMD on the host hardware. The specification defines bounds on acceptable behavior; implementations pick the fastest result within those bounds.
The tradeoff is explicit: programs that require bit-for-bit reproducibility across CPU families — certain cryptographic or financial computations — must avoid Relaxed SIMD operations. Programs that prioritize throughput over strict determinism — machine learning inference, audio and video processing, image filtering pipelines — can opt in for measurable speedups.
Firefox removed the Relaxed SIMD flag in Firefox 145, making it available by default to Firefox users. Chrome and V8 had flagged-off support earlier. Safari kept the feature behind a flag through STP 249; STP 250 ships it unflagged.
What Can WebAssembly Do Now That It Has Multiple Memories?
The WebAssembly specification historically allowed exactly one linear memory per module. That single-memory constraint complicated the design of modules that needed to maintain logically distinct memory regions — a shadow stack separate from the heap, a region for untrusted guest data isolated from sensitive internal state, or per-component memory separation in Wasm Component Model architectures.
The Wasm multi-memory proposal extends the load and store instructions with an explicit memory-index operand, allowing a single Wasm module to define and use multiple independent linear memories with their own base addresses and size limits. V8 and SpiderMonkey had already shipped this extension; WebKit's STP 250 implementation completes cross-browser support.
The practical beneficiaries are complex Wasm applications: WASI runtimes, sandboxed plugin systems, and Component Model-based architectures where memory isolation between components is a design requirement rather than a workaround.
Web Inspector gains a complementary improvement in this release: WebAssembly modules are now visible and inspectable in the Sources tab, giving developers a native debugging surface for Wasm code without external tooling.
How Does Streaming Upload Work in fetch(), and Why Did It Take This Long?
The Fetch API's standard model for request bodies is synchronous in a structural sense: the entire body — a string, an ArrayBuffer, a Blob — must exist before the request can be initiated. For applications that generate large payloads in real time (audio capture pipelines, large file transfers, live sensor telemetry), this means buffering the entire payload in memory before transmission begins.
STP 250 adds initial streaming upload support for supplying a ReadableStream as the body of a fetch() request. The browser sends chunks downstream as the stream produces them, eliminating the memory requirement for holding the complete payload. Alongside this, the Request constructor now accepts a duplex option — required to be set to "half" when using a stream body. The duplex field is part of the Fetch specification and had been absent from WebKit's implementation until STP 250.
Apple marked the feature as "initial support," which signals that edge cases and full specification compliance may still be in progress, but the core streaming upload path is functional for development use.
CSS Text Decorations Gain Precision Controls
STP 250 fills in five CSS text and layout properties that give designers finer control over decorative typography without resorting to pseudo-element workarounds.
text-decoration-inset controls text decoration positioning — how far an underline, overline, or line-through is inset from its natural position, complementing the existing text-underline-offset and text-decoration-thickness properties. white-space-trim trims leading and trailing whitespace at render time without altering the underlying DOM. wrap-inside: avoid prevents line breaks within a single element in a wrapping context. ruby-overhang: spaces restricts the overhang of CJK ruby annotation text to adjacent whitespace and punctuation, with none now aliased to spaces. The ::marker pseudo-element gains support for the content property, letting authors replace list bullets and counters with arbitrary generated content.
On the removal side, the non-standard text CSS color keyword is deprecated in STP 250 and removed; authors should use the standardized canvastext keyword instead.
SVG Lands on the Clipboard
The Clipboard API can now read and write SVG data via the image/svg+xml MIME type. Design tools, diagramming applications, and any interface that works with vector graphics can now move SVG through the standard asynchronous clipboard interface (navigator.clipboard.read() / navigator.clipboard.write()) rather than workarounds. WebKit sanitizes the SVG markup on both read and write, stripping scripting and other potentially dangerous content — consistent with how it handles HTML clipboard data.
What Else Is Fixed
A VoiceOver regression that caused screen readers to encounter stray newlines when navigating a <textarea> ending in a line break is resolved in STP 250. HLS live streams no longer fire spurious pause and ended events when playback reaches the live edge. An IndexedDB bug — where a failed put() on a unique index constraint silently deleted the record it was supposed to overwrite — is patched. Paged scrolling via Page Down or the spacebar no longer skips intermediate scroll snap positions. Digital Credentials get() now works correctly when called from an iframe inside a focused window.
When Will These Features Come to Stable Safari?
Apple has not announced a timeline. Safari Technology Preview has historically functioned as the staging environment for features that subsequently ship in stable Safari — WebDriver followed exactly that path, arriving in STP before becoming a standard capability in every Safari release on macOS and iOS. If STP 250's features follow the same trajectory, they will eventually reach the approximately two billion devices running stable Safari. That transition has not yet happened; STP 250 is a developer preview, available only to users who have downloaded the separate Safari Technology Preview app from Apple's developer resources page.
Frequently Asked Questions
What does the JavaScript using keyword actually do?
using binds a resource to the enclosing block scope through the resource's [Symbol.dispose]() method. When execution leaves that block — whether normally, via an early return, or because an exception was thrown — the engine calls dispose() automatically, in last-in-first-out order for multiple resources declared in the same block. The async form, await using, calls [Symbol.asyncDispose]() and awaits the result, making it suitable for teardown of network streams, database transactions, and other asynchronous resources. The feature is conceptually similar to C#'s using statement and Python's with block.
Is using safe to ship in production JavaScript today, across all major browsers?
As of STP 250, all three major JavaScript engines — V8 (Chrome and Node.js), SpiderMonkey (Firefox), and WebKit (Safari) — have implemented Explicit Resource Management. However, STP 250 is a developer preview, not stable Safari. For production code targeting stable browser releases, check browser compatibility tables before removing transpilation. Once STP 250's features transition to stable Safari (no timeline announced), native using support will be available across all major browsers without polyfills.
What is WebAssembly Relaxed SIMD, and why does it make Wasm faster in Safari?
Standard WebAssembly SIMD operations must produce identical results on every CPU to guarantee cross-platform determinism. Relaxed SIMD allows implementations to choose among a range of acceptable outputs for certain operations, selecting the platform-native instruction — AVX2 on x86, NEON on ARM — that delivers the best throughput. For applications like ML inference, audio processing, and image filters, where strict cross-platform bit-for-bit reproducibility matters less than raw speed, Relaxed SIMD can deliver meaningfully faster execution. Safari had kept Relaxed SIMD behind a flag until STP 250, trailing Firefox 145, which had unflagged the feature in 2025.
What changed with streaming uploads in fetch(), and which apps benefit?
Previously, fetch() required the entire request body to be available in memory before sending. STP 250 adds initial support for a ReadableStream as the request body, allowing the browser to send data to the server as it is produced rather than after it is fully buffered. Applications that stream large file uploads, capture live audio or video, or send real-time sensor data can now do so with significantly lower peak memory usage. The Request constructor requires duplex: "half" to be set when using a stream body — a Fetch specification requirement that was previously absent from WebKit.
ⓒ 2026 TECHTIMES.com All rights reserved. Do not reproduce without permission.
Аналитика ИИ и парсинга
Технические детали обнаружения, сопоставления и связывания статьи
Поисковый запрос
«Apple Safari WebKit WebAssembly управление ресурсами»
Запрос, сгенерированный ИИ для поиска статьи в веб-источниках
Связанные результаты поиска
Полное руководство по публикации веб-приложения Flutter, скомпилированного в WebAssembly, на Flutter 3.44: как выглядят две выпускаемые сборки, почему Firefox и Safari по-прежнему получают JavaScript из-за ...
Управление Safari на macOS, работа с AI-агентами, использование AppleScript, операции с вкладками, создание скриншотов и выполнение JavaScript.