Skip to content

refactor: ENABLE_MV3 flag cleanup#26059

Merged
HowardBraham merged 21 commits intodevelopfrom
mv3-flag-cleanup
Aug 1, 2024
Merged

refactor: ENABLE_MV3 flag cleanup#26059
HowardBraham merged 21 commits intodevelopfrom
mv3-flag-cleanup

Conversation

@HowardBraham
Copy link
Copy Markdown
Contributor

@HowardBraham HowardBraham commented Jul 23, 2024

Description

The way that the ENABLE_MV3 flag was processed was kind of a mess. Sometimes it wasn't checking both options of 'true' and undefined, sometimes it was only checking browser.runtime.getManifest().manifest_version, and it was always loquacious.

This PR centralizes it and defines it as:

const runtimeManifest =
  global.chrome?.runtime.getManifest() || global.browser?.runtime.getManifest();

const isManifestV3 = runtimeManifest
  ? runtimeManifest.manifest_version === 3
  : process.env.ENABLE_MV3 === 'true' || // Tests on Node.js processes
    process.env.ENABLE_MV3 === undefined;

Open in GitHub Codespaces

Related issues

Supersedes: #25242
(@legobeat started working on an aspect of this, but it got stale. This PR incorporates his work.)

Manual testing steps

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@github-actions
Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-accounts-framework Accounts team label Jul 23, 2024
@HowardBraham HowardBraham removed the team-accounts-framework Accounts team label Jul 24, 2024
@HowardBraham HowardBraham changed the base branch from develop to fix-multipart-errors July 25, 2024 04:22
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [3bb6394]
Page Load Metrics (259 ± 251 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint702861194421
domContentLoaded1085332110
load411963259524251
domInteractive1085332110
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 214 Bytes (0.01%)
  • ui: 0 Bytes (0.00%)
  • common: -110 Bytes (-0.00%)

@HowardBraham HowardBraham added the type-tech-debt Technical debt label Jul 26, 2024
Base automatically changed from fix-multipart-errors to develop July 29, 2024 16:07
@codecov
Copy link
Copy Markdown

codecov bot commented Jul 30, 2024

Codecov Report

Attention: Patch coverage is 54.54545% with 5 lines in your changes missing coverage. Please review.

Project coverage is 69.97%. Comparing base (3f09c80) to head (7c61ca7).
Report is 2 commits behind head on develop.

Files Patch % Lines
...tform-notifications/push-platform-notifications.ts 0.00% 3 Missing ⚠️
shared/modules/mv3.utils.js 75.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #26059      +/-   ##
===========================================
- Coverage    69.97%   69.97%   -0.00%     
===========================================
  Files         1411     1411              
  Lines        49995    50000       +5     
  Branches     13805    13809       +4     
===========================================
+ Hits         34981    34984       +3     
- Misses       15014    15016       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@HowardBraham HowardBraham marked this pull request as ready for review July 30, 2024 01:01
@HowardBraham HowardBraham requested review from a team and kumavis as code owners July 30, 2024 01:01
@DDDDDanica
Copy link
Copy Markdown
Contributor

Looks solid to me 👍🏻 thanks for the refactor !

legobeat
legobeat previously approved these changes Jul 31, 2024
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [c180fad]
Page Load Metrics (255 ± 251 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint693071154823
domContentLoaded10195314019
load431902255523251
domInteractive10195314019
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 214 Bytes (0.01%)
  • ui: 0 Bytes (0.00%)
  • common: -110 Bytes (-0.00%)

@hjetpoluru
Copy link
Copy Markdown
Contributor

hjetpoluru commented Aug 1, 2024

@HowardBraham, all the tests are passing and code looks good. I ran the below tests using the below commands.

yarn
yarn start:test
yarn test:e2e:single test/e2e/tests/account/lockdown.spec.js --browser=chrome
yarn test:e2e:single test/e2e/tests/account/import-flow.spec.js --browser=chrome
yarn
ENABLE_MV3=false yarn start:test
ENABLE_MV3=false yarn test:e2e:single test/e2e/tests/account/lockdown.spec.js --browser=firefox 
ENABLE_MV3=false yarn test:e2e:single test/e2e/tests/account/import-flow.spec.js --browser=firefox

Could you make the changes to these files too.
shared/modules/mv3.utils.js
test/e2e/background-socket/socket-background-to-mocha.ts
Screenshot 2024-07-31 at 10 01 21 PM

@HowardBraham HowardBraham dismissed stale reviews from legobeat and DDDDDanica via 87180b4 August 1, 2024 02:09
@hjetpoluru hjetpoluru added the team-notifications-deprecated DEPRECATED: please use "team-assets" instead label Aug 1, 2024
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [0088293]
Page Load Metrics (443 ± 323 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint653701409947
domContentLoaded973242010
load401681443674323
domInteractive973242010
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 345 Bytes (0.01%)
  • ui: 0 Bytes (0.00%)
  • common: -110 Bytes (-0.00%)

Copy link
Copy Markdown
Contributor

@hjetpoluru hjetpoluru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Aug 1, 2024

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [7c61ca7]
Page Load Metrics (568 ± 412 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint722491214522
domContentLoaded10182313718
load482387568858412
domInteractive10182313718
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 345 Bytes (0.01%)
  • ui: 0 Bytes (0.00%)
  • common: -110 Bytes (-0.00%)

@HowardBraham HowardBraham merged commit 80ac1b2 into develop Aug 1, 2024
@HowardBraham HowardBraham deleted the mv3-flag-cleanup branch August 1, 2024 15:23
@github-actions github-actions bot locked and limited conversation to collaborators Aug 1, 2024
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Aug 1, 2024
@metamaskbot metamaskbot added the release-12.4.0 Issue or pull request that will be included in release 12.4.0 label Aug 1, 2024
@gauthierpetetin gauthierpetetin added release-12.3.0 Issue or pull request that will be included in release 12.3.0 and removed release-12.4.0 Issue or pull request that will be included in release 12.4.0 labels Sep 11, 2024
@HowardBraham HowardBraham added contributor experience An issue that impacts, or planned improvement to, the contributor experience. and removed team-contributor-experience labels Oct 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

contributor experience An issue that impacts, or planned improvement to, the contributor experience. release-12.3.0 Issue or pull request that will be included in release 12.3.0 team-notifications-deprecated DEPRECATED: please use "team-assets" instead type-tech-debt Technical debt

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants