Repository navigation
fix: run yoga on chrome 57+ (mvp wasm) - #147
Merged
Merged
Conversation
RuudBurger
marked this pull request as ready for review
October 15, 2026 12:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The yoga-layout WASM we ship uses sign-ext opcodes, so it only compiles on Chrome 74+. That's about 62% of webOS + Tizen devices. Chrome 57-73 is another ~21% (webOS 5 = Chrome 68, Tizen 5.0 = 63, Tizen 5.5 = 69) and those can run WASM fine, just not that build. This lowers Yoga to MVP WASM so they can lay out at all.
What changed
packages/plugin-flexbox/src/yoga/vendor, generated byscripts/vendorYoga.ts(pnpm vendor:yoga). It has to be re-run after every yoga-layout bump, otherwise we keep shipping the old YogayogaVendor.spec.tsguards it: no post-MVP features in the vendored binary (and it does catch them in the upstream one), it matches the installed yoga-layout version, and it lays out a treequeueMicrotaskandglobalThis.location(both need Chrome 71, and nothing polyfills the worker)class extends window.ResizeObserver, which throws insiderender()on Chrome < 64 (Tizen 5.0). It now falls back to a no-op base, so Lightning targets still report and DOM targets are ignored. Same file falls back to a plain rect whereDOMRectReadOnlyis missing (Chrome < 61). Also swappedqueueMicrotask(Chrome 71) for a small helper with a promise fallback in the host config, element updates and focus, and droppedArray.prototype.at(Chrome 92) /flat(Chrome 69) on the key, focus and StyleSheet pathsProof
--mvp-featuresvalidation passeswindow.ResizeObserver/DOMRectReadOnly, and for the microtask fallbackCaveat: the plugin-flexbox dist chunk goes from 26 KB to 165 KB because Yoga is now inlined instead of imported. Should be neutral for consumers, they bundled yoga-layout's own 121 KB copy before.
Caveat:
@lightningjs/renderer3.1.1 still callsqueueMicrotaskitself (CoreNode, Texture), so apps still need a global polyfill for Chrome < 71. Not touching that here.Not verified on a Chrome 57-73 device yet, only unit tests and the opcode check.
Two more commits: plugin-reanimated now goes through the exported
scheduleMicrotaskinstead ofqueueMicrotask(animated styles and tracked reactions) and reads the:focus-withinleaf by index instead of.at(-1), and VirtualList reads the pointer scroll hook offwindow/selfinstead ofglobalThis. So our own code no longer needs Chrome 71+ on any path I could find. Didn't add a globalqueueMicrotaskpolyfill for the renderer after all, because the Plex legacy builds already ship core-js's (web.queue-microtaskpluses.global-this): plugin-legacy runs usage detection on the final chunks, renderer included, and onindex-legacyit picks both up for chrome 53 and 56 but not for 79. core-js keeps the semantics (real microtask, a throw rethrows from the flush so it still shows up in the console). Other consumers without plugin-legacy still need their own polyfill for the renderer. Still unverified on a real Chrome 57-70 device.