-
Notifications
You must be signed in to change notification settings - Fork 13
Polyfills
At Facebook, we support older browsers, including IE8. We've had polyfills in place for a long time to allow us to write forward-thinking JS. This means we don't have a bunch of hacks scattered throughout our codebase and we can still expect our code to "just work". For example, instead of seeing +new Date(), we can just write Date.now(). Since the open source React is the same as what we use internally, we've carried over this philosophy of using forward thinking JS.
In addition to that philosphy, we've also taken the stance that we, as authors of a JS library, should not be shipping polyfills as a part of our library. If every library did this, there's a good chance you'd be sending down the same polyfill multiple times, which could be a sizable chunk of dead code. If your product needs to support older browsers, chances are you're already using something like es5-shim.
Array.isArrayArray.prototype.forEachArray.prototype.indexOfFunction.prototype.bindDate.now
All of these can be polyfilled using es5-shim.js from https://github.com/kriskowal/es5-shim.
In addition to the above...
-
Array.prototype.some(also ines5-shim.js) -
console.*- https://github.com/paulmillr/console-polyfill -
Object.create- Provided ines5-sham.js@ https://github.com/kriskowal/es5-shim