Skip to content
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

refactor: Refactor how manifest flags are set #28686

Merged
merged 8 commits into from
Dec 12, 2024

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Nov 25, 2024

Description

The pieces of set-manifest-flags.ts related to getting flags have been moved to the new get-manifest-flags.ts module. This module will be used in a later PR by a script run during a CI workflow.

The migrated steps were also made asynchronous so that the asynchronous steps could be run in parallel rather than blocking the process.

Documentation has been added to the ManifestFlags type as well, in preparation for adding a new property in the next PR.

Open in GitHub Codespaces

Related issues

Related to #28685

Manual testing steps

N/A, no functional changes.

Screenshots/Recordings

N/A

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.

@Gudahtt Gudahtt force-pushed the refactor-manifest-flag-logic branch 2 times, most recently from f946a57 to ae35e76 Compare November 25, 2024 13:23
@Gudahtt Gudahtt changed the title refactor: Allow getting manifest flags without setting refactor: Refactor how manifest flags are set Nov 25, 2024
@Gudahtt
Copy link
Member Author

Gudahtt commented Nov 25, 2024

This refactor is in support of #28687

@Gudahtt Gudahtt force-pushed the refactor-manifest-flag-logic branch from ae35e76 to 625f942 Compare November 25, 2024 13:55
@Gudahtt Gudahtt marked this pull request as ready for review November 25, 2024 14:19
@Gudahtt Gudahtt requested review from kumavis and a team as code owners November 25, 2024 14:19
@Gudahtt Gudahtt force-pushed the refactor-manifest-flag-logic branch 3 times, most recently from 8899d67 to 2287421 Compare November 25, 2024 15:00
@metamaskbot
Copy link
Collaborator

Builds ready [8899d67]
Page Load Metrics (2248 ± 87 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint46826232157429206
domContentLoaded19452558221016680
load19552620224818287
domInteractive268340147
backgroundConnect12149393216
firstReactRender981851452613
getState887222211
initialActions01000
loadScripts14291864164112661
setupStore76115157
uiStartup218630342519208100
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [2287421]
Page Load Metrics (1785 ± 136 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint45028421715404194
domContentLoaded148628321749281135
load149728441785282136
domInteractive24101422311
backgroundConnect10130373014
firstReactRender1588362412
getState54913136
initialActions00000
loadScripts107824091318273131
setupStore65312136
uiStartup168031022005317152
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link
Contributor

@HowardBraham HowardBraham left a comment

Choose a reason for hiding this comment

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

Mostly just rewriting the comments to be clearer, and one actual bug.

Also, check-optional-e2e-trigger.ts should be run through Prettier.

app/scripts/lib/manifestFlags.ts Outdated Show resolved Hide resolved
app/scripts/lib/manifestFlags.ts Outdated Show resolved Hide resolved
app/scripts/lib/manifestFlags.ts Outdated Show resolved Hide resolved
development/lib/get-manifest-flag.ts Outdated Show resolved Hide resolved
@metamaskbot
Copy link
Collaborator

Builds ready [2f7df84]
Page Load Metrics (1726 ± 94 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint15032306172919292
domContentLoaded14742218169618287
load14822312172619594
domInteractive25169493617
backgroundConnect892302210
firstReactRender1699442814
getState48516209
initialActions01000
loadScripts10691643125314670
setupStore65613136
uiStartup165925961959259124
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Gudahtt and others added 3 commits November 27, 2024 20:32
The pieces of `set-manifest-flags.ts` related to _getting_ flags have
been moved to the new `get-manifest-flags.ts` module. This module will
be used in a later PR by a script run during a CI workflow.

The migrated steps were also made asynchronous so that the asynchronous
steps could be run in parallel rather than blocking the process.

Documentation has been added to the `ManifestFlags` type as well, in
preparation for adding a new property in the next PR.
@Gudahtt Gudahtt force-pushed the refactor-manifest-flag-logic branch from f28b0ac to 4b330e6 Compare November 28, 2024 00:02
HowardBraham
HowardBraham previously approved these changes Nov 28, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [afda5dd]
Page Load Metrics (2144 ± 133 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint39627842060475228
domContentLoaded165726832117263126
load166627732144276133
domInteractive25117472411
backgroundConnect86225199
firstReactRender155327115
getState61134101168
initialActions01000
loadScripts125421311621227109
setupStore74412105
uiStartup185834942461357171
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

*
* @returns Any manifest flags found
*/
export async function getManifestFlags(): Promise<ManifestFlags> {
Copy link
Contributor

Choose a reason for hiding this comment

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

We now have two functions in the code base named getManifestFlags that both end up getting the same flags, but in different ways (runtime vs compile time) :-/ One is async (this one), and the other must stay synchronous as it is designed to be blocking and used on app initialization.

Think you could rename one or the other?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. Seems better to rename this one. Maybe fetchManifestFlags or createManifestFlags?

Copy link
Contributor

Choose a reason for hiding this comment

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

Either is fine with me!

Copy link
Contributor

Choose a reason for hiding this comment

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

@Gudahtt @davidmurdoch @DDDDDanica I think this one should be called fetchManifestFlagsFromGitAndPR

Copy link
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
Copy link
Collaborator

Builds ready [77fcfbf]
Page Load Metrics (1675 ± 59 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint32318941530408196
domContentLoaded14501900165212158
load14951907167512359
domInteractive256937136
backgroundConnect86826168
firstReactRender1675312110
getState56412168
initialActions01000
loadScripts10481465122111354
setupStore665192010
uiStartup17192209190513465
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

HowardBraham
HowardBraham previously approved these changes Dec 12, 2024
HowardBraham
HowardBraham previously approved these changes Dec 12, 2024
@DDDDDanica
Copy link
Contributor

LGTM !

@metamaskbot
Copy link
Collaborator

Builds ready [9af5440]
Page Load Metrics (1624 ± 67 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint40420341502379182
domContentLoaded13972008160513665
load14092035162413967
domInteractive247335157
backgroundConnect66521168
firstReactRender1569382211
getState45711136
initialActions01000
loadScripts10061585121212861
setupStore6481094
uiStartup15912292184015976
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@HowardBraham HowardBraham added this pull request to the merge queue Dec 12, 2024
Copy link
Member Author

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

Thanks Howard for renaming, LGTM

Merged via the queue into main with commit edab215 Dec 12, 2024
77 checks passed
@HowardBraham HowardBraham deleted the refactor-manifest-flag-logic branch December 12, 2024 17:56
@github-actions github-actions bot locked and limited conversation to collaborators Dec 12, 2024
@metamaskbot metamaskbot added the release-12.10.1 Issue or pull request that will be included in release 12.10.1 label Dec 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.10.1 Issue or pull request that will be included in release 12.10.1 team-extension-platform team-wallet-framework
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants