Skip to content

[Due for payment 2025-08-15] Fix/rebuild unused style searcher #63192

Closed

Description

@roryabraham

Slack context: https://expensify.slack.com/archives/C01GTK53T8Q/p1748586074870539

The unused style searcher check was problematic:

  • was broken by a prettier change that updated formatting without changing any style usages
  • looks like it has some false positives (saying things are unused when they're not) as well as false negatives (missing some styles that are actually unused)
  • has some kind of memory leak and sometimes crashes

So as discussed in slack we are going to disable the check for now.

The scope of work in this issue is to fix the problems with the script and add it back (ideally in its own workflow, separate from prettier).

My suggestion is to drop the regex-based approach, and instead use the ts compiler API as described in this comment.

Activity

  1. roryabraham commented on Jun 6, 2025

    @roryabraham
    ContributorAuthor

    @gedu any thoughts on when you'll prioritize this?

  2. roryabraham commented on Jun 17, 2025

    @roryabraham
    ContributorAuthor

    @gedu bump - any update?

  3. gedu commented on Jun 18, 2025

    @gedu
    Contributor

    Hey, sorry for the delay, now I’m OOO, and had look into other issues, I will try soon

  4. gedu commented on Jun 30, 2025

    @gedu
    Contributor

    I'm slowly starting to look into this.

  5. gedu commented on Jul 2, 2025

    @gedu
    Contributor

    I created a TS file getting all the styles first

  6. gedu commented on Jul 4, 2025

    @gedu
    Contributor

    I'm close to have a working solution, fixing some corner cases, I will be off Mon and Tue, I will continue on Wed hope I can create a PR soon

  7. gedu commented on Jul 10, 2025

    @gedu
    Contributor

    I made great progress and found 86 unused styles. I tested adding one to a component, and the script removed it from the unused list. I will be doing more tests and cleaning up the code a bit.

    Image Image
  8. 26 remaining items

  9. roryabraham commented on Aug 5, 2025

    @roryabraham
    ContributorAuthor

    Opened #67826 to fix this

  10. changed the title [-][Due for payment 2025-07-28] Fix/rebuild unused style searcher[/-] [+]Fix/rebuild unused style searcher[/+] on Aug 5, 2025
  11. removed
    Awaiting PaymentAuto-added when associated PR is deployed to production
    on Aug 5, 2025
  12. roryabraham commented on Aug 5, 2025

    @roryabraham
    ContributorAuthor

    No payments will be due

  13. roryabraham commented on Aug 5, 2025

    @roryabraham
    ContributorAuthor

    That PR is merged and I confirmed it worked, so I think we can close this as it takes effect immediately.

  14. martasudol commented on Aug 6, 2025

    @martasudol
    Contributor
  15. roryabraham commented on Aug 6, 2025

    @roryabraham
    ContributorAuthor

    Looks like it's been fixed. It was passing on main when I merged the PR to enable it but I guess there was another PR that removed a style usage without removing the style that was merged afterward. Things should stabilize now, but just like any other static check like lint or TS the only way to avoid that completely is to require PRs to be up-to-date with main before merging them, which we don't want to do

  16. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Aug 8, 2025
  17. changed the title [-]Fix/rebuild unused style searcher[/-] [+][Due for payment 2025-08-15] Fix/rebuild unused style searcher[/+] on Aug 8, 2025
  18. melvin-bot commented on Aug 8, 2025

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  19. melvin-bot commented on Aug 8, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.90-11 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2025-08-15. 🎊

    For reference, here are some details about the assignees on this issue:

    • @gedu does not require payment (Contractor)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionImprovementItem broken or needs improvement.WeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions