-
Notifications
You must be signed in to change notification settings - Fork 1.4k
chore: removed unused packages to reduce expected app size by ~1.13 MB
#6892
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
Open
divyanshu-patil
wants to merge
3
commits into
RocketChat:develop
Choose a base branch
from
divyanshu-patil:chore/cleanup
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+13
−22
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6603,6 +6603,11 @@ boolbase@^1.0.0: | |
| resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" | ||
| integrity sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww== | ||
|
|
||
| bowser@^2.13.1: | ||
| version "2.13.1" | ||
| resolved "https://registry.yarnpkg.com/bowser/-/bowser-2.13.1.tgz#5a4c652de1d002f847dd011819f5fc729f308a7e" | ||
| integrity sha512-OHawaAbjwx6rqICCKgSG0SAnT05bzd7ppyKLVUITZpANBaaMFBAsaNkto3LoQ31tyFP5kNujE8Cdx85G9VzOkw== | ||
|
|
||
| [email protected]: | ||
| version "0.1.0" | ||
| resolved "https://registry.yarnpkg.com/bplist-creator/-/bplist-creator-0.1.0.tgz#018a2d1b587f769e379ef5519103730f8963ba1e" | ||
|
|
@@ -12405,15 +12410,6 @@ prop-types@*, prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.7.2, prop-t | |
| object-assign "^4.1.1" | ||
| react-is "^16.13.1" | ||
|
|
||
| [email protected]: | ||
| version "15.7.2" | ||
| resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" | ||
| integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== | ||
| dependencies: | ||
| loose-envify "^1.4.0" | ||
| object-assign "^4.1.1" | ||
| react-is "^16.8.1" | ||
|
|
||
| property-expr@^2.0.4: | ||
| version "2.0.6" | ||
| resolved "https://registry.yarnpkg.com/property-expr/-/property-expr-2.0.6.tgz#f77bc00d5928a6c748414ad12882e83f24aec1e8" | ||
|
|
@@ -12583,7 +12579,7 @@ [email protected]: | |
| resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" | ||
| integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== | ||
|
|
||
| react-is@^16.13.1, react-is@^16.7.0, react-is@^16.8.1: | ||
| react-is@^16.13.1, react-is@^16.7.0: | ||
| version "16.13.1" | ||
| resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" | ||
| integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== | ||
|
|
@@ -14756,11 +14752,6 @@ [email protected], ua-parser-js@^0.7.33: | |
| resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-1.0.2.tgz#e2976c34dbfb30b15d2c300b2a53eac87c57a775" | ||
| integrity sha512-00y/AXhx0/SsnI51fTc0rLRmafiGOM4/O+ny10Ps7f+j/b8p/ZY11ytMgznXkOVo4GQ+KwQG5UQLkLGirsACRg== | ||
|
|
||
| [email protected]: | ||
| version "1.0.33" | ||
| resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-1.0.33.tgz#f21f01233e90e7ed0f059ceab46eb190ff17f8f4" | ||
| integrity sha512-RqshF7TPTE0XLYAqmjlu5cLLuGdKrNu9O1KLA/qp39QtbZwuzwv1dT46DZSopoUMsYgXpB3Cv8a03FI8b74oFQ== | ||
|
|
||
| ultron@~1.1.0: | ||
| version "1.1.1" | ||
| resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🧩 Analysis chain
🌐 Web query:
Bowser v2.13.1 getOS() getBrowser() return undefined properties API documentation💡 Result:
Short answer: In Bowser 2.x (including v2.13.1) getBrowser()/getOS() are instance methods on a Parser returned by Bowser.getParser(...) (or new Parser(ua)), not top-level static functions. Calling Bowser.getBrowser() / Bowser.getOS() (or calling instance methods before parsing or with an empty UA) will yield undefined. See docs and parser API.
What to do
const parser = Bowser.getParser(navigator.userAgent);
const browser = parser.getBrowser(); // { name?, version? }
const os = parser.getOS(); // { name?, version?, versionName? }
or use parser.getResult() for the full parsed object.
Sources
Sources:
[1] https://bowser-js.github.io/bowser/
[2] https://bowser-js.github.io/bowser/docs/parser.js.html
🌐 Web query:
Bowser getOSName() getBrowserName() getOSVersion() getBrowserVersion() methods API💡 Result:
Short answer: These are methods on Bowser's Parser object. Call Bowser.getParser(userAgent) (or Bowser.getParser(window.navigator.userAgent)), then use getBrowserName()/getBrowserVersion() to get the browser name and version, and getOSName()/getOSVersion() (or getOS()) to get OS name/version. Example:
Notes: methods live on the Parser instance (Bowser.getParser(...)). See Bowser docs and the Parser API for details and examples. [1][2]
Sources:
[1] Bowser docs (overview / usage).
[2] Bowser Parser API (getBrowserName, getBrowserVersion, getOSName, getOSVersion, getOS).
🌐 Web query:
Bowser v2.13.1 parser getOS() undefined properties when name version not available💡 Result:
Summary: In Bowser v2.13.x the Parser.getOS() can return an empty object ({} ) when no OS parser matches, and Parser.getOSName() converts the possibly-undefined name with String(name).toLowerCase() — which produces the literal string "undefined" instead of an empty string. This explains why you see undefined properties / the string "undefined" when name/version aren't available. (bowser-js.github.io)
Fix/workarounds:
getOSName(toLowerCase){ const name = this.getOS().name || ''; return toLowerCase ? name.toLowerCase() : name; }
(Or wrap with String(name || '')). This prevents "undefined". (bowser-js.github.io)
If you want, I can draft a small PR patch or a one-line patch you can apply to v2.13.1.
Citations:
Avoid using Bowser's convenience methods as fallbacks; they have a bug that produces the string "undefined".
The current fallback pattern (
ua.getOS().name ?? ua.getOSName()) attempts to handle cases wheregetOS().nameis undefined, but Bowser v2.13.1's convenience methods (getOSName(),getBrowserName(), etc.) have a bug: when the properties are unavailable, they return the literal string"undefined"instead of an empty string. This causesparams.osandparams.browserto contain invalid values like"undefined 116.0".Instead, use null coalescing with empty strings:
Or apply
.trim()to the final string to clean up extra spaces if either property is missing.🤖 Prompt for AI Agents