tterb / gatsby-plugin-disqus

:speech_balloon: A plugin for adding Disqus comments to GatsbyJS
https://brettstevenson.io/gatsby-plugin-disqus
MIT License
45 stars 5 forks source link

Support React 18 #58

Closed ScottG489 closed 2 years ago

ScottG489 commented 2 years ago

Describe the bug I'd like to be able to use this package in a project that also depends on React 18

Peer dependencies specify compatibility with only React 16 or 17:

  "peerDependencies": {
    "react": "^16.0.0 || ^17.0.0"
  },

To Reproduce
Steps to reproduce the behavior: Add this project as a dependency of a project that also has a dependency on react 18 and try to npm install. NPM will report dependency conflicts.

Expected behavior
For there to be no dependency conflicts when used in a project alongside React 18.

Screenshots
N/A

Specifications:

Additional context
Not sure if this should have been reported as a feature or bug, but I felt bug was more applicable.

This is a great and easy to use project! Do you suspect there are any blockers to this other than adding it to the package.json?

ScottG489 commented 2 years ago

It seems like actually your (green) build is already running against React 18 since as part of it you run yarn add react react-dom which installs the now latest version of 18.

I also updated package.json accordingly:

  "peerDependencies": {
    "react": "^16.0.0 || ^17.0.0 || ^18.0.0"
  },

And the build and tests still pass. Let me know your thoughts!

tterb commented 2 years ago

@ScottG489 This has been on my radar, I just haven't gotten around to updating it yet 👍

Also, I think you are correct about the build running v18, but looking at it now, it probably makes more sense to check against all the react/react-dom versions that are included in the peerDependencies in the build to make sure the compatibility is up-to-date.

I'll try to get an update pushed in the next few days.

ScottG489 commented 2 years ago

Thanks so much, that would be great! Let me know if I can help at all.