gosling-lang / gosling.js

Grammar of Scalable Linked Interactive Nucleotide Graphics
https://gosling.js.org
MIT License
160 stars 27 forks source link

Any plan to upgrade the React version for Gosling React components? #815

Open timtong1982 opened 2 years ago

sehilyi commented 2 years ago

Hi @timtong1982, thank you for reaching out!

The React version of Gosling is dependent on HiGlass. There is an open PR to upgrade the React version of HiGlass to v18 (https://github.com/higlass/higlass/pull/1104). Once it is merged into the main branch of HiGlass and released, I will upgrade the React version in Gosling.

I will follow up on the PR to see when/if it could be merged.

timtong1982 commented 2 years ago

Thank you @sehilyi !

mwittep commented 8 months ago

Hi @sehilyi ! Do you know if there is any news regarding updating HiGlass to a more recent version of React? I am only able to run Gosling without the "StrictMode" of React. Otherwise, I get the error below. From the error I could interpret that is due to the old syntax of Gosling.

Error Warning: Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details. Move code with side effects to componentDidMount, and set initial state in the constructor. Please update the following components: HiGlassComponent
Dependencies ```json { "@testing-library/jest-dom": "^5.16.4", "@testing-library/react": "^13.1.1", "@testing-library/user-event": "^13.5.0", "@upsetjs/react": "^1.11.0", "gosling.js": "^0.13.2", "higlass": "^1.13.3", "http-proxy-middleware": "^2.0.6", "install": "^0.13.0", "jszip": "^3.10.0", "lodash": "^4.17.21", "npm-run-all": "^4.1.5", "pixi.js": "^6.5.10", "plotly.js-cartesian-dist-min": "^2.12.1", "react": "^18.0.0", "react-dom": "^18.0.0", "react-plotly.js": "^2.5.1", "react-router-dom": "^6.3.0", "react-scripts": "5.0.1", "react-spinners": "^0.12.0", "react-table": "^7.8.0", "web-vitals": "^2.1.4" } ```
sehilyi commented 8 months ago

Hi @mwittep and @timtong1982, I forgot to follow up on this issue, and we now support the most recent React versions. The editor implemented in this repo also uses React 18.

@mwittep, The StrictMode does not display anything but shows potential warning and error messages, so it is correct to use Gosling without StrictMode. The warning message about UNSAFE_componentWillMount is coming from the fact that HiGlass still uses old React syntax, but so far we have not found any issues with that in multiple Gosling-based applications. So, I think you can safely ignore the warning message.