Skip to content

build: Add build type extensions #32724

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

Merged
merged 13 commits into from
May 20, 2025
Merged

build: Add build type extensions #32724

merged 13 commits into from
May 20, 2025

Conversation

rekmarks
Copy link
Member

@rekmarks rekmarks commented May 8, 2025

Description

The Ocap Kernel team needs a new build type in order to begin integrating with the extension. This build should be identical to Flask, except that it will include one additional feature. To accomplish this without maintaining a configuration for a single build twice, this PR introduces a new field extends to build types in builds.yml. A build type can thereby extend another build type by specifying its name to the buildType.<name>.extends property.

The format of builds.yml is otherwise unaffected, with one exception: it used to be possible to specify a env property on features.<name>. Since we didn't do this in practice, this optional field is no longer recognized.

As part of this change, we DRY up the loading of builds.yml in the old and new build systems. Due to its more extensive validation, the old system's JavaScript implementation is used. The relevant file, development/lib/build-type.js is now reasonably unit-tested. Passing tests were written both before and after the changes made to that file in this PR. Several improvements to the validation of builds.yml was made during the writing of tests, mostly related to describing configuration errors. All types related to builds.yml are now exported from build-types.js, and this file is type checked.

Why not YAML merge keys?

We forego the use of YAML's "merge keys" feature since it cannot be used to merge lists, and refactoring builds.yml to only use dictionaries would require a significant refactor of the original build system. Although this refactor is desirable, we cannot justify it at this time due to the JavaScript source code and low test coverage of the original build system.

Open in GitHub Codespaces

Manual testing steps

  1. Run yarn start, observe that it works
  2. Run yarn webpack, observe that it works

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.

@rekmarks rekmarks requested a review from davidmurdoch May 8, 2025 22:50
@rekmarks rekmarks added the team-extension-platform Extension Platform team label May 8, 2025
Copy link
Contributor

@davidmurdoch davidmurdoch left a comment

Choose a reason for hiding this comment

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

👀 adding JS to the new build system is a bold move 😬

@metamaskbot
Copy link
Collaborator

