-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
question: feature logic #58
Comments
@dargmuesli Yes, as you mention, this library actually for lazy people (like me 😆) who don't know what features i should to include. If you know what features should be include, i recommended to use original library from polyfill.io. |
Ok, so that logic is meant to load every polyfill for the browsers supported, thus limiting the features to the ones required for supported browsers only, but not to the features actually used. So older browsers are by that definition not meant to be supported at all, which could still be possible if required features were specified instead. Right? Then would you think we could add that to the README? |
@dargmuesli Almost correct, FYI, polyfill.io is service which load polyfill based on User-Agent. But when we want to use polyfill.io, we need to use some kind a preset which feature should be enable. That way i created polyfillist. it take all features from polyfill.io, check the feature requirement, and return the feature name which possible required in current browserslist config. But cons of it is some features might be not used in project at all. I agree with manual features defined. But for now, i have no plan how to do it. Because it's an array, and config with array always come with 3 possible cases:
|
Ok! I'd propose to keep the current behavior if no custom That would also enable projects specifying required features to potentially support browsers even older than the ones defined as supported in the browserslist definition, I imagine. |
I'm wondering how the feature logic is intended to work:
nupolyon/src/module.ts
Line 32 in e3d10e2
As I understand it, the code currently retrieves all features that are not implemented in browsers which are marked as supported using browserslist and limits the polyfills returned to the matching features.
Now, if that's right, why would you do that?
Isn't the feature list meant to list only the features actually required by website's source, not every feature unsupported by supported browsers?
Example:
Let's say I wanted to support "firefox 116".
npx polyfillist "firefox 116"
returns:Now, a browser that uses none of those features would request https://polyfill.io/v3/polyfill.min.js?features=HTMLInputElement.prototype.valueAsDate%2Ces2023%2CsetImmediate which results in 5kb (transferred 3kb).
Wouldn't it be better to expose
features
as a module option (detecting required features is surely a harder task to solve for now) so that module users can specify which features they use / polyfills they require?The text was updated successfully, but these errors were encountered: