Skip to content

Remove use of webpack loaders in components#8249

Merged
Gudahtt merged 1 commit intodevelopfrom
remove-svg-loaders
Mar 30, 2020
Merged

Remove use of webpack loaders in components#8249
Gudahtt merged 1 commit intodevelopfrom
remove-svg-loaders

Conversation

@Gudahtt
Copy link
Copy Markdown
Member

@Gudahtt Gudahtt commented Mar 30, 2020

Various SVGs were being imported directly in components using Webpack loaders. This was done to get these components to work correctly in storybook, which uses Webpack. However we don't use Webpack for our actual build system, so these components would fail when you attempted to use them.

Instead the storybook script has been updated to use the --static-dir flag, which allows specifying a directory of files to serve statically. The app directory is served statically, so all of the relative URLs we use in practice to reference fonts and images should just work.

The storybook build command has been updated to use the same flag. Unfortunately this also means that the uncompiled background code is now included in the build as well, because it's alongside our static files. This shouldn't have any impact upon the build though.

The use of this static-dir option as made much of the existing storybook Webpack configuration unnecessary, so it has been reduced to just the essential steps.

Various SVGs were being imported directly in components using Webpack
loaders. This was done to get these components to work correctly in
storybook, which uses Webpack. However we don't use Webpack for our
actual build system, so these components would fail when you attempted
to use them.

Instead the storybook script has been updated to use the `--static-dir`
flag, which allows specifying a directory of files to serve statically.
The `app` directory is served statically, so all of the relative URLs
we use in practice to reference fonts and images should just work.

The storybook build command has been updated to use the same flag.
Unfortunately this also means that the uncompiled background code is
now included in the build as well, because it's alongside our static
files. This shouldn't have any impact upon the build though.

The use of this `static-dir` option as made much of the existing
storybook Webpack configuration unnecessary, so it has been reduced to
just the essential steps.
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [dc57bc0]
Page Load Metrics (705 ± 62 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeNotificationfirstPaint36116552110
domContentLoaded471102570412962
load473102670512962
domInteractive471102470412962

@Gudahtt Gudahtt merged commit 079db2f into develop Mar 30, 2020
@Gudahtt Gudahtt deleted the remove-svg-loaders branch March 30, 2020 18:38
Gudahtt added a commit that referenced this pull request Feb 12, 2021
This dependency has not been used since #8249.
Gudahtt added a commit that referenced this pull request Feb 12, 2021
This dependency has not been used since #8249.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants