Skip to content

Bigints larger than the browser is able to handle (e.g. Twitter widget ID's) #43

Open

Description

@optimalisatie

HTML attributes with big integers are converted to javascript integer.

<a class="twitter-timeline" data-widget-id="403673174782406656" data-theme="dark" data-link-color="#f96e5b" data-border-color="#e8e8e8" data-tweet-limit="3" width="225" height="400" lang="EN">My Tweets</a>
<a className="twitter-timeline" data-widget-id={403673174782406656} data-theme="dark" data-link-color="#f96e5b" data-border-color="#e8e8e8" data-tweet-limit={3} width={225} height={400} lang="EN">My Tweets</a>

http://facebook.github.io/react/html-jsx.html

This causes problems as Javascript is able to handle integers up to +/- 9007199254740991.

ECMA Section 8.5 - Numbers

Numbers in Javascript are 64-bit floating point values, the largest exact integral value is 253-1, or 9007199254740991. In ES6, this is defined as Number.MAX_SAFE_INTEGER.
http://stackoverflow.com/a/307200/5834249

Activity

  1. changed the title [-]Bigints larger then the browser is able to handle (e.g. Twitter widget ID's)[/-] [+]Bigints larger than the browser is able to handle (e.g. Twitter widget ID's)a[/+] on Jan 28, 2016
  2. changed the title [-]Bigints larger than the browser is able to handle (e.g. Twitter widget ID's)a[/-] [+]Bigints larger than the browser is able to handle (e.g. Twitter widget ID's)[/+] on Jan 28, 2016
  3. Daniel15 commented on Apr 25, 2016

    @Daniel15
    Contributor

    Good catch, thanks. We've actually encountered similar issues at Facebook as our IDs are also 64-bit integers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions