Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lighthouse preset fix #43

Merged
merged 27 commits into from
Sep 26, 2020
Merged

Lighthouse preset fix #43

merged 27 commits into from
Sep 26, 2020

Conversation

timothy-ch-cheung
Copy link
Contributor

@timothy-ch-cheung timothy-ch-cheung commented Sep 17, 2020

Switch to use the recommended lighthouse config, fix findings to get a passing report

@timothy-ch-cheung timothy-ch-cheung marked this pull request as draft September 17, 2020 15:28
@lgtm-com
Copy link

lgtm-com bot commented Sep 17, 2020

This pull request introduces 1 alert when merging 8bbcd77 into 19373b3 - view on LGTM.com

new alerts:

  • 1 for Unreachable statement

@codecov
Copy link

codecov bot commented Sep 17, 2020

Codecov Report

Merging #43 into master will increase coverage by 2.12%.
The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #43      +/-   ##
==========================================
+ Coverage   95.83%   97.95%   +2.12%     
==========================================
  Files           9        9              
  Lines          48       49       +1     
  Branches        4        4              
==========================================
+ Hits           46       48       +2     
+ Misses          2        1       -1     
Impacted Files Coverage Δ
src/components/TabBar.tsx 100.00% <ø> (ø)
src/pages/index.tsx 0.00% <0.00%> (ø)
src/pages/landing/index.tsx 100.00% <ø> (ø)
src/pages/me/index.tsx 100.00% <ø> (ø)
src/components/TopBar.tsx 100.00% <100.00%> (ø)
src/pages/_document.tsx 100.00% <100.00%> (+33.33%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a8527fe...fb80d19. Read the comment docs.

@lgtm-com
Copy link

lgtm-com bot commented Sep 24, 2020

This pull request introduces 1 alert when merging ebdf279 into b5a954c - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@lgtm-com
Copy link

lgtm-com bot commented Sep 24, 2020

This pull request introduces 1 alert when merging 766ed41 into b5a954c - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@lgtm-com
Copy link

lgtm-com bot commented Sep 24, 2020

This pull request introduces 1 alert when merging 47bb243 into b5a954c - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@lgtm-com
Copy link

lgtm-com bot commented Sep 24, 2020

This pull request introduces 1 alert when merging c0fba91 into b5a954c - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

import TwitterSvg from "../../assets/icons/twitter.svg?sprite"
import EmailSvg from "../../assets/icons/email.svg?sprite"
// @ts-ignore
import IPhone from "../../../public/iphone_crop.png?resize&sizes[]=300&sizes[]=500&sizes[]=850"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure how to make typescript recognise this type - any suggestions?

Copy link
Member

Choose a reason for hiding this comment

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

Seems like a common issue: cyrilwanner/next-optimized-images#103
You think maybe in the type declaration if we did *.png* would that work?

@timothy-ch-cheung
Copy link
Contributor Author

Ready for review:
CodeCov flagging the index file (Hello world) which I don't think is necessary to test.

Still one remaining lighthouse failure ("unused-js" - https://web.dev/unused-javascript/), not sure how to fix (checked lighthouse coverage and its not clear which lines its classing as unused), just upped the threshold to 4 for now.

Lighthouse flagging a warning for not using next-gen formats - can't fix this with next-optimized-images yet, seems to be a bug that someone else has also seen (cyrilwanner/next-optimized-images#207)

@timothy-ch-cheung timothy-ch-cheung marked this pull request as ready for review September 25, 2020 10:50
@timothy-ch-cheung timothy-ch-cheung requested review from pavsidhu and adamjhc and removed request for pavsidhu September 25, 2020 10:50
package.json Outdated
@@ -21,18 +21,22 @@
]
},
"dependencies": {
"@types/imagemin-svgo": "7.0.0",
"@types/svg-sprite-loader": "3.9.2",
Copy link
Member

Choose a reason for hiding this comment

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

Should add these to dev deps instead, same in the package-lock.json

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These dependencies weren't needed (I added them to try to fix the typing of next-optimized-images but forgot to remove them)

@@ -38,6 +38,12 @@ export default class MyDocument extends Document {
href="/icons/safari-pinned-tab.svg"
color="#caeaf8"
/>
<link rel="manifest" href="/manifest.json" />
<meta name="theme-color" content="#fefefe" />
Copy link
Member

Choose a reason for hiding this comment

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

Not 100% sure we need this as it's already specified in public/manifest.json should probably double check this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do need the tag (see: https://github.com/feelingapp/feeling-app/runs/1168465935?check_suite_focus=true) - I've changed it to match the one in manifest

import TwitterSvg from "../../assets/icons/twitter.svg?sprite"
import EmailSvg from "../../assets/icons/email.svg?sprite"
// @ts-ignore
import IPhone from "../../../public/iphone_crop.png?resize&sizes[]=300&sizes[]=500&sizes[]=850"
Copy link
Member

Choose a reason for hiding this comment

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

Seems like a common issue: cyrilwanner/next-optimized-images#103
You think maybe in the type declaration if we did *.png* would that work?

@timothy-ch-cheung timothy-ch-cheung merged commit 657fbde into master Sep 26, 2020
@timothy-ch-cheung timothy-ch-cheung deleted the lighthouse-preset-fix branch September 26, 2020 11:49
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.

None yet

2 participants