CompositionalIT / feliz-ag-grid

9 stars 4 forks source link

Pin Fable.React to version 7 or below #12

Closed mattgallagher92 closed 5 months ago

mattgallagher92 commented 1 year ago

Currently, the following doesn't work:

It results in the following error:

matt@matt-framework:~/dev-cit/cit/exploratory/SafeWithAgGrid$ dotnet femto install Feliz.AgGrid src/Client
[15:31:18 INF] Analyzing project /home/matt/dev-cit/cit/exploratory/SafeWithAgGrid/src/Client/Client.fsproj
[15:31:18 INF] Running dotnet restore against the project
[15:31:20 INF] Detected paket.references file -> use paket
[15:31:20 INF] Installing Feliz.AgGrid within dependency group Main
[15:31:20 INF] Using locally installed paket
[15:31:27 INF] ✔ Nuget package Feliz.AgGrid installed successfully
[15:31:27 INF] Resolving potentially required npm packages with femto --resolve
[15:31:27 INF] Analyzing project /home/matt/dev-cit/cit/exploratory/SafeWithAgGrid/src/Client/Client.fsproj
[15:31:27 INF] Running dotnet restore against the project
[15:31:30 INF] Using npm for package management
[15:31:35 INF] Found package.json in /home/matt/dev-cit/cit/exploratory/SafeWithAgGrid
[15:31:36 INF] Executing required actions for package resolution
[15:31:36 INF] Uninstalling [react, react-dom]
[15:31:38 INF] Installing dependencies [react@18.2.0, react-dom@18.2.0, ag-grid-community@25.3.0, ag-grid-react@25.3.0, bulma@0.9.4]
[15:31:40 ERR] Error while installing react@18.2.0, react-dom@18.2.0, ag-grid-community@25.3.0, ag-grid-react@25.3.0, bulma@0.9.4

The problem seems to be that this upgrades Feliz to v2, which relies on Fable.React.Types v18 (NuGet), which in turn relies on React 18 (npm), while Feliz.AgGrid relies on ag-grid-react v25 (npm), which in turn relies on React 16 or 17 (npm).

To get around this problem, we need to ensure that there is no dependency on Fable.React.Types v18. This can be achieved by pinning Feliz to v1 and Fable.React (which Feliz v1 relies on) to v7. We have to pin Fable.React to v7, because v8 relies on React 18, and v9 relies on Fable.React.Types v18 (relies on React 18 (npm)).

This needs to take effect in the NuGet package, which I think probably means adding Fable.React to ./src/Client/paket.references. It's not enough to restrict just Feliz, because Feliz v1 specifies Fable.React >= 7.4.0, so allows Fable.React 8 or 9.

mattgallagher92 commented 1 year ago

An alternative might be to instead upgrade this to work with React 18, but we should probably wait for SAFE Stack to do that first.

isaacabraham commented 5 months ago

We now have SAFE 5 and there's at least one issue on this repo about upgrading the deps - can this be closed?