Preact is an open project. Features and priorities are decided based on feedback and suggestions given here and via Twitter or Gitter. I'd like to propose adding a fairly significant new feature, which is to merge SVG support into Preact itself, rather than providing it as a separate preact-svg module. Please take a moment to read the pros and cons I've laid out below, and feel free to suggest more.
There is a
native-svgbranch with the bundled implementation if you'd like to see how this would work.
| Pros | Cons |
| --- | --- |
| preact-svg is 1.7kb, no longer needed 1 | Preact gets 115 bytes larger 1 |
| <svg> "just works" - no imports / SVG | Preact gets slightly less modular |
| No dirty hacks would be necessary | Tiny performance hit for custom attributes 2 |
* All sizes listed are gzipped (because this is what Preact is optimized for)
1: Meaning this would be a
1.6kbsize _reduction_ for anyone using SVG!2: This only affects custom attributes (eg: data attributes, etc), which are already significantly slower than properties. The performance hit is a single regex match, which I don't even see making a meaningful difference in any of the perf stats I track.
@developit I think Preact should stay as modular & small as possible but not at the cost of development convenience. A solution without hacks is a good one, I vote for merging SVG into Preact.
Agree with @slmgc
Glad to have the input, thanks to you both! I should have also added a pro: this brings preact a little but closer to react, which does support svg by default.
Time to close this one out! Built-in SVG support will be released as of 5.1.0-beta.16.
Most helpful comment
@developit I think Preact should stay as modular & small as possible but not at the cost of development convenience. A solution without hacks is a good one, I vote for merging SVG into Preact.