fix: Replace dark mode package with new one that works with gatsby 3.x - #1183
Conversation
| @@ -0,0 +1 @@ | |||
| declare module 'gatsby-plugin-dark-mode'; | |||
There was a problem hiding this comment.
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.
|
Please find a preview at: https://staging.nodejs.dev/1183/ |
|
Something is breaking the Learn Node button. Demo Hovering over the button displays it correctly. |
|
@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 |
|
Idk why I didn't think of that 🤦thanks! I'll do that |
|
I opened up #1186 to deal with the remark-lint stuff separately |
|
Please find a preview at: https://staging.nodejs.dev/1183/ |
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
…ode-pkg-replacement
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 |
|
lol ok ill take a look. I might have to regenerate my |
|
/preview |
|
Please find a preview at: https://staging.nodejs.dev/1183/ |
| if (e.charCode === 13 || e.charCode === 32) darkModeController.toggle(); | ||
| const handleThemeOnClick = ( | ||
| e: MouseEvent<HTMLButtonElement, Event>, | ||
| toggleTheme: Function |
There was a problem hiding this comment.
Adding // eslint-disable-next-line @typescript-eslint/ban-types should disable your linting error here and on line 91.
|
Finally got the project running locally again, gonna try and knock it out before the eow |
| "resolutions": { | ||
| "sharp": "0.27.2" | ||
| }, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
|
Please find a preview at: https://staging.nodejs.dev/1183/ |


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