Use native whatwg instead?
jimmywarting opened this issue · comments
engine.io-client/lib/socket.js
Lines 5 to 6 in 9c79ba6
How about replacing this two with just URL & URLSearchParams?
That's a good remark, thanks! I think we would need to provide a polyfill for some browsers though:
Which makes this change less appealing. What do you think?
Related: #674
At least if they are available natively the polyfill would be GC'ed and wouldn't need to do a much JIT parsing
- Possible to conditionally import?
- Let developer decide if they wish to use a polyfill or not. Some are already dropping support for IE entirely, even microsoft themselves.
// README.md example
// Required for IE 11 support
globalThis.URL = globalThis.URL || require('url').URL
globalThis.URLSearchParams = globalThis.URLSearchParams || require('url').URLSearchParams
const engine = require('engine.io-client')
ppl could also use core-js or polyfill.io
i guess core-js is based on some browser usage config or something like that