Builds ready [32a781a]
UI Startup Metrics (1208 ± 62 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1208106114166212501289
load105793012445810911140
domContentLoaded105092712145810851135
domInteractive16132631625
firstPaint63189121742910671143
backgroundConnect84315722
firstReactRender20154652031
getState1464282030
initialActions001001
loadScripts80868496556845897
setupStore74142712
WebpackHomeuiStartup21511744251518422842410
load16661334201013517541855
domContentLoaded16601330200613417461851
domInteractive161152101348
firstPaint1616432461194289
backgroundConnect289233263263
firstReactRender15354373100246347
getState154262261527
initialActions316135
loadScripts16521329198213217401841
setupStore217239312036
FirefoxBrowserifyHomeuiStartup16581379222515417101988
load14771231205113915361743
domContentLoaded14771230205113915361743
domInteractive1214425135137189
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect251592132654
firstReactRender27216162835
getState145239331122
initialActions001001
loadScripts14561213203213915181720
setupStore83406818
WebpackHomeuiStartup15311350208914315921836
load13061160176511413631569
domContentLoaded13061160176511313621569
domInteractive76351661879110
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect22155772437
firstReactRender35295253744
getState135311311031
initialActions002111
loadScripts12861145174211413441545
setupStore14528038825
cc: @HowardBraham
Benchmark value 23 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Benchmark value 1659 exceeds gate value 1405 for firefox browserify home mean uiStartup
Benchmark value 1478 exceeds gate value 1245 for firefox browserify home mean load
Benchmark value 1477 exceeds gate value 1239 for firefox browserify home mean domContentLoaded
Benchmark value 121 exceeds gate value 110 for firefox browserify home mean domInteractive
Benchmark value 27 exceeds gate value 25 for firefox browserify home mean firstReactRender
Benchmark value 15 exceeds gate value 11 for firefox browserify home mean getState
Benchmark value 1457 exceeds gate value 1230 for firefox browserify home mean loadScripts
Benchmark value 1988 exceeds gate value 1660 for firefox browserify home p95 uiStartup
Benchmark value 1743 exceeds gate value 1495 for firefox browserify home p95 load
Benchmark value 1743 exceeds gate value 1495 for firefox browserify home p95 domContentLoaded
Benchmark value 1720 exceeds gate value 1475 for firefox browserify home p95 loadScripts
Benchmark value 14 exceeds gate value 13 for firefox webpack home mean setupStore
Sum of mean exceeds: 970ms | Sum of p95 exceeds: 1074ms
Sum of all benchmark exceeds: 2044ms

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 194 Bytes (0%)
  • ui: 3.83 KiB (0.05%)
  • common: 341 Bytes (0%)

@rekmarks
Copy link
Member Author

rekmarks commented May 9, 2025

@davidmurdoch how so? It's a single, battle-tested function that is good enough for production builds, and it performs more validation than the corresponding webpack implementation. If anything it will ensure that there's no drift between the build systems in their treatment of builds.yml. I'll also type the function to avoid any pollution.

@metamaskbot
Copy link
Collaborator

metamaskbot commented May 9, 2025

✨ Files requiring CODEOWNER review ✨

🧩 @MetaMask/extension-devs

  • lavamoat/browserify/beta/policy.json
  • lavamoat/browserify/flask/policy.json
  • lavamoat/browserify/main/policy.json
  • lavamoat/browserify/mmi/policy.json
  • lavamoat/build-system/policy.json

📜 @MetaMask/policy-reviewers

Tip

Follow the policy review process outlined in the LavaMoat Policy Review Process doc before expecting an approval from Policy Reviewers.

  • lavamoat/browserify/beta/policy.json
  • lavamoat/browserify/flask/policy.json
  • lavamoat/browserify/main/policy.json
  • lavamoat/browserify/mmi/policy.json
  • lavamoat/build-system/policy.json

🔗 @MetaMask/supply-chain

  • lavamoat/browserify/beta/policy.json
  • lavamoat/browserify/flask/policy.json
  • lavamoat/browserify/main/policy.json
  • lavamoat/browserify/mmi/policy.json
  • lavamoat/build-system/policy.json

@rekmarks rekmarks added the area-buildSystem related to our build system label May 9, 2025
@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label May 9, 2025
@rekmarks rekmarks force-pushed the rekm/build-type-extensions branch from dc02323 to 2248525 Compare May 9, 2025 07:13
@metamaskbot
Copy link
Collaborator

Builds ready [2248525]
UI Startup Metrics (1214 ± 59 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1214110913775912451334
load105996112125610901178
domContentLoaded105295512035710841172
domInteractive17133841625
firstPaint69373121042510661156
backgroundConnect84375721
firstReactRender19143742029
getState1454791834
initialActions001001
loadScripts81070595557839920
setupStore85182812
WebpackHomeuiStartup21761702252418123182392
load16921319198013418011861
domContentLoaded16851316197113317911857
domInteractive161260101346
firstPaint1646338060192293
backgroundConnect3210359403258
firstReactRender16555353107287347
getState174331391525
initialActions317135
loadScripts16771314194713517891855
setupStore207284312134
FirefoxBrowserifyHomeuiStartup13391131175311013971563
load12021015163311412581447
domContentLoaded12021015163311412581447
domInteractive983616224109146
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect201389101937
firstReactRender22195662226
getState74384811
initialActions005101
loadScripts11841003161811512391433
setupStore64365611
WebpackHomeuiStartup15851394220615816422028
load13601183193014114211620
domContentLoaded13601182193014114211620
domInteractive80321481989123
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2615303292446
firstReactRender36286463948
getState11429228917
initialActions102111
loadScripts13371158191413714031568
setupStore11527327821
Benchmark value 21 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Benchmark value 34 exceeds gate value 33 for chrome browserify home p95 getState
Benchmark value 2028 exceeds gate value 1935 for firefox webpack home p95 uiStartup
Sum of mean exceeds: 0ms | Sum of p95 exceeds: 97ms
Sum of all benchmark exceeds: 97ms

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 194 Bytes (0%)
  • ui: 4.3 KiB (0.06%)
  • common: 213 Bytes (0%)

@rekmarks rekmarks force-pushed the rekm/build-type-extensions branch from 2248525 to b2fbbe8 Compare May 9, 2025 22:40
@rekmarks rekmarks marked this pull request as ready for review May 9, 2025 22:55
@rekmarks rekmarks requested review from a team as code owners May 9, 2025 22:55
@rekmarks rekmarks added the team-ocap-kernel The Ocap Kernel team label May 9, 2025
@rekmarks rekmarks requested a review from davidmurdoch May 9, 2025 22:56
@rekmarks rekmarks removed the team-extension-platform Extension Platform team label May 9, 2025
@rekmarks rekmarks force-pushed the rekm/build-type-extensions branch from b2fbbe8 to 711f541 Compare May 9, 2025 22:59
@metamaskbot
Copy link
Collaborator

Builds ready [711f541]
UI Startup Metrics (1227 ± 71 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1227110114067112751359
load107696412036311231180
domContentLoaded106894411936411151173
domInteractive17133641724
firstPaint680129121143510901166
backgroundConnect94376822
firstReactRender20144452034
getState1463871826
initialActions001000
loadScripts82470494861868921
setupStore75182811
WebpackHomeuiStartup21141676241814422152296
load16321314190011217111830
domContentLoaded16251311188111117031826
domInteractive14105191240
firstPaint1666653366186291
backgroundConnect24962112949
firstReactRender1655435398284349
getState134215211423
initialActions316135
loadScripts16211309185811117001823
setupStore176157152128
FirefoxBrowserifyHomeuiStartup13411147181315114031677
load1198980168814312481514
domContentLoaded1197980168814312471513
domInteractive1073446054112189
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2313215252054
firstReactRender24196692349
getState84365818
initialActions001001
loadScripts1178971167313512341462
setupStore11423728622
WebpackHomeuiStartup15421370214116316031987
load13211186183913313911643
domContentLoaded13211186183913313901642
domInteractive77311481781104
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2614282282551
firstReactRender36288173848
getState12422122930
initialActions002111
loadScripts12981162181812713691545
setupStore12526331825
Benchmark value 1076 exceeds gate value 1070 for chrome browserify home mean load
Benchmark value 1068 exceeds gate value 1061 for chrome browserify home mean domContentLoaded
Benchmark value 23 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Benchmark value 11 exceeds gate value 9 for firefox browserify home mean setupStore
Benchmark value 1677 exceeds gate value 1660 for firefox browserify home p95 uiStartup
Benchmark value 1514 exceeds gate value 1495 for firefox browserify home p95 load
Benchmark value 1513 exceeds gate value 1495 for firefox browserify home p95 domContentLoaded
Benchmark value 27 exceeds gate value 26 for firefox webpack home mean backgroundConnect
Benchmark value 1987 exceeds gate value 1935 for firefox webpack home p95 uiStartup
Benchmark value 51 exceeds gate value 49 for firefox webpack home p95 backgroundConnect
Sum of mean exceeds: 16ms | Sum of p95 exceeds: 113ms
Sum of all benchmark exceeds: 129ms

Bundle size diffs [🚀 Bundle size reduced!]
  • background: 0 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: -128 Bytes (0%)

darkwing
darkwing previously approved these changes May 9, 2025
@rekmarks rekmarks enabled auto-merge May 9, 2025 23:37
Copy link
Contributor

@davidmurdoch davidmurdoch left a comment

Choose a reason for hiding this comment

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

Just commenting so I have a chance to review this next week.

Copy link
Contributor

@davidmurdoch davidmurdoch left a comment

Choose a reason for hiding this comment

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

@davidmurdoch how so? It's a single, battle-tested function that is good enough for production builds, and it performs more validation than the corresponding webpack implementation. If anything it will ensure that there's no drift between the build systems in their treatment of builds.yml. I'll also type the function to avoid any pollution.

it performs more validation than the corresponding webpack implementation

Validation, especially at the cost of build performance, does not typically belong in the compilation/bundling functionality of our build system.

The yarn webpack command serves a couple of key goals:

  1. Developer velocity - I benchmarked nearly every import/require and package, nearly every individual line and loop, minimized creation of poly/mega morphic object creation, and so much more. I didn't always choose the fastest way, since it is important we can maintain this code, but there are several hundred ~5-10ms "micro" optimizations in the new build system. Improving developer velocity is the reason our yarn webpack command exists.

  2. Minimize scope - The new build system should never do testing, validation, or linting of the runtime code (runtime = both application and build system code) by default. Is build.yml part of our runtime or is it part of compilation arguments? I could argue both ways, but I lean strongly towards it being part of the code for both our compiler/bundler and the runtime. Our compiler/bundler should validate user input (yarn webpack <options should be validated>), but not the runtime code. That should be part of a separate lint, validation, or testing process.

  3. Paradigm shift - Specifically, we want our compiler/bundler to be as declarative as feasible - our runtime code should instruct the build output as reasonably as it can - with instruction from the build config. Doing this will make it easier to switch build systems in the future (native options like bun, rspack, and turbopack are on our radar), generally decreases the size and complexity of our compiler/bundler scripts, and forces more thought into how we do things (as opposed to the "ship now, fix later™" mindset I see here often). This means we attempt to minimize our scripts that manually pluck, move, and compile files, in favor of idiomatic solutions.

  4. Test coverage - The ./webpack test directory has nearly 100% code coverage (cost/reward wasn't enough to make it 100% at the time)

  5. TypeScript - We're a TypeScript repo with a very heavy JS problem. We can philosophize about this point later if you want.

  6. Self contained - Why? Only because it helps support the priorities above. It is low on the list because, as you pointed out, we want to maintain effective output parity between the gulp+browserify and webpack systems, and our build config processing can be a bit complex, so utilizing some of the gulp-system's existing utils is currently necessary.

  7. Production builds - I'd love for this to be higher on the list, but there are good reasons this isn't on our teams goals this quarter.

Regarding YAML, since it’s our chosen configuration format, we should leverage its built-in features, such as anchors and merge keys, for extend-like functionality rather than custom solutions like are being introduced in this PR. To do this in YAML 1.2 (our default, IIRC), enabling the merge feature in the parser options is required. If you've already evaluated built-in options and found they don't work for us it'd be great if you commented as to why.

On validation, what I ultimately want to move to is JSON Schema-based validation (for clarity: I'm not asking for this in this PR). Most IDEs offer plugins that do, which would allow us to see validation errors in our IDEs as well as use these same schemas for programmatic validation. We don't implement any JSON Schema-based YAML validation currently, but we do use custom IDE package.json validation.

To your point about preventing drift between build systems, while validation can ensure consistency, embedding it in the webpack-based compilation/bundling process sacrifices performance (if we validated everything -- I seriously doubt this one thing would be measurable), but most importantly, scope clarity. A better solution is to handle validation as an optional or separate step.

Ultimately, yarn webpack should be viewed as the "compilation" part of our build system; validation, linting, security analysis, testing, etc., belong elsewhere. A unified CLI might one day streamline these processes, but each component should remain focused on its specific role.

@rekmarks
Copy link
Member Author

rekmarks commented May 13, 2025

Validation, especially at the cost of build performance, does not typically belong in the compilation/bundling functionality of our build system.

@davidmurdoch I'm not sure if we're on the same page about what this PR actually does. To begin, I wasn't aware of YAML's merge feature, but upon review, it unfortunately doesn't handle lists, so it doesn't meet my requirements.

Now re: what I take to be your main point, this PR doesn't really interact with the compilation / bundling functionality of either of our build systems. To recap:

  1. There is a configuration file, ./builds.yml, which both the new and the old build system rely on.
  2. Prior to this PR, the old and new build systems read and parsed this file in their own way.
  3. With this PR, both build systems use the same implementation. This implementation is a refactored version of the old system's implementation. It:
    • has 100% test coverage (added in this PR)
    • reads and validates the config file once per build system invocation, then caches the result
      • On my machine, this initial read and parse takes ~16ms, compared to ~13ms with the previous implementation.
    • adds one additional feature, the ability for build types to extend a single other build type

In other words, this PR is almost completely orthogonal to the new build system. Other tools that are part of our build system, e.g. webpack itself, validate their config files, so validating our own could hardly amount to a confusion of responsibilities. (Indeed, we were already validating the config file to some extent via yaml.parse().)

Now, all of the above being the case, what are your concerns about the changes in this PR?

kumavis
kumavis previously approved these changes May 13, 2025
Copy link
Member

@kumavis kumavis left a comment

Choose a reason for hiding this comment

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

approving LavaMoat policy changes

@kumavis
Copy link
Member

kumavis commented May 13, 2025

I wasn't aware of YAML's merge feature, but upon review, it unfortunately doesn't handle lists

I avoid using lists in config for this reason. When possible I prefer to use an object and then just take (and filter) values. Allows the overrider to override or values, but modifying order of values is less straight forward.

@metamaskbot
Copy link
Collaborator

Builds ready [c4ca53c]
UI Startup Metrics (1239 ± 72 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1239111616267212821377
load108097414406811141178
domContentLoaded107397114366811071175
domInteractive17134141725
firstPaint73396144944010951166
backgroundConnect84285824
firstReactRender21155472238
getState1455082030
initialActions001001
loadScripts826719115866856917
setupStore85213814
WebpackHomeuiStartup21221692251317822512342
load16491299199513317341846
domContentLoaded16431296199213217261842
domInteractive151148101346
firstPaint1656133657186310
backgroundConnect269165182951
firstReactRender1605335799284335
getState134163161526
initialActions316135
loadScripts16381294196913217211827
setupStore176158151927
FirefoxBrowserifyHomeuiStartup13221156172912813651639
load11821027157811812271454
domContentLoaded11821027157811812271454
domInteractive973720530111161
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2213257252051
firstReactRender22195352229
getState84294815
initialActions001001
loadScripts11631013155411512031440
setupStore9424324519
WebpackHomeuiStartup15451372212913915981836
load13181170171011613801551
domContentLoaded13181170171011613801550
domInteractive80311512090125
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect241593122443
firstReactRender35295353846
getState13531131930
initialActions102111
loadScripts12981153169311513641534
setupStore11528628919
Benchmark value 1240 exceeds gate value 1234 for chrome browserify home mean uiStartup
Benchmark value 1081 exceeds gate value 1070 for chrome browserify home mean load
Benchmark value 1074 exceeds gate value 1061 for chrome browserify home mean domContentLoaded
Benchmark value 1378 exceeds gate value 1365 for chrome browserify home p95 uiStartup
Benchmark value 25 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Sum of mean exceeds: 30ms | Sum of p95 exceeds: 20ms
Sum of all benchmark exceeds: 50ms

Bundle size diffs [🚀 Bundle size reduced!]
  • background: 0 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: -128 Bytes (0%)

@davidmurdoch
Copy link
Contributor

@rekmarks Most of my response was to get you on the same page as me as to what our new build system intends to become: a system of discreet tools that work together. One of these tools is compilation/bundling. You had made a point that this PR is justified, in part, because it validates the YAML build file's output.

In the context of the above, I was hoping to get you on the same page, in principle: validation should be a prerequisite to compilation. I didn't suspect that it would have a significant performance impact, but in the new system I think we should strive to compartmentalize the parts that make up the whole.

So we are on the same page: validation is orthogonal to compilation ;-)

we were already validating the config file to some extent via yaml.parse()

What the external YAML parser does is none of my business! haha :-)

I'm not a stickler on this, I just want to make sure you really really want this in the new system.

it unfortunately doesn't handle lists

I didn't know that. What a sad day! Perhaps we should switch to object/maps as @kumavis suggested (later, not suggesting you do it in this PR). It's a bummer that the YAML merge operator doesn't, uh, merge lists, seems like a very obvious use case 🙃. Sorry to send you on a fruitless investgation.

On my machine, this initial read and parse takes ~16ms, compared to ~13ms with the previous implementation.

One of things I found surprising when I was building the webpack bundler process was that there are some util files in development that take over 500ms to initialize. This is why there are many parts of the old build system that have been reimplemented within the webpack directory. That 500ms was 5% of my 10s budget (it did briefly compile under 10s on my machine which is what we were using for benchmarking)! To test this you can run time yarn --webpack --help on this branch and on main to check if there are significant differences (I'll probably do this when I review this properly)


I know there is a lot to unpack in the list I shared above, but if you have disagreements with anything I went over I'd love to chat with you about it further (not in this PR, obviously).

aside: one of these days I do hope to get this in as part of the lint process via JSON Schema validation.


I'll do a proper review later (its after 7pm here), but some quick notes: if the JavaScript test file can be in TypeScript without having to refactor anything else that'd be great, and I wouldn't mind if you just re-exported loadBuildTypesConfig as getBuildTypes in webpack/utils/config.ts (just a nit, not a requirement for approval). But again, a proper PR review is forthcoming! Thanks!

@metamaskbot
Copy link
Collaborator

Builds ready [bc19664]
UI Startup Metrics (1199 ± 62 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1199109114326212291327
load105294912125510801164
domContentLoaded104493012025610751158
domInteractive16134241624
firstPaint67480120842010571146
backgroundConnect84325823
firstReactRender20154652036
getState1463371927
initialActions001001
loadScripts80670395855834918
setupStore75222810
WebpackHomeuiStartup21411736248017922752399
load16551317194613917531847
domContentLoaded16481309192013817481837
domInteractive161172101341
firstPaint1606433159181297
backgroundConnect3010396393456
firstReactRender17554373106292352
getState164189241540
initialActions317135
loadScripts16441307189513817471834
setupStore196268262027
FirefoxBrowserifyHomeuiStartup13261144174112913771656
load11801027154611912301481
domContentLoaded11801027154611912291480
domInteractive1023923533112172
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect211374102246
firstReactRender23195172250
getState12441641827
initialActions001001
loadScripts11611014152211712111462
setupStore10420727624
WebpackHomeuiStartup15461333209514816091856
load13291152180912914061583
domContentLoaded13291152180812914051582
domInteractive77331922082113
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect21156162329
firstReactRender35295153645
getState11526926927
initialActions101111
loadScripts13101137179512813891552
setupStore95657815
Benchmark value 23 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Benchmark value 13 exceeds gate value 11 for firefox browserify home mean getState
Benchmark value 11 exceeds gate value 9 for firefox browserify home mean setupStore
Benchmark value 27 exceeds gate value 24 for firefox browserify home p95 getState
Sum of mean exceeds: 4ms | Sum of p95 exceeds: 8ms
Sum of all benchmark exceeds: 12ms

Bundle size diffs [🚀 Bundle size reduced!]
  • background: 0 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: -128 Bytes (0%)

@rekmarks rekmarks removed the DO-NOT-MERGE Pull requests that should not be merged label May 15, 2025
@rekmarks rekmarks disabled auto-merge May 15, 2025 18:27
@rekmarks rekmarks enabled auto-merge May 15, 2025 18:33
@rekmarks rekmarks disabled auto-merge May 15, 2025 18:39
@rekmarks rekmarks requested a review from davidmurdoch May 15, 2025 18:39
@metamaskbot
Copy link
Collaborator

Builds ready [3d7c307]
UI Startup Metrics (1204 ± 61 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1204108214716112391298
load104494312195710891142
domContentLoaded103893912125710801136
domInteractive16132931624
firstPaint717127116541310711142
backgroundConnect74233710
firstReactRender19154652029
getState1363681830
initialActions001001
loadScripts80370198056845904
setupStore75162711
WebpackHomeuiStartup21601731255117122752397
load16881324208213517651896
domContentLoaded16811320207813517611885
domInteractive151156101345
firstPaint1546135654171260
backgroundConnect3592484636198
firstReactRender1314234291182299
getState164264291429
initialActions315134
loadScripts16761319205513417551881
setupStore177168171927
FirefoxBrowserifyHomeuiStartup13061135179313013531578
load11601001164612412051434
domContentLoaded11601001164612412051433
domInteractive963818226107152
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect19135262133
firstReactRender23196072230
getState13420932828
initialActions001001
loadScripts1143988162312311891412
setupStore6352568
WebpackHomeuiStartup15341345196213115921789
load13101150173411313881515
domContentLoaded13091150173411313881514
domInteractive80542022484143
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect21145062239
firstReactRender34285343543
getState13522828927
initialActions102111
loadScripts12911134171811313681498
setupStore94668828
Benchmark value 199 exceeds gate value 90 for chrome webpack home p95 backgroundConnect
Benchmark value 14 exceeds gate value 11 for firefox browserify home mean getState
Benchmark value 28 exceeds gate value 24 for firefox browserify home p95 getState
Sum of mean exceeds: 3ms | Sum of p95 exceeds: 113ms
Sum of all benchmark exceeds: 116ms

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1024 Bytes (0.02%)
  • ui: 2.96 KiB (0.04%)
  • common: -88 Bytes (0%)

davidmurdoch
davidmurdoch previously approved these changes May 20, 2025
Copy link
Contributor

@davidmurdoch davidmurdoch left a comment

Choose a reason for hiding this comment

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

Approved (with 1 nit).

Performance changes to the default webpack cold-cache build times aren't totally negligible at about 70ms +- 5ms (aprox 0.5% slower), but they are not large enough to warrant concern.

darkwing
darkwing previously approved these changes May 20, 2025
@rekmarks rekmarks enabled auto-merge May 20, 2025 18:04
davidmurdoch
davidmurdoch previously approved these changes May 20, 2025
@rekmarks rekmarks dismissed stale reviews from davidmurdoch and darkwing via 80735b0 May 20, 2025 18:18
@metamaskbot
Copy link
Collaborator

Builds ready [80735b0]
UI Startup Metrics (1208 ± 58 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1208108213535812461310
load104193511965310751124
domContentLoaded103492911835310691116
domInteractive16132531624
firstPaint71871119542010671118
backgroundConnect84275923
firstReactRender21164462134
getState1453782129
initialActions001001
loadScripts79368893051824868
setupStore85172912
WebpackHomeuiStartup21871780261921823562554
load16991390205515717971964
domContentLoaded16921387204115517931954
domInteractive15115581339
firstPaint1736954369202303
backgroundConnect269257272939
firstReactRender16343372119307345
getState175309381525
initialActions812943846
loadScripts16881385203115317921947
setupStore3963207422285
FirefoxBrowserifyHomeuiStartup13391160171912113991623
load11871018159511612571442
domContentLoaded11871017159311612571442
domInteractive973546745108141
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2312180192150
firstReactRender24205862429
getState10421523814
initialActions002001
loadScripts11671002157011212291419
setupStore74588613
WebpackHomeuiStartup15721347236515016631841
load13571169188612714521588
domContentLoaded13571168188612714511587
domInteractive77331401681124
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect23165872542
firstReactRender39285454149
getState125230241029
initialActions102111
loadScripts13371152186612714301566
setupStore10512512818
Benchmark value 23 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Benchmark value 9 exceeds gate value 7 for chrome webpack home mean initialActions
Benchmark value 39 exceeds gate value 32 for chrome webpack home mean setupStore
Benchmark value 2554 exceeds gate value 2454 for chrome webpack home p95 uiStartup
Benchmark value 285 exceeds gate value 65 for chrome webpack home p95 setupStore
Benchmark value 39 exceeds gate value 38 for firefox webpack home mean firstReactRender
Sum of mean exceeds: 10ms | Sum of p95 exceeds: 325ms
Sum of all benchmark exceeds: 335ms

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0%)
  • ui: -854 Bytes (-0.01%)
  • common: 1.2 KiB (0.01%)

@rekmarks rekmarks added this pull request to the merge queue May 20, 2025
Merged via the queue into main with commit ebaa240 May 20, 2025
157 checks passed
@rekmarks rekmarks deleted the rekm/build-type-extensions branch May 20, 2025 19:57
@github-actions github-actions bot locked and limited conversation to collaborators May 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-buildSystem related to our build system INVALID-PR-TEMPLATE PR's body doesn't match template release-12.19.0 team-ocap-kernel The Ocap Kernel team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants