Giter Club home page Giter Club logo

Comments (9)

gingerlime avatar gingerlime commented on September 17, 2024

@joker-777 what do you think?

from alephbet.

joker-777 avatar joker-777 commented on September 17, 2024

@gingerlime Super interesting article. I wasn't aware of this behavior. In kenhub we use whatwg-fetch as a polyfill for fetch but we only load it when it doesn't exist. I would simply use fetch + keepalive and let the "developer" who uses Alephbet decide if he needs a polyfill or not.

from alephbet.

gingerlime avatar gingerlime commented on September 17, 2024

So users can load a polyfill and the Alephbet code would automatically be able to use it?

from alephbet.

joker-777 avatar joker-777 commented on September 17, 2024

That's kind of what we do. We load this js code very early inline which checks if fetch or other methods exist and if one of them doesn't then we inject this script.

from alephbet.

joker-777 avatar joker-777 commented on September 17, 2024

Ah, and yes, once loaded, it is available for all js libraries.

from alephbet.

gingerlime avatar gingerlime commented on September 17, 2024

Okay, but this feels like quite a lot of work for a user of Alephbet to have to worry about. I don't mind having a minimum-browser support, but then it needs to be documented clearly. Otherwise, some people might try to use it and will just get an error and won't necessarily know why. Or won't even know it can error in older browsers, and then their data is skewed.

The current JS fallback supports very old browsers, so we can also keep it like we do already (we check for jquery, but we can check if fetch is available instead). I think it's nicer to offer older-browser support out of the box if it's not super complicated for us to do that.

from alephbet.

joker-777 avatar joker-777 commented on September 17, 2024

I disagree. You would make the package bigger than necessary. Especially in the case of then we shouldn't worry about it because it is widely supported except for IE. If someone wants to support IE then they will use anyway polyfills which don't have to be by the way so "complicated" as we do it. They simply could include them and that's it.

from alephbet.

gingerlime avatar gingerlime commented on September 17, 2024

We agree then :) I said it's fine to have a minimum browser support, but we just need to communicate it very clearly. And the code won't be much bigger even if we keep the fallback. We're talking about maybe 5 lines of code?

from alephbet.

joker-777 avatar joker-777 commented on September 17, 2024

Ah, ok, yes that's true. It doesn't save a lot of code.

from alephbet.

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.