grug / data-mocks

Library to mock local data requests using Fetch or XHR
MIT License
63 stars 12 forks source link

All of the IE11 bugs #47

Closed grug closed 4 years ago

grug commented 4 years ago

Describe the bug This library doesn't work with IE11 at all. This is due to the right polyfills not existing.

To Reproduce

  1. Create a new project with data-mocks included
  2. Attempt to load up a page that uses data-mocks in IE11
  3. Observe a million console errors

Expected behavior That this library works as intended with IE11

Additional context There will need to be a fair few polyfills added for this :(

github-actions[bot] commented 4 years ago

This issue hasn't received any attention in a while. Can it be closed or does it require more work?

Dinosys commented 4 years ago

it would still be nice if we could use this library in IE11...

grug commented 4 years ago

@Dinosys I'll see if I can give this a look today!

kieran-allen commented 4 years ago

I've got this working in a clean create-react-app project. I had to add the following polyfills to the project to get it working on ie11 without data-mocks included:

import "react-app-polyfill/ie11";
import "react-app-polyfill/stable";

However the only error I could attribute to data-mocks was Proxy is undefined which was caused by the fetch-mock library using Proxy which is unsupported by ie11.

This can be solved by a rollback to fetch-mock 6.5.2 https://github.com/wheresrhys/fetch-mock/issues/415#issuecomment-531505601

Definitely not seeing loads of console errors though.

N.B I've yet to test graphQL

github-actions[bot] commented 4 years ago

Hi there :) This issue hasn't received any attention in a while. Can it be closed or does it require more work?

Lapz commented 4 years ago

I've looked into IE11 and gotten this working and the main things that are needed are proxy-polyfill and the fetch-polyfill. The fetch-mock compatibility problems were [fixed]((https://github.com/github/fetch/pull/736) so IE 11 support should work out of the box. I've also created a repo that has the minimum changes needed for a CRA repo.