Skip to content

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

Open
@optimalisatie

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

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