Skip to content

Excluding sourcemaps comment in production builds#10695

Merged
ryanml merged 2 commits intodevelopfrom
fix-7077
Mar 23, 2021
Merged

Excluding sourcemaps comment in production builds#10695
ryanml merged 2 commits intodevelopfrom
fix-7077

Conversation

@ryanml
Copy link
Contributor

@ryanml ryanml commented Mar 22, 2021

Fixes #7077

Manual testing steps:

  • Build production MetaMask with yarn dist
  • Load the extension in to the browser
  • Navigate to a site such as https://www.cryptokitties.co/
  • Open Dev Tools > Console
  • Ensure sourcemap console warnings are not present

Before:
Screen Shot 2021-03-22 at 2 34 31 PM

After:
Screen Shot 2021-03-22 at 2 38 46 PM

@ryanml ryanml requested a review from kumavis March 22, 2021 21:41
@ryanml ryanml self-assigned this Mar 22, 2021
@ryanml ryanml requested a review from a team as a code owner March 22, 2021 21:41
@ryanml ryanml requested a review from brad-decker March 22, 2021 21:41
kumavis
kumavis previously approved these changes Mar 23, 2021
The source map explorer script now re-adds the source map comment to
each file to ensure the source map visualization still works. Each
module with a sourcemap is copied to a temporary directory along with
the module it corresponds to, and from there it's passed into
`source-map-explorer`. This should ensure the resulting visualization
matches what it was before.

Everything has been moved inside of functions to generally improve
readability, and to allow the use of local variables.
@metamaskbot
Copy link
Collaborator

Builds ready [414ab6a]
Page Load Metrics (641 ± 24 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint46796095
domContentLoaded5838126394924
load5858136414924
domInteractive5838116394924

@ryanml ryanml requested a review from kumavis March 23, 2021 02:29
Copy link
Contributor Author

@ryanml ryanml left a comment

Choose a reason for hiding this comment

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

++ source map test changes lgtm

Copy link
Member

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

LGTM!

@ryanml ryanml merged commit 91e5b85 into develop Mar 23, 2021
@ryanml ryanml deleted the fix-7077 branch March 23, 2021 02:41
@github-actions github-actions bot locked and limited conversation to collaborators Mar 23, 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.

Prevent source map console warnings caused by MetaMask bundles

4 participants