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

Sync code with fbjs to fix a bug #30

Closed
wants to merge 3 commits into from
Closed

Sync code with fbjs to fix a bug #30

wants to merge 3 commits into from

Conversation

realityking
Copy link

I tried using this package in create-react-context (see jamiebuilds/create-react-context#22) and discovered a bug compared to fbjs.

This line would not work correctly:

warning(
  (changedBits & MAX_SIGNED_31_BIT_INT) === changedBits,
  'calculateChangedBits: Expected the return value to be a ' +
  '31-bit integer. Instead received: %s',
  changedBits
);

Since it did work in fbjs I simply resented the code. I also removed to react-isms in follow-up commits.

@TravisBuddy
Copy link

Hey @realityking,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

@realityking
Copy link
Author

Build failure will be fixed with #31

@BerkeleyTrue
Copy link
Owner

Why won't this code work? What's the value of changedBits and MAX_SIGNED_31_BIT_INT?

@realityking
Copy link
Author

@BerkeleyTrue I didn't fully debug it. My first attempt was simply to check if the upstream implementation in fbjs had the same issue. Since it doesn't, is it really worth understanding why they behave differently?

@BerkeleyTrue
Copy link
Owner

It may have been a bug introduced a couple of months ago. A fix has been released as https://github.com/BerkeleyTrue/warning/releases/tag/v4.0.3

Happy Coding

@realityking
Copy link
Author

@BerkeleyTrue That did indeed fix things. Thank you!

@realityking realityking deleted the broken branch September 27, 2020 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants