- 
                Notifications
    You must be signed in to change notification settings 
- Fork 748
handle big ints better #6768
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
handle big ints better #6768
Conversation
| The latest updates on your projects. Learn more about Vercel for GitHub. 
 | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! looks great
        
          
                frontend/src/custom.d.ts
              
                Outdated
          
        
      | reviver?: (this: any, key: string, value: any) => any, | ||
| ): unknown; | ||
|  | ||
| rawJSON(value: string): any; | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this better as rawJSON(value: string): unknown?
| const bigint = 2 ** 64; | ||
| const value = `text/plain+bigint:${bigint}`; | ||
| const result = getCopyValue(value); | ||
| expect(result).toMatchInlineSnapshot(`"18446744073709552000"`); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems rounded 2 ** 64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should be 18446744073709551616
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, yeah, I think the test is inaccurate because 2 ** 64 is going to be rounded. let me think of a way
📝 Summary
note that floats with big ints don't work well with tables, so I convert them to strings (which is the default rendering if using mo.plain)
before:

after:

🔍 Description of Changes
📋 Checklist