Skip to content

feat: Add --features option to legacy build system CLI #33485

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

rekmarks
Copy link
Member

@rekmarks rekmarks commented Jun 5, 2025

Description

Teams have been testing features in different build types by modifying builds.yml without committing the changes. To improve upon this sorry situation, this PR adds a --features option to the legacy build system CLI. You can specify any feature defined under the top-level features property of builds.yml. Redundantly specified features are permitted.

The "active features" are implemented as a frozen array private to development/build/config.js. This array is set once, by setActiveFeatures() during parseArgv() in development/build/index.js. The array can only be set once. Rather than threading the active features through the various build system functions, we always retrieve mutable copies of the cached active features via getActiveFeatures().

Open in GitHub Codespaces

Manual testing steps

Additional features

Any feature not in the active build type will do, but for example:

  1. yarn start --features bitcoin
  2. Wait for the build to finish
  3. Open the dev console for the background service worker
  4. Observe errors in the background console about various Bitcoin things

Redundant features

  1. yarn start --features build-main
  2. This should behave identically to yarn start

Non-existent features

  1. yarn start --features foo
  2. This should error

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.

@metamaskbot metamaskbot added team-ocap-kernel The Ocap Kernel team INVALID-PR-TEMPLATE PR's body doesn't match template labels Jun 5, 2025
@rekmarks rekmarks marked this pull request as ready for review June 5, 2025 00:15
@rekmarks rekmarks requested a review from Gudahtt June 5, 2025 00:15
@metamaskbot
Copy link
Collaborator

Builds ready [25539ed]
UI Startup Metrics (1232 ± 62 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1232108313776212811343
load106894412156411171181
domContentLoaded106294012096411131163
domInteractive1713104101629
firstPaint74079116342110881141
backgroundConnect84305823
firstReactRender20154042128
getState1456481925
initialActions001001
loadScripts81370195362865915
setupStore85324812
WebpackHomeuiStartup21261571263323222712555
load16581235200517917751969
domContentLoaded16511231199617817701957
domInteractive15116091345
firstPaint1656238564216292
backgroundConnect22106592444
firstReactRender14244364106219347
getState144332331329
initialActions315134
loadScripts16481230198517617681946
setupStore266314581744
FirefoxBrowserifyHomeuiStartup13711186195613014231599
load12151057150310712871441
domContentLoaded12141056150210712871441
domInteractive983637536109138
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2313302292145
firstReactRender23203422428
getState10418118820
initialActions0036401
loadScripts11961039147910412651418
setupStore73878612
WebpackHomeuiStartup16471391230617817442031
load14281216197516815121829
domContentLoaded14271216197516815121828
domInteractive77381512086112
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect23169482431
firstReactRender43315444650
getState136197201032
initialActions102111
loadScripts14071200195316614921805
setupStore1058412817
Benchmark value 1063 exceeds gate value 1061 for chrome browserify home mean domContentLoaded
Benchmark value 24 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Benchmark value 2556 exceeds gate value 2454 for chrome webpack home p95 uiStartup
Benchmark value 1647 exceeds gate value 1615 for firefox webpack home mean uiStartup
Benchmark value 1428 exceeds gate value 1380 for firefox webpack home mean load
Benchmark value 1428 exceeds gate value 1380 for firefox webpack home mean domContentLoaded
Benchmark value 44 exceeds gate value 38 for firefox webpack home mean firstReactRender
Benchmark value 1407 exceeds gate value 1360 for firefox webpack home mean loadScripts
Benchmark value 2031 exceeds gate value 1935 for firefox webpack home p95 uiStartup
Benchmark value 1829 exceeds gate value 1660 for firefox webpack home p95 load
Benchmark value 1828 exceeds gate value 1660 for firefox webpack home p95 domContentLoaded
Benchmark value 1805 exceeds gate value 1630 for firefox webpack home p95 loadScripts
Sum of mean exceeds: 183ms | Sum of p95 exceeds: 716ms
Sum of all benchmark exceeds: 899ms

Bundle size diffs
  • background: 0 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 0 Bytes (0%)

@metamaskbot
Copy link
Collaborator

Builds ready [fc59f41]
UI Startup Metrics (1206 ± 62 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1206108713906212471322
load103791912055910711146
domContentLoaded102991311996010631138
domInteractive16134051528
firstPaint679134121641210461135
backgroundConnect94447925
firstReactRender22156382240
getState1453771928
initialActions001001
loadScripts78167095259816896
setupStore84434811
WebpackHomeuiStartup21311673262924123062541
load16631287216219917831978
domContentLoaded16561282215019817731967
domInteractive161184111345
firstPaint1686641472189324
backgroundConnect2510326312641
firstReactRender14544364112301351
getState1143951221
initialActions315134
loadScripts16531281213919717701961
setupStore2863266018264
FirefoxBrowserifyHomeuiStartup13341144170910313961538
load11881021155910412571404
domContentLoaded11881021155810412571403
domInteractive993727033112169
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect20148391930
firstReactRender23203222328
getState84688810
initialActions001001
loadScripts11701005153910412341380
setupStore64222610
WebpackHomeuiStartup15651368210916316421970
load13631187193415314431727
domContentLoaded13621186193415314431727
domInteractive81572132487134
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect21154662239
firstReactRender41275654450
getState84304818
initialActions102111
loadScripts13451171191815314241706
setupStore85596812
Benchmark value 26 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Benchmark value 2541 exceeds gate value 2454 for chrome webpack home p95 uiStartup
Benchmark value 264 exceeds gate value 65 for chrome webpack home p95 setupStore
Benchmark value 42 exceeds gate value 38 for firefox webpack home mean firstReactRender
Benchmark value 1970 exceeds gate value 1935 for firefox webpack home p95 uiStartup
Benchmark value 1727 exceeds gate value 1660 for firefox webpack home p95 load
Benchmark value 1727 exceeds gate value 1660 for firefox webpack home p95 domContentLoaded
Benchmark value 1706 exceeds gate value 1630 for firefox webpack home p95 loadScripts
Sum of mean exceeds: 4ms | Sum of p95 exceeds: 539ms
Sum of all benchmark exceeds: 543ms

Bundle size diffs
  • background: 0 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 0 Bytes (0%)

@rekmarks rekmarks added the area-buildSystem related to our build system label Jun 5, 2025
@github-project-automation github-project-automation bot moved this to Needs dev review in PR review queue Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-buildSystem related to our build system INVALID-PR-TEMPLATE PR's body doesn't match template team-ocap-kernel The Ocap Kernel team
Projects
Status: Needs dev review
Development

Successfully merging this pull request may close these issues.

2 participants