Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use native whatwg instead? #675

Open
jimmywarting opened this issue Jul 11, 2021 · 2 comments
Open

Use native whatwg instead? #675

jimmywarting opened this issue Jul 11, 2021 · 2 comments

Comments

@jimmywarting
Copy link

const parseuri = require("parseuri");
const parseqs = require("parseqs");

How about replacing this two with just URL & URLSearchParams?

@darrachequesne
Copy link
Member

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

@jimmywarting
Copy link
Author

jimmywarting commented Jul 13, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants