Skip to content
This repository was archived by the owner on Jul 19, 2019. It is now read-only.

Allow configurable render mode #17

Closed
danielnaab opened this issue Jul 9, 2014 · 6 comments
Closed

Allow configurable render mode #17

danielnaab opened this issue Jul 9, 2014 · 6 comments

Comments

@danielnaab
Copy link

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?

@zpao
Copy link
Member

zpao commented Jul 13, 2014

@sebmarkbage? This is real art here, so this is outside my area of knowledge. Maybe @mikepink pays attention to GitHub and knows?

@sophiebits
Copy link
Member

I have also wanted to be able to change the rendering mode for debugging without rebuilding.

@cascadian
Copy link

+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.

@sebmarkbage
Copy link
Contributor

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.

@sebmarkbage
Copy link
Contributor

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

@joshma
Copy link

joshma commented Dec 9, 2014

Sorry to bring this back months later, but is it actually configurable? When using webpack at least, it seems that you can't require the art that gets installed with react-art, so (while the test can do it) a consumer of the library wouldn't be able to require the same art/modes/current that controls which render mode is used.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants