Giter Club home page Giter Club logo

Comments (10)

WebReflection avatar WebReflection commented on June 17, 2024

while I think I might check the main file problem you mentioned, you really DON'T want to require ie8 - this is a template IE8 conditional comment only because not a single other browser should include this file at all, not even downloading its bytes.

here how to include

This is the part you need to place in your main template file

<!--[if IE 8]><script src="ie8.js"></script><![endif]-->

that's it

from ie8.

jessehattabaugh avatar jessehattabaugh commented on June 17, 2024

I'm building a SPA, so all my code is only ever downloaded once so I'm willing to pay the byte price.

If I wanted to keep all my IE polyfills in a separate file, it seems like Browserify would be a useful way to bundle them before delivery.

from ie8.

WebReflection avatar WebReflection commented on June 17, 2024

are you serving this file to every browser or you are using conditional comments?

This is the only way this file should be included:

<!--[if IE 8]><script src="ie8.js"></script><![endif]-->

Everything else is wrong … but .. if you are bundling all IE8 related scripts in one JS file and serving that at the top like this:

<!--[if IE 8]><script src="bundle.js"></script><![endif]-->

then you might be good to go with browserify … is this what you are trying to do?

from ie8.

WebReflection avatar WebReflection commented on June 17, 2024

.. try again, if you are sure what you are doing. 0.1.4 should give you the right file

from ie8.

jessehattabaugh avatar jessehattabaugh commented on June 17, 2024

Are you saying it's wrong because you think the transfer overhead is too much, or because the code itself isn't doing feature detection before executing the polyfill and therefore might interfere with non-IE8 browsers?

from ie8.

WebReflection avatar WebReflection commented on June 17, 2024

both … everything is wrong if you don't use conditional comments … there's no reason to even parse this file syntax in browsers that are not IE8

I've fixed the require thing … but you should NOT use browserify for this … I don't know why you want to do that

from ie8.

WebReflection avatar WebReflection commented on June 17, 2024

once again: https://github.com/WebReflection/ie8#how-to-include-the-project

from ie8.

WebReflection avatar WebReflection commented on June 17, 2024

also, the file starts with if (document.createEvent) return; which AFAIK is not available in IE8 and avoids double patching in IE8 … the reason there is a conditional comment for IE8 only is that:

  1. this polyfill is for IE8 only, everything else that does not support document.createEvent will break
  2. there is nothing wrong in using conditional comments, these are simply comments for every other browser but IE < 11 and IE will ignore if not exact match with version 8 as specified before
  3. why do you want to include this for every browser is a mystery to me … if it's about bundling inline you can still use the conditional comment and put the content in the script instead of using external src
  4. are you sure with this script IE8 will work ? there's more to add to an env to have IE8 working, like dom4 and / or others shims and polyfills, this is the top of the iceberg for IE8 support but the only one you want to put a part in a conditional comment

That being said, bug fixed as suggested, thanks.

from ie8.

jessehattabaugh avatar jessehattabaugh commented on June 17, 2024

All I want is to be able to use event.currentTarget without worrying that it will break IE8.

I'd rather transfer a polyfill that doesn't get executed than complicate my build process by adding another file to my webroot or add lines to my index.html. That's just where my priorities are, $ npm install ie8 --save-dev; require(); and get on with my job.

But maybe what I'm looking for is a smaller module that doesn't do quite as much. Thanks for the warning, and for addressing the issue so fast!

from ie8.

WebReflection avatar WebReflection commented on June 17, 2024

to my knowledge, the only browser that could break without conditional comments is IE7 and IE6 but I don't exclude some extra jurassic browser that will miserably fail too.

That being said, if you need "just e.currentTarget" you need an entirely patched event system, which is what this polyfill provides.

AFAIK there's nothing as standard and as tested as this one out there, I would not have spent time creating this in first place.

Last, but not least, your build system should be helping you making just a move file right away, and writing something you'll never have to change in the future in a single template wrapper with generic headers shouldn't be too hard job ;-)

Happy to help, I was just also proposing best practices since I've explained how to include and I was not expecting anyone to bring this in via browserify … too late since the npm package was there and it was actually not working as expected.

Best Regards

from ie8.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.