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

Fix performance bug for which selectors were not being cached #74

Merged
merged 1 commit into from
Jan 31, 2018
Merged

Fix performance bug for which selectors were not being cached #74

merged 1 commit into from
Jan 31, 2018

Conversation

xantorres
Copy link
Contributor

After a lot of headaches finding my components being rendered again and again because of selectors getting called, I think I finally found the issue.

@mariusandra
Copy link
Member

Wow! That's a nasty bug! 🐞
Thanks for fixing it! I'll release a new patch version right away.

@mariusandra mariusandra merged commit b2df75a into keajs:master Jan 31, 2018
@mariusandra
Copy link
Member

v0.27.6 released. I did add back the !! as I can't trust the cache to return a boolean. It might return undefined and then !==ing it with a boolean will always be false. Not sure if that'll have real world consequences, but I'd like to be safe :).

@xantorres
Copy link
Contributor Author

Why don't you just use != then?

@mariusandra
Copy link
Member

That's a valid question. The reason's simple: ESLint complains about it and I might overlook it and "fix" back to "!==" one day when refactoring.

I could of course use != and leave a comment... or add a // eslint-disable-line, but in general I find an operator that equates a string ("5") to a number (5) to be a bit too magical for my taste, so I just prefer to not think about all these edge cases and consistently use !==.

@xantorres
Copy link
Contributor Author

Ok, understood. And thanks for the great library btw ;) Is really awesome

@mariusandra
Copy link
Member

I was perhaps a bit too fast when releasing the new version. I didn't run the tests and apparently the fixed code with the !! put back in place makes them fail:

screen shot 2018-02-01 at 09 55 45

Without the !! everything works. I'll investigate later if there are any deeper side effects (incl. performance), but for now I released 0.27.7 that should work as expected.

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

Successfully merging this pull request may close these issues.

2 participants