Did some experimenting with Rust + wasm and it feels really good.
Compiled my entire emulator + parser into a 50K wasm module. No JS runtime or Emscripten needed!
(Static lib for MacOS is ~4MB, but that’s not quite fair b/c wasm module is has dead code eliminated)
I’m processing a big image and it takes 200ms on desktop. Clooney + OffscreenCanvas to the rescue :D
OffscreenCanvas allows you to do image processing in a worker (currently behind a flag in Chrome).
Code: https://glitch.com/edit/#!/clooney-offscreen-canvas
Demo: https://clooney-offscreen-canvas.glitch.me/
API Proposal: Tasklets
Like Workers, but better.
Discussion over at @wicg_:
https://discourse.wicg.io/t/proposal-tasklets/2199 https://toot.cafe/media/NuGpToIJGXJZXYonYvI
Now that we have static module loading in browsers, we can polyfill dynamic module loading quite easily (probably not 100% spec compliant).
217B gzip’d!
Here’s a gist with both the screenshot code and a minified version: https://gist.github.com/surma/09f3aada1417b36823433c0977ffc161
📣 Blog: How I rendered DOM to a canvas so I can use CSS layouting and text rendering in WebGL (and WebVR!)
BEGIN KEYBASE SALTPACK SIGNED MESSAGE. kXR7VktZdyH7rvq v5wcIkHbs9uh28n CCfFtMcet62h4nJ ONOS5AGpVX2ymgc F67VEzXQ8LAIZxI ae1AvYfxPrIUleE n9T4KBR5AnZhmKF xFR2zwUmcaEHMCy xqZixAUeTd09DXA VAtIjIn9AfveH7m XJTz5gNrGFtoDCu wSF07WZr98YwmX9 M8mOs2pcM8blIvi dS4BKj0EkXzyV3F REackkXIH0CJ8dj 0TNE9d9Km5mRk1R f5bKmd7j02SC9Xf y8qpEOp6jzeM5ei yuxHKmRzaCyt4TN iWkGZHELJ2vO0i8 M1V8q6i. END KEYBASE SALTPACK SIGNED MESSAGE.
#a11y win at the CSSWG meeeting in Tokyo. `border-color` and `outline-color` now accept multiple colors.
Sometimes the focus ring was invisible if it had the same color as the background-color. This way you can have two rings (e.g. black & white) so the focus ring is always visible.
https://github.com/w3c/csswg-drafts/issues/1172#issuecomment-295565255 https://toot.cafe/media/7Wom9MfaD-QtE-Y5Lgo
THIS IS NOT HOW "ALL DAY" WORKS https://toot.cafe/media/1BtqSI9NtkbjH74LHfM
I’ve been writing a set of helpers (no abstractions!) for WebGL2.
Here: Rendering 5 million polys at 60fps. Let’s see how far I can push it. https://toot.cafe/media/g-Fmk6fq1sy9R1siAFM
TIL: Uint8ClampedArray is a thing, potentially making code for binary formats & protocols simpler. https://toot.cafe/media/yMP0Vgzy89Thj5G3o-w
Reddit open-sourced their code for the /r/places experiment and explained how they scaled it.
https://redditblog.com/2017/04/13/how-we-built-rplace/ https://toot.cafe/media/BlDU91zHcxS7Tpmy0n0
AnimationWorklet finally has a (proposed) spec! It’s going to be discussed next week at the Houdini f2f in Tokyo.
https://wicg.github.io/animation-worklet/ https://toot.cafe/media/PN1cTyxbR3skw2rbBxc
Might as well cross-share on Mastodon :sweat_smile:
📹 I made a video about the refactor of simplehttp2server for 🔥Firebase support and less setup friction:
Mastodon should definitely look into getting a pinned tweet-type deal for profiles so we can pin #introductions
#introductions are a thing, apparently!
Hi! I’m Surma, I work on the Chrome DevRel team in London and therefore, and I do web stuff.
I work mostly on performance and loading but I am also a member of the CSS working group, the Houdini task force and the Service Worker working group.
My most recent article: https://developers.google.com/web/updates/2017/03/custom-scrollbar if you fancy a read.
We already have a trending bot. That’s amazing.
Also: to fix Masto latency issues, can we please get together and contribute PWA / Service Worker support to https://tootsuite/mastodon ? We have like 150 brilliant web folks here, surely we can do this! ⚡️
Dayum. I got a spot on this prestigious server