Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use bit flag instead of booleans in TestDrawableComponent #79

Closed
emilsjolander opened this issue Apr 12, 2017 · 5 comments
Closed

Use bit flag instead of booleans in TestDrawableComponent #79

emilsjolander opened this issue Apr 12, 2017 · 5 comments

Comments

@emilsjolander
Copy link
Contributor

We have a lot of booleans to configure the test components like callsShouldUpdateOnMount or implementsAccessibility. Instead of keeping the configuration flags as booleans we could have them as bit flags.

Code pointers

https://github.com/facebook/litho/blob/master/litho-testing/src/main/java/com/facebook/litho/testing/TestDrawableComponent.java

Point of contact: @mihaelao

@anu0012
Copy link

anu0012 commented Apr 24, 2017

Hey @emilsjolander, I want to take up this issue. Can you guide me? Do we need to use bit flags just like it is used in InternalNode.java file?

https://github.com/facebook/litho/blob/master/litho-core/src/main/java/com/facebook/litho/InternalNode.java

@emilsjolander
Copy link
Contributor Author

Awesome! Yes I believe so. Will delegate specifics to @mihaelao who is the POC for this issue 👍 She should be able to provide more specific guidance.

@anu0012
Copy link

anu0012 commented Apr 24, 2017

Hey @mihaelao, I have some doubt regarding this issue. Do we also need to change the return types of methods like callsShouldUpdateOnMount() etc?

@mihaelao
Copy link
Contributor

Hi @anu0012, thanks for taking this up! You're right, the idea is to use bit flags instead of booleans, same as for InternalNode. The API shouldn't change though, those methods should still return booleans, but you can perform bitwise operations on the flags instead of returning the booleans directly.

@muraziz
Copy link
Contributor

muraziz commented Apr 26, 2017

Resolved with #138

@muraziz muraziz closed this as completed Apr 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants