Safari 27 rewrites module loader in C++ to fix top-level await ordering bugs
Apple's WebKit team has completely rewritten Safari's JavaScript module loader in Safari 27, replacing a legacy self-hosted JavaScript implementation with C++ code that directly mirrors the ECMAScript specification. The original loader dated back to the abandoned WHATWG Loader proposal from around 2016, predating async/await, which made correctly supporting the ECMAScript 2022 top-level await feature structurally difficult. As a result, modules using top-level await could resolve out of order in Safari, causing intermittent errors such as bindings being accessed before initialization. Engineer Kai Tamkun documented the rewrite in a September 2, 2026 WebKit blog post, noting the team validated the new loader using fuzzing, cross-engine output comparisons, and the test262 and Web Platform Tests suites. The fix is focused on correctness rather than performance, and primarily benefits developers who have encountered top-level await ordering issues specific to Safari.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in