Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

fix: Replace dark mode package with new one that works with gatsby 3.x - #1183

Merged
benhalverson merged 12 commits into
nodejs:masterfrom
lancemccluskey:1177-darkmode-pkg-replacement
Apr 8, 2021
Merged

fix: Replace dark mode package with new one that works with gatsby 3.x#1183
benhalverson merged 12 commits into
nodejs:masterfrom
lancemccluskey:1177-darkmode-pkg-replacement

Conversation

@lancemccluskey

Copy link
Copy Markdown
Contributor

Description

There was an issue with the current dark mode package not supporting Gatsby 3.x, so this PR is to replace that package with this.

Related Issues

Fixes #1177

Comment thread package.json Outdated
Comment thread src/components/Header/index.tsx
@@ -0,0 +1 @@
declare module 'gatsby-plugin-dark-mode';

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I can be convinced to put this in a separate place. Im not sure whats best, to put it next to where its used or in this types folder.

@benhalverson benhalverson added the create-preview Generate preview on staging.nodejs.dev label Apr 1, 2021
@github-actions github-actions Bot removed the create-preview Generate preview on staging.nodejs.dev label Apr 1, 2021
@github-actions

github-actions Bot commented Apr 1, 2021

Copy link
Copy Markdown

Please find a preview at: https://staging.nodejs.dev/1183/

Comment thread src/styles/layout.scss
@benhalverson

Copy link
Copy Markdown
Member

Something is breaking the Learn Node button. Demo Hovering over the button displays it correctly.
Screen Shot 2021-04-01 at 4 36 45 PM

@nschonni

nschonni commented Apr 2, 2021

Copy link
Copy Markdown
Member

@lancemccluskey I think if you rebase out your re-creation of the package-lock.json, you won't run into the issues that you're hitting by upgrading the remark-lint setup

@lancemccluskey

Copy link
Copy Markdown
Contributor Author

Idk why I didn't think of that 🤦thanks! I'll do that

@nschonni

nschonni commented Apr 2, 2021

Copy link
Copy Markdown
Member

I opened up #1186 to deal with the remark-lint stuff separately

@benhalverson benhalverson added the create-preview Generate preview on staging.nodejs.dev label Apr 2, 2021
@github-actions github-actions Bot removed the create-preview Generate preview on staging.nodejs.dev label Apr 2, 2021
@github-actions

github-actions Bot commented Apr 2, 2021

Copy link
Copy Markdown

Please find a preview at: https://staging.nodejs.dev/1183/

@codecov-io

codecov-io commented Apr 3, 2021

Copy link
Copy Markdown

Codecov Report

Merging #1183 (8c6b2d5) into master (9245738) will decrease coverage by 0.59%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1183      +/-   ##
==========================================
- Coverage   50.81%   50.21%   -0.60%     
==========================================
  Files          55       55              
  Lines         677      687      +10     
  Branches      198      200       +2     
==========================================
+ Hits          344      345       +1     
- Misses        326      335       +9     
  Partials        7        7              
Impacted Files Coverage Δ
src/components/Layout/centered.tsx 80.00% <ø> (ø)
src/components/Layout/index.tsx 100.00% <ø> (ø)
src/components/Header/index.tsx 44.44% <33.33%> (-43.06%) ⬇️

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 9245738...8c6b2d5. Read the comment docs.

@benhalverson benhalverson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice work 👍

@manishprivet manishprivet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Right now, the clickable area of the button is very small, but instead, it should cover the whole box.
image

Also, it should be toggled by the space bar or enter button, but it's not working here.

@benhalverson

Copy link
Copy Markdown
Member

Also, it should be toggled by the space bar or enter button, but it's not working here.

The toggling with space bar / enter hasn't been implemented in the current production version yet. I think this should be done after this PR.

@manishprivet

Copy link
Copy Markdown
Member

Also, it should be toggled by the space bar or enter button, but it's not working here.

The toggling with space bar / enter hasn't been implemented in the current production version yet. I think this should be done after this PR.

It has been implemented 😅 see #1150

@lancemccluskey

Copy link
Copy Markdown
Contributor Author

lol ok ill take a look. I might have to regenerate my package-lock.json

@lancemccluskey

Copy link
Copy Markdown
Contributor Author

/preview

@github-actions

github-actions Bot commented Apr 6, 2021

Copy link
Copy Markdown

Please find a preview at: https://staging.nodejs.dev/1183/

Comment thread src/components/Header/index.tsx Outdated
if (e.charCode === 13 || e.charCode === 32) darkModeController.toggle();
const handleThemeOnClick = (
e: MouseEvent<HTMLButtonElement, Event>,
toggleTheme: Function

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Adding // eslint-disable-next-line @typescript-eslint/ban-types should disable your linting error here and on line 91.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

thanks!

@lancemccluskey

Copy link
Copy Markdown
Contributor Author

Finally got the project running locally again, gonna try and knock it out before the eow

Comment thread package.json
Comment on lines +112 to +114
"resolutions": {
"sharp": "0.27.2"
},

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I was having a lot of trouble running locally, specifically because of the sharp dependency shared between gatsby-plugin-manifest and gatsby-plugin-sharp. One would get the wrong version and I couldnt run the project locally. I added this so installing will force the correct version of sharp

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Which version of node are you using? Are you using npm or yarn?
i haven’t see this issue before. Have you tried using the latest Node LTS? 14.x

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I tried both 10.x when I run nvm use and the latest Node LTS. Before I added this, the gatsby-plugin-sharp was downloading sharp version 0.25.6 which was incompatible. I also tried nuking package lock and node modules to no avail.

One thing I will say is that I didnt see this issue at all after upgrading gatsby and all the associated plugins to 3.x, so if this is merged I think we can remove it in your upgrade PR here

@benhalverson benhalverson added the create-preview Generate preview on staging.nodejs.dev label Apr 8, 2021
@github-actions github-actions Bot removed the create-preview Generate preview on staging.nodejs.dev label Apr 8, 2021
@github-actions

github-actions Bot commented Apr 8, 2021

Copy link
Copy Markdown

Please find a preview at: https://staging.nodejs.dev/1183/

@benhalverson
benhalverson merged commit 3011933 into nodejs:master Apr 8, 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.

Darkmode package replacement

5 participants