Skip to content

Conversation

@itsyoboieltr
Copy link
Contributor

@itsyoboieltr itsyoboieltr commented Nov 20, 2025

Description

Open in GitHub Codespaces

Previously, we were matching all .html files in the app dir to be bundled, so the partial html files were unnecessarily included. This PR aims to solve this problem and separate html pages from partials. The build output should not contain any partial html files.

Changelog

CHANGELOG entry: null

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/6314

Manual testing steps

  1. run yarn webpack
  2. check if the build output contains partial-body.html, partial-head.html. it shouldn't
  3. everything else should still work

Screenshots/Recordings

Not applicable

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.

Note

Move HTML pages to app/html/pages, introduce partials in app/html/partials, and update build/webpack scripts and tests to target the new structure and paths.

  • HTML structure:
    • Move page files to app/html/pages (e.g., background.html, home.html); remove app/*.html.
    • Add partials under app/html/partials and switch includes to html/partials/*.
  • Build tooling:
    • Update development/build/scripts.js to read from app/html/pages and adjust asset/script path replacements (../../* → bundled paths).
  • Webpack helpers:
    • collectEntries now scans app/html/pages for HTML; background/offscreen handling unchanged.
    • Remove underscore entry filename validation and its dependency; simplify path imports.
  • Tests:
    • Update expected HTML entry paths to join(appRoot, 'html', 'pages', *.html).
    • Remove the test asserting underscore-prefixed HTML entry rejection.
  • Page updates:
    • Fix relative paths in loading.html, notification.html, popup.html, sidepanel.html, offscreen.html, trezor-usb-permissions.html to use ../../ and new partials.

Written by Cursor Bugbot for commit 4cbb514. This will update automatically on new commits. Configure here.

@itsyoboieltr itsyoboieltr self-assigned this Nov 20, 2025
@itsyoboieltr itsyoboieltr added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label Nov 20, 2025
@metamaskbot metamaskbot added the team-extension-platform Extension Platform team label Nov 20, 2025
@github-actions
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.

@github-project-automation github-project-automation bot moved this to Needs dev review in PR review queue Nov 20, 2025
@itsyoboieltr itsyoboieltr moved this from Needs dev review to Review in progress in PR review queue Nov 20, 2025
@itsyoboieltr itsyoboieltr marked this pull request as ready for review November 20, 2025 20:41
@metamaskbot
Copy link
Collaborator

Builds ready [90ec351]
UI Startup Metrics (1207 ± 97 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1207106214189712691397
load102990812459111021194
domContentLoaded102390412389010901183
domInteractive2413107182171
firstPaint62778125842010361187
backgroundConnect21619725412222240
firstReactRender27184973043
getState32176183550
initialActions104113
loadScripts814669103391880981
setupStore1063031118
numNetworkReqs1257821575
BrowserifyPower User HomeuiStartup19441597322828821192498
load1024889187317210351489
domContentLoaded1007875183117010021463
domInteractive37162273932149
firstPaint6238618554249541508
backgroundConnect23020626413235258
firstReactRender83501381590109
getState18113232541200269
initialActions104112
loadScripts79667816081667941249
setupStore23995162763
numNetworkReqs1326830055174238
WebpackStandard HomeuiStartup8227331070778571002
load61956784062619779
domContentLoaded61456383461616774
domInteractive2414100182174
firstPaint24672781175209621
backgroundConnect1263281431
firstReactRender3220237243342
getState301455113850
initialActions104112
loadScripts61256182559614765
setupStore1253041420
numNetworkReqs1257820570
WebpackPower User HomeuiStartup14581101222424415891981
load67758212791326881026
domContentLoaded66757612681316721019
domInteractive38151874029149
firstPaint262111973171271623
backgroundConnect1574771929
firstReactRender8249126128999
getState15712127433170237
initialActions104112
loadScripts66457412561296701008
setupStore23965143452
numNetworkReqs1497230352181276
FirefoxBrowserifyStandard HomeuiStartup1190105014689512511423
load100989711937310641151
domContentLoaded100889611937410621150
domInteractive54271923380128
firstPaint------
backgroundConnect3320112153756
firstReactRender21175252033
getState106558919
initialActions102012
loadScripts99087911687110391127
setupStore1155481034
numNetworkReqs1157316759
BrowserifyPower User HomeuiStartup25821930339832728123225
load1155930173817012351498
domContentLoaded1154922173817112271497
domInteractive14533717123171433
firstPaint------
backgroundConnect20218972215255649
firstReactRender86421361894121
getState26083900252203852
initialActions218227
loadScripts1113903165716211801445
setupStore86776411495230
numNetworkReqs975722138122184
WebpackStandard HomeuiStartup14221266184113714651764
load12081059159810112731407
domContentLoaded12071055159710112731407
domInteractive65262374387149
firstPaint------
backgroundConnect3720124184080
firstReactRender26196862735
getState156121201257
initialActions102012
loadScripts1186104515719912481385
setupStore1156491034
numNetworkReqs1256716763
WebpackPower User HomeuiStartup28782220349630830643452
load13761129183319015531719
domContentLoaded13761129183319015521718
domInteractive12430617121139454
firstPaint------
backgroundConnect18629770177269562
firstReactRender86411452096122
getState270811554286212883
initialActions3129327
loadScripts13281106179418615131687
setupStore1566845232127756
numNetworkReqs98672354593223
📊 Page Load Benchmark Results

Current Commit: 90ec351 | Date: 11/20/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±38ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 715ms (±36ms) 🟢 | historical mean value: 732ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 75ms (±11ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 38ms 1.01s 1.31s 1.06s 1.31s
domContentLoaded 715ms 36ms 698ms 991ms 737ms 991ms
firstPaint 75ms 11ms 60ms 164ms 84ms 164ms
firstContentfulPaint 75ms 11ms 60ms 164ms 84ms 164ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 53 Bytes (0%)
  • ui: 3.88 KiB (0.06%)
  • common: 2.11 KiB (0.02%)

@davidmurdoch davidmurdoch changed the title feat: html dir refactor: html dir Nov 20, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [35866ec]
UI Startup Metrics (1208 ± 93 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1208104715149312501373
load102788212658610861158
domContentLoaded102188012598510791152
domInteractive221375152068
firstPaint62894127242810631158
backgroundConnect2071912358210226
firstReactRender29185893546
getState301665113457
initialActions103112
loadScripts821683104784880947
setupStore1053441125
numNetworkReqs1257820574
BrowserifyPower User HomeuiStartup18871551318129520722490
load98584720021829791462
domContentLoaded96983619821799511417
domInteractive36152384428155
firstPaint67810619904029301412
backgroundConnect21919927013227244
firstReactRender83491361593111
getState19314234646214295
initialActions104112
loadScripts76764917421747541195
setupStore20697142746
numNetworkReqs1306529851175231
WebpackStandard HomeuiStartup8357431083818861014
load62356384561630780
domContentLoaded61855883660626774
domInteractive241585162171
firstPaint20888841143198631
backgroundConnect1253481629
firstReactRender3020114103339
getState291460113650
initialActions104111
loadScripts61555682658624764
setupStore1273051519
numNetworkReqs1257720572
WebpackPower User HomeuiStartup14641198254524315941964
load6745861367132676994
domContentLoaded6635801359131658985
domInteractive35172113729134
firstPaint244116662134242616
backgroundConnect1576171726
firstReactRender8053104108694
getState16012529136170253
initialActions103112
loadScripts6605781345129656977
setupStore211065123143
numNetworkReqs1436430254181280
FirefoxBrowserifyStandard HomeuiStartup12481063156410713261480
load105891913668211101209
domContentLoaded105791513648211101203
domInteractive61303004380146
firstPaint------
backgroundConnect362199143971
firstReactRender22184552235
getState106538926
initialActions102112
loadScripts103690413447910911169
setupStore114558931
numNetworkReqs1155913650
BrowserifyPower User HomeuiStartup26661931391933128603415
load1180955165418012771520
domContentLoaded1178954165418012771520
domInteractive13534570122160449
firstPaint------
backgroundConnect164211159214170751
firstReactRender86421662295128
getState25976850254201841
initialActions2022223
loadScripts1144938163317011861471
setupStore1146751169111603
numNetworkReqs90602174382203
WebpackStandard HomeuiStartup15361369203313815901842
load12971122156010713651532
domContentLoaded12961121156010713651532
domInteractive74272344495153
firstPaint------
backgroundConnect46211742847115
firstReactRender30217993139
getState147151201241
initialActions103122
loadScripts1268110315089913321454
setupStore167169211249
numNetworkReqs1256717663
WebpackPower User HomeuiStartup29062233367732531263550
load14111121206820715481795
domContentLoaded14101121206820715471794
domInteractive13029600133143514
firstPaint------
backgroundConnect16221679170210619
firstReactRender87471662197126
getState26086962258213895
initialActions3062837
loadScripts13741105198620515001766
setupStore1076797177107667
numNetworkReqs91552144581205
📊 Page Load Benchmark Results

Current Commit: 35866ec | Date: 11/21/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.02s (±38ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 714ms (±35ms) 🟢 | historical mean value: 731ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 75ms (±11ms) 🟢 | historical mean value: 80ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.02s 38ms 1.00s 1.30s 1.06s 1.30s
domContentLoaded 714ms 35ms 694ms 973ms 733ms 973ms
firstPaint 75ms 11ms 60ms 168ms 80ms 168ms
firstContentfulPaint 75ms 11ms 60ms 168ms 80ms 168ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 74 Bytes (0%)
  • ui: 47.4 KiB (0.68%)
  • common: 2.23 KiB (0.03%)

davidmurdoch
davidmurdoch previously approved these changes Nov 21, 2025
@github-project-automation github-project-automation bot moved this from Review in progress to Review finalised - Ready to be merged in PR review queue Nov 21, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [4cbb514]
UI Startup Metrics (1229 ± 89 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1229106914958912871410
load104289512518511091192
domContentLoaded103589212438411041186
domInteractive241396192083
firstPaint54691124340710171166
backgroundConnect21919635919224249
firstReactRender28195273145
getState331896133662
initialActions107112
loadScripts824691102583884973
setupStore1164151120
numNetworkReqs1257720573
BrowserifyPower User HomeuiStartup19281605264124320962391
load1032901172716010481474
domContentLoaded1016896168315710211464
domInteractive38172094431160
firstPaint6259017114229851487
backgroundConnect23220727514242258
firstReactRender83511291389106
getState18012936547200279
initialActions104112
loadScripts80369414551578071257
setupStore21663122746
numNetworkReqs90641933095174
WebpackStandard HomeuiStartup811721101664826975
load61756381462628789
domContentLoaded61355980462625783
domInteractive241493192186
firstPaint22876811165200655
backgroundConnect1063961226
firstReactRender30206173441
getState291469103444
initialActions103112
loadScripts61055779560623773
setupStore1273251521
numNetworkReqs1257720571
WebpackPower User HomeuiStartup14431203221722715921897
load6705791108117679992
domContentLoaded6595711074114658984
domInteractive35161743328129
firstPaint27383989186270678
backgroundConnect1584471926
firstReactRender8151105129099
getState15712227733164236
initialActions103112
loadScripts6565691063112656976
setupStore22973133347
numNetworkReqs1476630254182277
FirefoxBrowserifyStandard HomeuiStartup13001132186511713531523
load108996812778011461245
domContentLoaded108796112768011461245
domInteractive61312363984135
firstPaint------
backgroundConnect4023125204297
firstReactRender23195252436
getState116174171020
initialActions102122
loadScripts106595112527811191220
setupStore1175881030
numNetworkReqs1157015760
BrowserifyPower User HomeuiStartup26341758345731728373231
load1185947162118713771530
domContentLoaded1184939162018713771523
domInteractive13634593116157428
firstPaint------
backgroundConnect16725836180202647
firstReactRender85491321797114
getState24480874235213851
initialActions2131327
loadScripts1142930159718513211494
setupStore1096802176113682
numNetworkReqs88472224781211
WebpackStandard HomeuiStartup15171314206314315661848
load12731135151910013401467
domContentLoaded12731134151910013401467
domInteractive67282324488149
firstPaint------
backgroundConnect44201552645122
firstReactRender3320127153374
getState146138171141
initialActions102122
loadScripts1246108914849213061422
setupStore15691161259
numNetworkReqs1256617664
WebpackPower User HomeuiStartup30612136406137832493787
load15101222213020917131890
domContentLoaded15101222213020917121890
domInteractive14033573126149483
firstPaint------
backgroundConnect255311010269347862
firstReactRender974817222107137
getState300921303288426855
initialActions3139537
loadScripts14611199206720016441826
setupStore1081279417989759
numNetworkReqs88522144290195
📊 Page Load Benchmark Results

Current Commit: 4cbb514 | Date: 11/21/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 979ms (±40ms) 🟢 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 678ms (±36ms) 🟢 | historical mean value: 731ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 75ms (±13ms) 🟢 | historical mean value: 80ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 979ms 40ms 952ms 1.28s 1.00s 1.28s
domContentLoaded 678ms 36ms 656ms 958ms 703ms 958ms
firstPaint 75ms 13ms 60ms 196ms 80ms 196ms
firstContentfulPaint 75ms 13ms 60ms 196ms 80ms 196ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 74 Bytes (0%)
  • ui: 47.4 KiB (0.68%)
  • common: 2.23 KiB (0.03%)

@itsyoboieltr itsyoboieltr added this pull request to the merge queue Nov 21, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed size-M team-extension-platform Extension Platform team

Projects

Status: Review finalised - Ready to be merged

Development

Successfully merging this pull request may close these issues.

6 participants