feat(insights): Scope duplicate file detection by app component (EME-884)#570
feat(insights): Scope duplicate file detection by app component (EME-884)#570cameroncooke wants to merge 1 commit intomainfrom
Conversation
Partition files and directories by component scope (main app, watch app, App Clip) before running duplicate detection so that files intentionally duplicated across separate embedded app bundles are not flagged as false positives. When no components are provided, all files fall into a single scope preserving backward compatibility. Co-Authored-By: Claude <noreply@anthropic.com>
trevor-e
left a comment
There was a problem hiding this comment.
Nice, thanks for fixing. So sounds like Watch/ and AppClip/ each have their own Frameworks/ directories and cannot share with the main app bundle? That makes sense in my head since I think they would have different code signing and such in order to run independently from the main app. And I'm assuming symlinking between them would also not work at all?
I'm a bit confused by your before/after screenshots, should the eduardo file not show up as red after your fix?
@trevor-e so watch and app clips are their own .app bundles as you say they are bundled in the main bundle but installed separately. I'm not aware of any strategy to share resources, symlinks may work but this would be pretty non-standard I expect. Regarding the screenshots in the before image the insights table shows duplicate files. In second it shows no flagged duplicates. Also app savings total is now significantly lower as it's not more representative of actual savings you can make not false positives that we had previously. Lastly the images all still red because they are flagged as optimisable. |
Scope duplicate file/directory detection by app component so that files intentionally duplicated across separate embedded bundles (main app, watch app, App Clip) are not flagged as false-positive duplicates.
Files and directories are partitioned by component scope before running the existing duplicate detection algorithm per scope. The main artifact (path
.) maps to a default scope, and sub-components (watch, clip) each get their own. When no components are provided the entire file set falls into a single scope, preserving backward compatibility.Also modernises type hints (
Dict/List/Set→ builtins,Sequencefromcollections.abc) and adds a backward-compat regression test.Before
After
Linear EME-884