-
Notifications
You must be signed in to change notification settings - Fork 34
Add bundle analyzer and update React imports #160
Conversation
@@ -5,7 +5,8 @@ | |||
"jsx-a11y/anchor-is-valid": "off", | |||
"import/no-default-export": "off", | |||
"react/forbid-dom-props": "warn", | |||
"@typescript-eslint/require-await": "warn" | |||
"@typescript-eslint/require-await": "warn", | |||
"react/react-in-jsx-scope": "off" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that with React v17 we can disable this.
✔️ Deploy Preview for sourcegraph-learn ready! 🔨 Explore the source changes: d12397b 🔍 Inspect the deploy log: https://app.netlify.com/sites/sourcegraph-learn/deploys/61146afc8b1e470007da0b7f 😎 Browse the preview: https://deploy-preview-160--sourcegraph-learn.netlify.app |
@@ -61,8 +61,7 @@ const Layout: React.FunctionComponent<Props> = props => { | |||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |||
<link rel="preconnect" href="https://fonts.gstatic.com" /> | |||
<link | |||
rel="stylesheet preload prefetch" | |||
as="style" | |||
rel="stylesheet" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will hopefully address a console warning I was seeing in prod (but not dev while working on CSS refactor): <link rel=preload> has an invalid
href value
. This should fix that.
@@ -1,14 +1,14 @@ | |||
import Column from '@components/atoms/Column' | |||
import Row from '@components/atoms/Row' | |||
import Layout, { Props as LayoutProps, MetaTags } from '@components/layouts/Layout' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Taking MetaTags
out here, since this is unused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Analyzer and dev environment work as expected. Going to make sure that the deploy preview is also working as expected (updating branch now). Thanks for addressing the import statements too.
What should this PR do?
This PR resolves DEVED-106 by adding a bundle analyzer to our project and updating some of our import statements.
You can now run
npm run analyze
to look at the current state of the app. It will be helpful to also use tools like https://bundlephobia.com/ before adding any new packages to the app.This PR also updates our React imports to work with current thinking, avoiding redundant imports. See also this PR
Why are we making this change?
We want our user experience to remain optimal.
What are the acceptance criteria?
How should this PR be tested?
node_modules
, and install dependencies withnpm ci
.npm run analyze
and ensure that analyzer works.Pull request process
Reviewers:
Reviewees: