-
-
Notifications
You must be signed in to change notification settings - Fork 645
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
Improve browsercheck script #4839
Conversation
Well that's disappointing. I thought I was getting around the babel bug. We may have to just wait for the fix. |
i'm getting a new-to-me "Compiled with warnings." which i assume you know, |
nevermind the js UA is |
Cool, I'll test it out. I don't know what the "Compiled with warnings" thing is - I'm not seeing any warnings in the CLI output. |
Er, I guess I am seeing the warnings, but I don't know what they are. The toaster says something about immer (which we recently upgraded) but I don't see the full output. |
same yeah it's just toasting :| |
🤷♂ |
OK I added some Jest tests - feel free to throw more user agent strings at me. |
This reverts commit cd153ac.
var version = (browserName === 'ios_saf' | ||
? agent.os.version | ||
: agent.browser.version || agent.os.version || '' | ||
).split('.'); | ||
while (version.length > 0) { | ||
try { | ||
return browserslist(browserName + ' ' + version.join('.'))[0]; | ||
return browserName + ' ' + version.join('.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return browserName + ' ' + version.join('.'); | |
return `${browserName} ${version.join('.')}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for this file, which needs to stay es5-compatible.
// Detect anything based on chrome as if it were chrome | ||
var chromeMatch = /Chrome\/(\d+)/.exec(agent.ua); | ||
if (chromeMatch) { | ||
browser = 'chrome ' + chromeMatch[1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
browser = 'chrome ' + chromeMatch[1]; | |
browser = `chrome ${chromeMatch[1]}` |
} | ||
if (!supported) { | ||
console.warn( | ||
'Browser ' + browser + ' is not supported by DIM. Supported browsers:', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Browser ' + browser + ' is not supported by DIM. Supported browsers:', | |
`Browser ${browser} is not supported by DIM. Supported browsers:`, |
I may just want to switch to https://github.com/ElemeFE/obsolete-webpack-plugin later, since it seems like it's just a better (if much more complicated) version of this, but for now these changes help.