andrewbranch / gatsby-remark-vscode

Gatsby plugin to provide VS Code’s syntax highlighting to Markdown code fences
MIT License
296 stars 27 forks source link

Update for gatsby v3 #144

Closed codepunkt closed 3 years ago

codepunkt commented 3 years ago

image

zero-plusplus commented 3 years ago

I am using machine translation.

To support gatsby v3, simply change the peerDependencies in package.json to "^3.0.0".

https://www.gatsbyjs.com/docs/reference/release-notes/migrating-from-v2-to-v3/#for-plugin-maintainers

kremalicious commented 3 years ago

There might be more updates required to make this plugin fully work with Gatsby v3. I am running into this issue locally with Gatsby v3.0.4 & gatsby-remark-vscode v3.2.0:

When running local dev server, after saving for the second or third time, the dev server just hangs with:

Missing onError handler for invocation 'building-schema', error was 'Error: Schema must contain
uniquely named types but contains multiple types named "GRVSCStylesheet".'. Stacktrace was 'Error:
 Schema must contain uniquely named types but contains multiple types named "GRVSCStylesheet".

This has also been reported over on gatsby repo https://github.com/gatsbyjs/gatsby/issues/30199

I am able to reproduce this in a minimal test case with gatsby-starter-blog + gatsby-remark-vscode + gatsby-source-graphql https://github.com/kremalicious/gatsby-test-case-30199

andrewbranch commented 3 years ago

Interesting find @kremalicious. I had observed earlier that multiple type declarations seemed to merge, which was really useful. I guess that’s not allowed anymore, which is a shame.

kremalicious commented 3 years ago

seems to have been addressed in upstream gatsby for all similar use cases, pending new Gatsby release https://github.com/gatsbyjs/gatsby/pull/30318

andrewbranch commented 3 years ago

Great! This is why I don’t fix bugs too fast 😂

In seriousness, I’m not sure when I’ll have time to get to the rest of this issue, but if someone wants to open a PR updating the peer dep and making sure everything works, I will make the time to review it.

tnorlund commented 3 years ago

I just upgraded to Gatsby 3.0.1, and I'd like to install this package. When I attempt to, Get the error that the peer dependency is for Gatsby v 2.12.1. Is this still an issue?

tnorlund commented 3 years ago

I would really like to help out with this. I have a PR, but I'm not sure how you are handling the Jest testing. The GraphQL queries are off. If I could get the testing working, I'm sure I could increment the packages required for Gatsby V3.

tnorlund commented 3 years ago

How do I NPM install this to my Gatsby site?

andrewbranch commented 3 years ago

Released as v3.2.1. Thanks @tnorlund!

yehezkiell commented 2 years ago

is this already fixed? could not use gatsby-remark-vscode with gatsby version 4.5.4 @andrewbranch

andrewbranch commented 2 years ago

174