page.js
page.js copied to clipboard
browser support
going to drop support for basically all non-modern browsers like < IE 10 and expect devs to include polyfills.
- expect them to use the
History
polyfill - some sort of
.addEventListener()
polyfill
I used to like this idea. Now, not so much. I just spent the last week debugging and patching IE8 issues that are caused by shimming addEventListener, and these are not easy issues to debug, especially considering that the issues show up in 3rd party libraries that I'm not familiar with.
Many libs have event handling logic that tries to use addEventListener and falls back to other methods, but it is not possible to fully support all the features of addEventListener (for example, capturing) in IE8. In addition, I think the lib developers also assume that if addEventListener exists then it's not running in IE8 so they can get away with some shortcuts. Adding the shim breaks these libraries.
If you could just include a few more lines of code to fallback to attachEvent when addEventListener doesn't exist that would sure save me a lot of trouble.
Same issue as @spudly ... Seems that if I add a standard polyfill for addEventListener
my JS is breaking elsewhere. This pretty much means I cannot use page.js unless I tweak the library code, it seems.
Also the use of Array.isArray in page.js necessitates the use of a polyfill below ie9.
if(!Array.isArray) {
Array.isArray = function (vArg) {
return Object.prototype.toString.call(vArg) === "[object Array]";
};
}
So turns out the section of the Readme on IE8 is inaccurate, huh? https://github.com/visionmedia/page.js#support-in-ie8
Even if Page is not going to be useful in IE8 it would be great to have an accurate statement about that, to give devs an accurate picture of what they're getting into.
I hit the same stone with IE8 support. It would be great to have a clear documentatio section stating the recommended way of using page.js in projects which need to run in older Internet Explorer versions.