Skip to content

Build - refactor for bundle factoring and swappable runtime#11080

Merged
kumavis merged 54 commits intodevelopfrom
build-module-groups
Jul 15, 2021
Merged

Build - refactor for bundle factoring and swappable runtime#11080
kumavis merged 54 commits intodevelopfrom
build-module-groups

Conversation

@kumavis
Copy link
Member

@kumavis kumavis commented May 13, 2021

this refactor unblocks incremental lavamoat protections for the webapp
this is does not add lavamoat yet

some additional benefits:

  • automatically factors bundles into entry (phishing/ui/background) and "common" module groups
  • module groups are then reduced to subgroups based on a size limit, and then compose into bundles
  • bundles call into a swappable runtime api that allows the same module definition to be used in lavamoat or as in here a normal commonjs runtime. eg background could use lavamoat protections while ui does not, even as both consume the same "common" bundles

additional watchify and patch-package note:
in order to remove an incompatible watchify feature (binary output statistics), we used patch-package. it was determined to be the easiest and least hacky way to disable the non-optional feature.

@kumavis

This comment has been minimized.

@metamaskbot

This comment has been minimized.

@metamaskbot

This comment has been minimized.

@kumavis kumavis marked this pull request as ready for review May 20, 2021 06:21
@kumavis kumavis requested a review from a team as a code owner May 20, 2021 06:21
@kumavis kumavis requested a review from adonesky1 May 20, 2021 06:21
@metamaskbot

This comment has been minimized.

@kumavis kumavis changed the title Build - refactor for bundle runtime Build - refactor for bundle factoring and swappable runtime May 20, 2021
Copy link
Member Author

@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.

im happy with it now

@metamaskbot
Copy link
Collaborator

Builds ready [287097f]
Page Load Metrics (693 ± 40 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint549169105
domContentLoaded6058906918340
load6068916938340
domInteractive6048906918340

@kumavis
Copy link
Member Author

kumavis commented Jul 14, 2021

Co-authored-by: Brad Decker <git@braddecker.dev>
@kumavis
Copy link
Member Author

kumavis commented Jul 14, 2021

desire for stats on total shipped code size

@metamaskbot
Copy link
Collaborator

Builds ready [26f7673]
Page Load Metrics (686 ± 36 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint54886794
domContentLoaded4367856857636
load4377876867636
domInteractive4367856857636

brad-decker
brad-decker previously approved these changes Jul 14, 2021
Copy link
Contributor

@brad-decker brad-decker left a comment

Choose a reason for hiding this comment

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

The changes we discussed are good to have but not required for this to land imo. Even the broken links in the build output bot notification are not an issue due to the all artifacts link working.

darkwing
darkwing previously approved these changes Jul 14, 2021
@kumavis
Copy link
Member Author

kumavis commented Jul 15, 2021

is this the right pack

lavaPack({ raw: true, hasExports: true, includePrelude: false }),

edit: yes, bc we're excluding the prelude

@kumavis
Copy link
Member Author

kumavis commented Jul 15, 2021

verify bifyModuleGroups.groupByFactor

@ryanml ryanml dismissed stale reviews from darkwing and brad-decker via 71d3589 July 15, 2021 00:35
@ryanml ryanml force-pushed the build-module-groups branch from 71d3589 to 6973dd3 Compare July 15, 2021 01:09
@MetaMask MetaMask deleted a comment from metamaskbot Jul 15, 2021
@ryanml ryanml force-pushed the build-module-groups branch from 6973dd3 to 626c8f3 Compare July 15, 2021 01:10
@metamaskbot
Copy link
Collaborator

Builds ready [626c8f3]
Page Load Metrics (922 ± 78 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint642001033316
domContentLoaded528123092016378
load530123292216378
domInteractive527123091916378

@metamaskbot
Copy link
Collaborator

Builds ready [626c8f3]
Page Load Metrics (922 ± 78 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint642001033316
domContentLoaded528123092016378
load530123292216378
domInteractive527123091916378

@ryanml ryanml requested review from brad-decker and darkwing July 15, 2021 01:39
@ryanml
Copy link
Contributor

ryanml commented Jul 15, 2021

Bundle links have been fixed, this could be formatted a bit cleaner but that can be resolved in a follow up

@kumavis
Copy link
Member Author

kumavis commented Jul 15, 2021

ok im ready

@kumavis kumavis merged commit 9f4820e into develop Jul 15, 2021
@kumavis kumavis deleted the build-module-groups branch July 15, 2021 17:59
@github-actions github-actions bot locked and limited conversation to collaborators Jul 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants