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

--allowHigherVersions should not match missing gaps between versions #1498

Open
1 task
LinqToException opened this issue Aug 14, 2023 · 1 comment
Open
1 task
Labels
enhancement New feature or request

Comments

@LinqToException
Copy link

LinqToException commented Aug 14, 2023

Would you like to work on this feature?

  • Check this if you would like to implement a PR, we are more than happy to help you go through the process.

What problem are you trying to solve?

When using --allowHigherVersions, (purposedly) missed browser versions are still matched. For example, chrome 114, chrome 116 also matches chrome 115. Basically, it uses the lowest matching browser version, then allows anything newer.

Real example: Queries that include Firefox ESR and some form of non-ESR Firefox (e.g. last 1 firefox version, Firefox ESR) will produce overmatching regular expressions when called with --allowHigherVersions:

Firefox\/(10[2-9]|1[1-9]\d|[2-9]\d{2}|\d{4,})\.\d+(\.\d+|)

which will match any Firefox >= 102 (the older ESR version), although the last 1 firefox version would be 116.

npx browserslist lists these appropriately:

firefox 115
firefox 102

with 116 being the main one, and 102/115 being ESRs.

Describe the solution you'd like

When using --allowHigherVersions or using another switch, base the "higher versions" on the highest available version, i.e. allow gaps in-between (unless such a behaviour was perhaps explicitly asked for).

In this case, it should be something like 102|11[5-9]|1[2-9]\d|[2-9]\d{2}|\d{4,}

Describe alternatives you've considered

Right now, it would be necessary to keep one regex per "separated browser group". However, since Firefox ESRalready returns firefox 102 and firefox 115, this wouldn't work, and require three manual checks (one against firefox 102, one against firefox 105, and another against the other browsers).

Documentation, Adoption, Migration Strategy

No response

@dangreen
Copy link
Member

@LinqToException Hi. You can fund me to help me spend more time on this project. It will help me to implement this feature early as possible.

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

No branches or pull requests

2 participants