Open aforty opened 7 years ago
Sorry for the late reply! I wonder if this really would be neccesary. After all the code just throws an error but nothing breaks. It is ofc more clean when checking that before...hm...
I think it is necessary. If one is to use the proper method of importing depdencies via import
then they cannot be wrapped in an if
environment check (not to mention a try-catch). Therefore the same file cannot be run in a test environment that doesn't support SVG. Since svg.js
includes this check then I think this extension script should too in order to be consistent.
The thing is, that this check would be needed in every svg.js plugin which is quite a bit of an overhead. Adding it here would mean we need to add it everywhere. I agree with you that it would be more consistent.
Hi, I'm having an issue in my testing environment. I include
svg.js
which early on does a test for whether svg's are supported in the current environment and exits out if they are not.https://github.com/svgdotjs/svg.js/blob/04e21b18c30d546ed6a16b279504a2b58b503541/src/svg.js#L20
My issue is that
svg.js
will exit if not supported butsvg.easing.js
will not.svg.easing.js
attempts to setSVG.easing[key] = easing[key]
which fails becauseSVG.easing
does not exist.Would you accept a PR for a similar check for
SVG.supported
and exit the script the same way assvg.js
does if it's not supported?