-
Notifications
You must be signed in to change notification settings - Fork 62
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
Implement flags as bigint integers #260
Labels
enhancement
New feature or request
Comments
I like this idea. I found bags of bools a pretty odd implementation choice. |
Note that #235 is a prerequisite for this work. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This one comes out of discussion with @dbaeumer on the base-level type implementations.
Currently we implement flags as an object of bools, the suggestion would be switch to implementing all flags as BigInt values.
For users to be able to interpret and create flags, they would need to explicitly import from the flag type itself in JavaScript, something like:
BigInts have full support for binary operations in JS, so the above works out okay. In addition BigInts have unlimited length so will be fully compatible with arbitrary flags.
There would be a slight savings over allocating full JS objects for all values, but the major benefit would be simplicity from a user interface perspective, where creating bags of bools can feel unintuitive at the moment (especially when it is currently ambiguous that falsy values are optional in inputs).
I'm bringing this up now, because if made it would be the last major breaking change in jco before we stabilize preview2, so seems a good time to think about making this change now.
The text was updated successfully, but these errors were encountered: