-
Notifications
You must be signed in to change notification settings - Fork 177
feat: allow mode to be defined, default to fast
#77
base: master
Are you sure you want to change the base?
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at [email protected]. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Hm. The tests are ok but the travis container is using an old version of node and choking on I had to update some deps to get the tests running on my machine (old Jest wouldn't work on new node!)
|
Can you pull out the dependency changes into a separate PR (then you can also update the node version to 4 in .travis.yml) |
36d2b3d
to
451782b
Compare
5a623a7
to
c00e3d7
Compare
@zpao not quite sure how to proceed here. I can't get the tests running for any combination of With an updated
|
How about this… are you ok with me syncing out some changes we have internally which overlap considerably and getting jest running so you can focus on the actual code changes you need to make for your PR? You's just strip the top 2 commits ( |
By the way: require() with a dynamic argument doesn't work in many bundlers, including Facebook's. We also don't want to send down code that we won't ever run. Perhaps we could support |
@zpao That's ok with me. @spicyj I was wondering about whether that would be problematic. The first API I tried was requiring a mode file within the react-art package... Since I submitted this PR there's also another method I was playing with: each e.g.
It would require a restructure of |
I'm not a fan of dynamic dependency injection. I think it would be better to do this at the level of something like webpack with an override.
However, nobody has yet said WHY they want this. What's the use case? The primary feature of ART is to lock it down so that it doesn't matter which render mode it is. Is it because of browser bugs rendering to canvas? If so, could we maintain a UA blacklist that switches mode automatically for flaky browsers? I was kind of hoping of going all in on Canvas in the future - like Fabric.js did. |
Fix for #54.
This introduces a
.mode()
method to the API to allow the mode to be defined. Mode is set bySurface.componentWillMount
if the mode has not been set beforehand. Defaults tofast
.