Zaid-Ajaj / tabula-rasa

Minimalistic real-worldish blogging platform, written entirely in F#, made as a learning reference for building large Elmish apps
199 stars 16 forks source link

Port to Giraffe? #32

Closed davedawkins closed 4 years ago

davedawkins commented 4 years ago

This is an amazing project, thank you.

I found it while trying to find a safe-stack starter that used LiteDB.FSharp.

Unfortunately Saturn (safe-stack, netcoreapp3.x) precludes the use of LiteDB (at least, I got framework incompatibility errors that I don't yet know how to resolve). So I searched again and ended up here, linked from the safe site.

So this project looks to be safe-friendly, maybe apart from the use of Suave (they seem to imply you'd want to move away from Suave). So, I'd like to ask:

Thanks again for this project and LiteDB.FSharp.

davedawkins commented 4 years ago

Well. Giraffe targets netcoreapp3.1 and LiteDB targets netstandard2.0 so I don't think this will be possible. Since LiteDB is the main requirement for me at this point I'll stick with Suave!

Zaid-Ajaj commented 4 years ago

Hi @davedawkins, I am glad you liked the project!

So this project looks to be safe-friendly, maybe apart from the use of Suave

The funny thing is, this project existed before SAFE was a thing so that is why the structure is a "bit" different.

What's your opinion on Suave vs Giraffe?

Suave is really nice for for small apps without a lot of requirements. Giraffe is more modern with its AspNet core integration.

Is this project portable to Giraffe?

Yes! But I haven't had the time to actually port it.

Is it worth doing?

If you want to learn a bit of Giraffe, then it is worth it but generally speaking this project wouldn't benefit from a web framework change because it uses Fable.Remoting which makes forget about all the Http and data transport business

Well. Giraffe targets netcoreapp3.1 and LiteDB targets netstandard2.0 so I don't think this will be possible.

That shouldn't matter, you can still use netstandard2.0 libraries with netcoreapp3.1 applications. The problem right now is that LiteDb.FSharp cannot use latest LiteDB v5 because of breaking changes, see this issue. But it does work if you install LiteDB v4 alongside LiteDB.FSharp

davedawkins commented 4 years ago

Thanks for the response. I could see it was a little different, but it's nice that it's linked from SAFE. I may have a go at porting it then -- I understand the principle of netstandard, but I'm easily confused when trying to work out what works with what. I was getting compile errors and assumed it was standard2.0/coreapp3.1 issues.

Cheers!

davedawkins commented 4 years ago

Kind of related. I've added LiteDB.FSharp to an instance of the new SAFE template here

https://github.com/davedawkins/SAFE-template-with-LiteDB

Referenced this project