Could this be consumed by Konva js for SSR ?
Yes, it may require some monkey-patching of Konva right now. But I was able to do that. Drop GitHub issue if you are interested to discuss it.
Skia Canvas: Browserless implementation of the HTML Canvas drawing API for node
21–30 of 91 posts
Re: Skia Canvas: Browserless implementation of the HTML Canvas drawing API for node
#22Re: Skia Canvas: Browserless implementation of the HTML Canvas drawing API for node
#23Out of curiosity, what's the use for such library? If you are on a desktop surely there is a better native library to draw shapes, no?
Re: Skia Canvas: Browserless implementation of the HTML Canvas drawing API for node
#24Skia ships with a WASM build that supports node, called CanvasKit [1], whereas this module is Rust bindings? I’d be keen to know what the pros and cons of each approach are. 1. https://www.npmjs.com/package/canvaskit-wasm
Re: Skia Canvas: Browserless implementation of the HTML Canvas drawing API for node
#25They seem similar?
Re: Skia Canvas: Browserless implementation of the HTML Canvas drawing API for node
#26Is this like a wrapper for the Rust crate? https://rust-skia.github.io/doc/skia_safe/canvas/struct.Canv...
Re: Skia Canvas: Browserless implementation of the HTML Canvas drawing API for node
#27https://jimp-dev.github.io/jimp/
Maybe there are some killer features?
Re: Skia Canvas: Browserless implementation of the HTML Canvas drawing API for node
#28Earlier quoted context omitted.
I don’t think anyone ever thought Node was a browser thing though
Thinking Node is related to the browser is not uncommon. They're both javascript and javascript means "browser" to a lot of (if not most) people.
Re: Skia Canvas: Browserless implementation of the HTML Canvas drawing API for node
#29Re: Skia Canvas: Browserless implementation of the HTML Canvas drawing API for node
#30Earlier quoted context omitted.
They're not saying Skia itself is browserless; they're saying that "Skia Canvas" is a non-browser-based implementation of what people would normally call the browser Canvas API.
Canvas is one of the easiest browser APIs to implement because most of it maps 1:1 to PostScript-style 2D APIs. It was created by Apple as a wrapper for CoreGraphics back around Mac OS X Tiger 10.4. (IIRC, Canvas even debuted in Apple's Dashboard widgets rather than Safari? I'm not 100% sure.) I remember writing my own Canvas implementation around 2008-2009 using JavaScriptCore and CoreGraphics. It took maybe two day…