Coder Social home page Coder Social logo

ie11 support about instant.page HOT 18 CLOSED

instantpage avatar instantpage commented on May 20, 2024
ie11 support

from instant.page.

Comments (18)

isaachinman avatar isaachinman commented on May 20, 2024 1

The fork is available here. You can see the change set required to add transpilation here.

You can install this es5 fork via npm here. No plans to distribute via a CDN.

@cekvenich This package immediately executes on the global scope. There's no API and no need for typing whatsoever, unless I've misunderstood you?

from instant.page.

dieulot avatar dieulot commented on May 20, 2024

No.

from instant.page.

isaachinman avatar isaachinman commented on May 20, 2024

@dieulot Just came across this after having to do quite a bit of unnecessary detective work.

You're shipping raw, untranspiled ES6 source, without semicolons, via both npm and your CDN. This goes against all best practices in the JavaScript open source / dep world.

Are you open to adding an industry-standard build step, via Babel or Rollup? It is extremely easy with @babel/preset-env to choose sensible targets and never have to worry about things again, especially with a source code this small.

If you are, I am happy to contribute that. If you aren't, I'll be forking this repo and distributing it via a proper ES5/CJS target, for anyone that's interested.

from instant.page.

dieulot avatar dieulot commented on May 20, 2024

I’m not interested in delivering an ES5 version. The usual way to load instant.page is as a module, which handles ES6.

If you want to serve it as ES5, I assume it is for bundling. I’m not familiar with bundlers, but don’t they handle ES6 to ES5 transpilation? Otherwise, why do you want ES5?

from instant.page.

isaachinman avatar isaachinman commented on May 20, 2024

At the present moment, the state of the JavaScript world is such that dependencies are not transpiled, and therefore users expect deps to be distributed to some reasonable ECMAScript target that will suit their needs.

This is a massively imperfect system, and hopefully we can move towards a transpiling-deps industry wide approach in the future, but that's where we're at now.

The assumption that you are making here is that all browsers which support prefetch also support ES6, which is not true. IE11, for example, supports prefetch but does not support modules via a script tag.

It is very, very trivial to add a transpilation step to your npm publish script. I'm not sure how you're deploying to Cloudflare, but that can be set up similarly. Respectfully, I was quite shocked to see a package with 3k+ stars is shipping ES6 without semicolons.

Again, I'm happy to contribute this work if you'll merge it.

from instant.page.

dieulot avatar dieulot commented on May 20, 2024

Thanks for your explanation. You’re the first to ask for this so there’s little demand, so I’m not interested in incorporating transpiling. Please do such a fork, I’m curious to see how that would be implemented.

I’m not sure that IE11 has support, caniuse claims Edge has support but it doesn’t. I’m not worried about not supporting IE11 as it’s a small percentage of usage and it is shrinking.

from instant.page.

cekvenich avatar cekvenich commented on May 20, 2024

He would at min. be second, since this is my ticket :-). IE11 has market share ~6%, so I can't tell a business that they'll have 6% less revenue/market.
So I'll use the fork, please tell me where it will be. (aside, I use typescript, since it does es5 or 6 and w/o modules/imports, just CDN). Cheers/TIA.

from instant.page.

dieulot avatar dieulot commented on May 20, 2024

Thank you.

from instant.page.

cekvenich avatar cekvenich commented on May 20, 2024

Will try. Of course putting it on npm puts it on CDN such as jsdeliver.

from instant.page.

cekvenich avatar cekvenich commented on May 20, 2024

@isaachinman line 91
IE 11 complains about the arrow function. Can you please use normal function please, release and let me know so I can test again.

from instant.page.

isaachinman avatar isaachinman commented on May 20, 2024

@cekvenich Not sure what you're talking about. Install the dep via npm: npm i instant.page.es5. You should be consuming instantpage.es5.js. It's ES5, and there are certainly no arrow functions.

If you have further problems, you can feel free to open an issue in the fork - it's not related to this repo.

from instant.page.

cekvenich avatar cekvenich commented on May 20, 2024

@isaachinman :

  1. Your repo has no issue tracking.
  2. Above I reported the line # of the error: https://github.com/isaachinman/instant.page/blob/master/instantpage.js
    You should check before responding.
  3. Clearly you did not test this.
    So after you enable issues and test ie11. let me know and I may check again. Or may not.

from instant.page.

isaachinman avatar isaachinman commented on May 20, 2024

I've enabled issues.

The code is transpiled before publishing to the registry. The source itself is identical to this repo. The ES5 transpiled code is gitignored.

This is an industry standard approach.

Install via npm, or consume instantpage.es5.js via jsdeliver or whatever you want.

I suggest you employ politeness when people do you favours in the future!

from instant.page.

isaachinman avatar isaachinman commented on May 20, 2024

Here's a direct link, by the way.

from instant.page.

cekvenich avatar cekvenich commented on May 20, 2024

@isaachinman how are you doing me a favor?

from instant.page.

dieulot avatar dieulot commented on May 20, 2024

Note that transpiling isn’t enough, I use Element.closest which isn’t supported in IE.

Later on I plan to check to see if IntersectionObserver is implemented, and if it’s not fail silently. So a version of instant.page compatible with IE would need to diverge even more from the current source code.

from instant.page.

isaachinman avatar isaachinman commented on May 20, 2024

Yes, there's a difference between core ECMAScript and certain language features. I've tested the linked version above in IE11 via BrowserStack and can confirm it works.

from instant.page.

cekvenich avatar cekvenich commented on May 20, 2024

@dieulot I do polly fills to support custom elements already, including the 2 you mentioned. If there are others please let us know.

from instant.page.

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.