-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Unused styles translation script #26969
Unused styles translation script #26969
Conversation
…ent moments, removed unused styles
Working on the conflicts, also those conflicts introduced a new way to create styles, so I have to update the script |
# Conflicts: # package.json # src/styles/styles.js
Almost have the new style format working with the script |
@fedirjh do you think you'll be able to review this today? |
# Conflicts: # src/styles/styles.js
@luacmartins Comments fixed and conflicts solved |
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.
LGTM!
Since this doesn't touch any used code, I'll merge it without C+ approval |
Reviewer Checklist
Screenshots/VideosN/A we're just removing unused code WebMobile Web - ChromeMobile Web - SafariDesktopiOSAndroid |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/luacmartins in version: 1.3.73-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.73-1 🚀
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 1.3.74-0 🚀
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 1.3.74-3 🚀
|
Details
Bash scripts that you can run manually and will run on the GH flow to look for unused styles.
It collects all the keys from
styles.js
and also fromstyles/utilities/
It goes through the whole codebase, looking for the usage of
styles.XXXX
or usage of any of theutilities
.What does it look for?
it will look for the usage of
styles.fullscreenCardMediumScreen
so iffullscreenCardMediumScreen
is deleted, it will highlight it, if you just delete theleft
or any of the inner fields it will not mark the styles as unused.if that style is being used like
styles.pv1.paddingVertical
, I will assume that the parentpv1
is being used so it will marked as used.and others for direct usage, like
Example:
It will ignore the objects inside of
pickerSmall
and will try to look into the codebase the usage ofstyles.pickerSmall
To run the script you have to do
npm run gh-actions-unused-styles
Also will run as part of the
lint GH workflow
when a PR is created.style_bash_script_result.mp4
Fixed Issues
$ #22212
PROPOSAL: -
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android