-
Notifications
You must be signed in to change notification settings - Fork 165
Allow configurable render mode #17
Comments
@sebmarkbage? This is real art here, so this is outside my area of knowledge. Maybe @mikepink pays attention to GitHub and knows? |
I have also wanted to be able to change the rendering mode for debugging without rebuilding. |
+1 to being able to change the rendering mode. Is it as simple as removing line 21 from ReactART.js? Then it's left up to the application to decide which mode to set. |
This is related to ReactART, not real ART. Real ART is already runtime configurable. ReactART isn't because of the convenience to not need configuration. It should probably be solved by passing the mode through context. Another reason to not allow configurability is that I'm not sure we want to keep supporting VML modes after IE8, and Canvas should in theory always be faster than SVG. There are still some places where SVG is useful though so I'm not sure. |
Actually, it strikes me that this is already configurable. We already do this in the unit test. Closing out. :) https://github.com/facebook/react-art/blob/master/src/__tests__/ReactART-test.js#L63-L67 |
Sorry to bring this back months later, but is it actually configurable? When using webpack at least, it seems that you can't |
On a test project I'm working on, React state changes are causing flickering on the canvas. Assuming that the canvas was being completely redrawn on each change, I updated the render mode to "art/modes/dom" on line 21 of ReactART.js, and am seeing the flickering disappear.
In addition, with the VectorWidget example (no noticeable flickering at all, BTW), I'm seeing the consumed CPU time in Chrome OSX go down from around 20% to 15% after switching to DOM rendering.
I don't know all of the considerations involved, but adding the ability to choose the rendering mode would be useful.
Or would, perhaps, just using SVG directly make more sense for a project where DOM rendering makes more sense?
The text was updated successfully, but these errors were encountered: