Zaid-Ajaj / Elmish.AnimatedTree

An animated tree user interface made for Elmish applications
10 stars 1 forks source link

react-spring API has changed #15

Open zelenij opened 2 years ago

zelenij commented 2 years ago

From here - https://react-spring.io/changelog :

image

But this binding doesn't seem to be aware of this, since it hasn't been updated for a couple of years :)

I suspect the later versions of react-spring removed the module altogether, since I'm getting this now:

ERROR in ./.fable-build/.fable/Elmish.AnimatedTree.1.1.0/animated-tree.js
Module not found: Error: Can't resolve 'react-spring/renderprops' in '/home/<...>/.fable-build/.fable/Elmish.AnimatedTree.1.1.0'
 @ ./.fable-build/.fable/Elmish.AnimatedTree.1.1.0/animated-tree.js 11:0-50 177:50-56
 @ ./.fable-build/.fable/Elmish.AnimatedTree.1.1.0/AnimatedTree.fs.js                                                                                                                                              
 @ ./.fable-build/modules/Omnicv.Diary.Client/DiaryClientUtils.js
 @ ./.fable-build/App.js                                                                                 
 @ multi /home/<...>/node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js /home/<...>/node_modules/@pmmmwh/react-refresh
-webpack-plugin/client/ErrorOverlayEntry.js ./.fable-build/App.js

From yarn.lock:


"@react-spring/animated@~9.2.5-beta.0":
  version "9.2.5"
  resolved "https://registry.yarnpkg.com/@react-spring/animated/-/animated-9.2.5.tgz#7c52e4845b572459a922bc8f5b07122293eede07"
  integrity sha512-SDIgozNdxQ8xj4xbrF9aDsU/xyZ1WlnbnLo6BAvTciVIwp4Zhbt8keISQ2bq3THDjPxQbRTzxry8pSW2qUwXaw==
  dependencies:
    "@react-spring/shared" "~9.2.5-beta.0"
    "@react-spring/types" "~9.2.5-beta.0"

"@react-spring/core@~9.2.5-beta.0":
  version "9.2.5"
  resolved "https://registry.yarnpkg.com/@react-spring/core/-/core-9.2.5.tgz#fd0cae8e291467dcb94d5dc4eabe43e07cca9697"
  integrity sha512-3pQOA1QyEu3/8tEfZ0DGklPULyM+bXqJE0JJ0S0lBUivd2MvxhVbJzqoHKxdoHI8CsVSFWMNwwJQ4Vd/XpAk8w==
  dependencies:
    "@react-spring/animated" "~9.2.5-beta.0"
    "@react-spring/shared" "~9.2.5-beta.0"
    "@react-spring/types" "~9.2.5-beta.0"
Zaid-Ajaj commented 2 years ago

Hi @zelenij, thanks for filing the issue.

How exactly did you install react-spring intro your project? Just using npm install react-sprint will always bring in the latest version which a binding might not necessarily support. I would highly recommend you use Femto to install the package as follows:

femto install Elmish.AnimatedTree

And it will resolve the matching react-spring package used by this binding.

zelenij commented 2 years ago

You are right, I installed the package directly using yarn. So I uninstalled react-spring and then used femto to install the AnimatedTree package, which in turn pulled react-spring 8.0.1, so all good. But now I'm getting this exception, when trying to display a very simple tree with about 10 nodes. Any thoughts?

image

Zaid-Ajaj commented 2 years ago

Never seen this error before to be honest. I'll need to investigate

bennylynch commented 2 years ago

Hi - This error only manifests with fable-library >= 3, it seems. It fails in fable-library/Utils.js in ObjectRef.id, with the error 'WeakMap key must be an object', no matter what type is used as a Key in AnimatedTree. I think it must be an issue with fable-library. A workaround I've found is to comment out |> List.distinctBy fst in buildProps.