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

[Bug]: Combinatorial inclusions don't render the correct regexp #1547

Open
1 task done
broguinn opened this issue Apr 11, 2024 · 2 comments
Open
1 task done

[Bug]: Combinatorial inclusions don't render the correct regexp #1547

broguinn opened this issue Apr 11, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@broguinn
Copy link

broguinn commented Apr 11, 2024

Would you like to work on a fix?

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

Current and expected behavior

We want to support Chrome 41 (the last 32-bit release) and Chrome versions 109+. I've tried writing this as a browserslist rule a few ways:

Browserslist Rule Produced Regexp
Chrome 41 or Chrome >= 109 and not Chrome 42-108 /Chrom(ium|e)\/(4[1-9]|[5-9]\d|\d{3,})\.\d+(\.\d+|)([\d.]+$|.*Safari\/(?![\d.]+ Edge\/[\d.]+$))/
Chrome 41 or Chrome >= 109 /Chrom(ium|e)\/(4[1-9]|[5-9]\d|\d{3,})\.\d+(\.\d+|)([\d.]+$|.*Safari\/(?![\d.]+ Edge\/[\d.]+$))/
Chrome >= 109 or Chrome 41 /Chrom(ium|e)\/(4[1-9]|[5-9]\d|\d{3,})\.\d+(\.\d+|)([\d.]+$|.*Safari\/(?![\d.]+ Edge\/[\d.]+$))/

And none of these regexps work against test UserAgent strings, as I would expect. I don't think my syntax is off. Is this a bug? If so, I'm happy to help resolve it.

Reproduction

Try generating regexps from combinatory browser versions.

browserslist-useragent-regexp version

v4.1.1

Possible solution

No response

@broguinn broguinn added the bug Something isn't working label Apr 11, 2024
@dangreen
Copy link
Member

@broguinn Hi.

  1. You can try to not use --allowHigherVersions, but then you should keep regex up to date with newer browsers
  2. You can help to implement --allowVersionsGap option, to apply "allowHigherVersions" only to last version, and strict match lower versions (--allowHigherVersions should not match missing gaps between versions #1498)

@dangreen
Copy link
Member

@broguinn Also 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
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants