fable-compiler / Fable.Store

Manage state logic in Svelte, React apps and more
MIT License
58 stars 5 forks source link

Feliz Integration #2

Closed Zaid-Ajaj closed 3 years ago

Zaid-Ajaj commented 3 years ago

Via the svelte-adapter/react package which provides a HOC that is automatically applied when using the [<SvelteComponent>] plugin 😁

I have downgraded a couple of packages to FSharp.Core v4.7.2 because using >= 5.0.0 breaks backward-compat with many Feliz packages, also added femto metadata to the main Fable.Svelte package. I wanted to add those to Feliz.Svelte but since it only contains the plugin, embedding just the project file failed and Fable couldn't compile the application

alfonsogarciacaro commented 3 years ago

This is great @Zaid-Ajaj, thanks a lot! Didn't know one could do <PackageReference Update= 😅

alfonsogarciacaro commented 3 years ago

@Zaid-Ajaj I'm getting this error when trying to run the FelizSvelte sample 😕

alfonso@Alfonsos-MacBook-Pro ~/D/F/s/FelizSvelte (main)> npm start

> @ start /Users/alfonso/Documents/Fable.Svelte/samples/FelizSvelte
> dotnet fable watch src --exclude Fable.SveltePlugins --run webpack serve --content-base public

Fable: F# to JS compiler 3.0.1
Thanks to the contributor! @cloudRoutine
src> dotnet restore FelizSvelte.fsproj
  Determining projects to restore...
/Users/alfonso/Documents/Fable.Svelte/samples/FelizSvelte/src/FelizSvelte.fsproj : error NU1102: Unable to find package Feliz with version (>= 1.28.0)
/Users/alfonso/Documents/Fable.Svelte/samples/FelizSvelte/src/FelizSvelte.fsproj : error NU1102:   - Found 141 version(s) in nuget.org [ Nearest version: 1.22.0 ]
  Failed to restore /Users/alfonso/Documents/Fable.Svelte/samples/FelizSvelte/src/FelizSvelte.fsproj (in 1.05 sec).
  2 of 3 projects are up-to-date for restore.
Zaid-Ajaj commented 3 years ago

That's interesting because Feliz v1.28 is available on nuget. Maybe you need to tell dotnet that want to use the latest v3 index to look for the package using Nuget.Config?

alfonsogarciacaro commented 3 years ago

I should have checked that, sorry! It worked after clearing the Nuget cache dotnet nuget locals --clear all, this is great!

Zaid-Ajaj commented 3 years ago

Awesome! Glad you got it working :smile: would be great to push a nuget package and publish the samples into github pages

I think I will push a new version of Feliz.Svelte which includes the svelte-adapter npm dependency (i.e. femto metadata) because maybe it doesn't make a lot of sense to put it in Fable.Svelte