pkamenarsky / replica

A remote virtual DOM library for Haskell
BSD 3-Clause "New" or "Revised" License
139 stars 14 forks source link

SVG support #11

Closed seagreen closed 4 years ago

seagreen commented 4 years ago

It's listed in the "Roadmap" section of the README, but I thought it would be good to have an issue for it too.

I've got a branch that supports SVG currently: https://github.com/seagreen/replica/commit/434ec5ad8daa834a83849f0d51489f40250acf94

It checks for an xmlns property on a node or leaf, and if it's present uses createElementNS instead of createElement.

This works in my case, but I'm not sure it's a fully complete solution. For one thing it doesn't use createAttributeNS which may be necessary in some cases. I thought I'd go ahead and open this issue though to see if you've got thoughts on how you'd like SVG support to work.

pkamenarsky commented 4 years ago

For proper SVG support I'd do the following:

I won't be able to implement this myself at the moment, but I'd definitely help however I can if you decide to open up a PR!

seagreen commented 4 years ago

That seems like a solid plan. I'll let you know if I start on it.

seagreen commented 4 years ago

Going to take a stab at it.