Giter VIP home page Giter VIP logo

Comments (18)

fred8617 avatar fred8617 commented on May 15, 2024 4

i need to add these polyfills
import 'promise-polyfill/src/polyfill';
import 'unfetch/polyfill';
import 'abortcontroller-polyfill'
import 'url-search-params-polyfill';

from use-http.

Akswii avatar Akswii commented on May 15, 2024 1

I had to do yarn build in use-http to make the test project work.

After adding the basic cra-app polyfill it seems like your ie-support fix branch is working. No need for me to polyfill anything extra. Tested in internet explorer 11. Nice! 🔥

from use-http.

alex-cory avatar alex-cory commented on May 15, 2024 1

I'm so excited

from use-http.

Akswii avatar Akswii commented on May 15, 2024 1

If people are going to start testing their react app on explorer then it will crash because of react issues before it reaches your fetch library.

from use-http.

alex-cory avatar alex-cory commented on May 15, 2024 1

So anyone trying to get this to work in IE, just add these lines to the top of your main/root App.js file.

import 'react-app-polyfill/ie11'
import 'react-app-polyfill/stable'

from use-http.

alex-cory avatar alex-cory commented on May 15, 2024

Will hop on this soon

from use-http.

alex-cory avatar alex-cory commented on May 15, 2024

@Fled8617 It sounds like you might be on a Microsoft computer since you're using IE. It's kind of a pain to test IE on mac. Would greatly appreciate if you could submit a PR!

from use-http.

alex-cory avatar alex-cory commented on May 15, 2024

I'm so excited I'm pretty sure I figured out a way to make this work.

from use-http.

alex-cory avatar alex-cory commented on May 15, 2024

This might be fixed as of #196
As soon as I get a windows machine I'll test this, but until then, anyone who has a windows machine who might be able to confirm that this works, please comment on here so I can close this.

from use-http.

Akswii avatar Akswii commented on May 15, 2024

It's not working for ie11 without the polyfills mentioned by @fred8617

from use-http.

alex-cory avatar alex-cory commented on May 15, 2024

Mind submitting a PR @Akswii? I removed the Proxy so it shouldn't be too far off.

from use-http.

Akswii avatar Akswii commented on May 15, 2024

Sorry, I don't have the time to look into it. Included the polyfills and got it working for my project. I appreciate your work @alex-cory 🙏

from use-http.

alex-cory avatar alex-cory commented on May 15, 2024

@Akswii so you didn't need to add a polyfill for Object.entries?

from use-http.

Akswii avatar Akswii commented on May 15, 2024

image
These are my current polyfills. I think a polyfill for Object.entries is included in one of the CRA polyfills.

from use-http.

Akswii avatar Akswii commented on May 15, 2024

image
I double checked, Object.entries is not polyfilled with the react-app-polyfill, nor in any of the other packages as far as I can tell. Not sure if this is helpful or not @alex-cory

from use-http.

alex-cory avatar alex-cory commented on May 15, 2024

@Akswii I'll make a branch, but could you pull down the branch and test it on your windows machine? Steps

git clone [email protected]:alex-cory/use-http.git
cd ./use-http
git checkout ie-support
yarn
yarn link
cd ..
create-react-app use-http-cra-app
cd ./use-http-cra-app
yarn
yarn link use-http
cd ../use-http
npm link ../use-http-cra-app/node_modules/react
npm link ../use-http-cra-app/node_modules/react-dom
cd ../use-http-cra-app
yarn start

Now just go into your use-http-cra-app/src/App.js and import use-http and test it in ie. I still need to make the ie-support branch so bare with me.

from use-http.

alex-cory avatar alex-cory commented on May 15, 2024

@Akswii when you say the basic cra-app polyfill, you are saying put these in the useFetch.ts?

import 'react-app-polyfill/ie11'
import 'react-app-polyfill/stable'

I might just put this in the documentation. If you need ie11 support, use these polyfills. Or... maybe I just import them, and just have them as devDependencies, then will just use them at build time. 🤔 Thoughts?

from use-http.

Akswii avatar Akswii commented on May 15, 2024

@alex-cory correct. Yes you can do that / just have a link or reference to the react docs as they cover this if you want to be ie11 compatible.

from use-http.

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.