4 ms·
I think once WasmGC is finished up, that will make shipping a VM inside a VM more viable. Opening up direct access to the DOM would be cool, but if it were up t
by zengid 3y ago
I think once WasmGC is finished up, that will make shipping a VM inside a VM more viable. Opening up direct access to the DOM would be cool, but if it were up to me, I'd just skip it and render everything inside a <canvas/> and avoid all of the "build an application on top of a document format" crap that makes web apps so weird to make.
- noman-land 3y agoNot a very accessible solution.
- zengid 3y agoIt can be! I think that's the number 1 response when anyone wants to actually make a better platform. Projects like AccessKit are a really great step in the right direction https://github.com/AccessKit/accesskit https://github.com/AccessKit/accesskit
- noman-land 3y agoCool, thanks for the share. I will check it out.
- munificent 3y ago> if it were up to me, I'd just skip it and render everything inside a <canvas/> That's very tempting, but you lose a lot if you do that, especially around text: * Accessibility for screen readers, etc. * The easy ability to select text, copy/paste between other apps, etc. * Line splitting * Support for multiple languages, RTL, and all their other rendering quirks. Canvas has some text APIs, but they are fairly rudimentary. It's a hard problem.
- zengid 3y agoI completely agree, and these are required features for a full app that is planning to reach the world. It requires a lot of extra work, but real world apps like Figma [0] are rendering directly to the canvas, and frameworks like Flutter offer support for canvas rendering (via Skia's CanvasKit) [1] [2]. I guess my point is that if someone is using WASM to ditch JavaScript, why stop there? Ditch the DOM and CSS too! Render all of the graphics with OpenGl or WebGPU! There is a class of applications that I want to explore that would be better suited to by doing just that. I don't believe every app should do that, just that for what I want to build, that's where I'm looking at going (hence my "if it were up to me" comment above). [0] https://www.figma.com/blog/building-a-professional-design-tool-on-the-web/ https://www.figma.com/blog/building-a-professional-design-to... [1] https://docs.flutter.dev/platform-integration/web/renderers https://docs.flutter.dev/platform-integration/web/renderers [2] https://skia.org/docs/user/modules/canvaskit/ https://skia.org/docs/user/modules/canvaskit/
- etimberg 3y ago> Canvas has some text APIs, but they are fairly rudimentary That's an understatement for sure. `measureText` is not even close to feature parity with where windows apis were 25 years ago. Or something like text underlines has to be done entirely manually.
- 0x457 3y ago> render everything inside a <canvas/> and avoid all of the "build an application on top of a document format" crap that makes web apps so weird to make. We tried this with flash already. It has the same issues. Browsers provide _a lot more_ than just rendering your html+css. There are cases where it makes sense, but generally, it's a terrible idea. It will be like trying to make a visual novel using youtube in-video links.