Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

JKB's avatar
Level 1

Laravel + Vue, recommandations about using polyfill for Internet Explorer

Hello, I have no experience with Vue, but for a project with Laravel, I was able to code a group chat with Vue and pusher, by following tutorials.

When testing on Internet Explorer, the problems started (what a surprise!).

After some research, not easy (I have the impression that there are not many sources for VueJs, compared to Laravel), I was able to solve these problems by installing polyfill: Babel and window.fetch in this case.

Install

npm install whatwg-fetch --save
npm install --save babel-polyfill

npm run dev

then edit resources/assets/js/app.js, but I'm not sure it's the best place to import

// resources/assets/js/app.js

import "babel-polyfill";
import 'whatwg-fetch';

require('./bootstrap');
...

It works, but I do not really understand what I did, I just installed and tested. If I say that this is a way to fill the gaps in the javascript version of internet explorer by emulating some missing functions with these polyfill, is this correct?

I have the impression that since I installed these polyfill, the application is slower, less responsive, under chrome or firefox, but without being really sure, maybe it's just an excess of paranoia .

What do you think ?

Is it relevant to disable these polyfill if we are not under internet explorer, and if so, how?

0 likes
2 replies
topvillas's avatar

The polyfill SHOULD check for the feature in the browser and only use the polyfill if needed. No work needed by you on that front.

I don't know but I suspect you're being paranoid about it slowing down Chrome and Firefox.

Nash's avatar

Well, you are including a lot more JavaScript overall. That said, I haven't noticed any significant slowdowns myself.

If you are worried about file size and performance and know exactly which polyfills you are going to need, then you could always manually install just those (e.g. es6-promise or whatever it is you need) or use something like Polyfill.io

Please or to participate in this conversation.