SAFE-Stack / SAFE-template

dotnet CLI template for SAFE project
MIT License
280 stars 87 forks source link

Consider Perla dev server #532

Closed nojaf closed 1 year ago

nojaf commented 1 year ago

Hello,

I'm not sure if this is the right place to bring this up, but I would like to make a suggestion for SAFE. For the past couple of months, I've been using https://perla-docs.web.app/ to develop my Fable applications.

The biggest pro of this is that you don't need to install NodeJS, and especially on Windows, that sparks a lot of joy. You only need the dotnet SDK and you can have a very similar experience.

It doesn't have all the bells and whistles yet that Vite would have, but it is enjoyable nonetheless. There is a browser refresh mechanism when your code changes and a lot of other options. For first-time F# users, the story is somewhat simpler as you don't need to rely on other front-end experiences.

I merely want to plant a little seed here, I believe this is something worth looking out for.

//cc @angelMunoz

AngelMunoz commented 1 year ago

Thanks for the considerations and I'm very glad that has been your experience!

I guess I can add what my perspective on the matter is.

The Perla dev server is based on the premise that most browsers can execute modern HTML/CSS/JS code so anything that stays in that path is going to have a very nice time using perla, Fable thankfully sticks to JS in most cases which makes it seamless integration to this flow.

but as @nojaf mentioned the keep it simple mantra means a few drawbacks

While I'm working towards better importmap generation support, offline end builds, HMR and other nice things, most of these are not a show stopper for most of the F# devs specially if they are getting started with F# and web dev.

Setting a perla project is very similar to switching out webpack for vite, and perla follows the convention over configuration mindset (although there's a lot of configurable areas if needed)

My goal ultimately is to have an F# friendly node-less tooling experience that somewhat matches what other tools in the JS ecosystem that is painless, just works, and is efficient.

That being said, feel free to ping me if there are scenarios that SAFE must support and don't play well with perla. I'd be glad to see what I can do about them.

AngelMunoz commented 1 year ago

Also for the good sport, this is a SAFE created app with perla https://github.com/AngelMunoz/SafePerla if you have further questions or comments, let me know

theimowski commented 1 year ago

I had a quick glance at the Perla project - and it looks pretty cool! I like the idea of removing node.js dependency, this indeed could be a selling point for people with .net background and little front end experience. Not yet sure how it'd fit the SAFE template given its adoption, but nonetheless happy to discuss 👍

theprash commented 1 year ago

Thanks for the suggestion @nojaf, but for reasons described above it seems unlikely we'll switch to Perla. I'll close this as it's not an issue to track but discussion can certainly continue here.