0
kirui
4y

What js framework is best for .NET?

Comments
  • 0
    .Net doesn't run js. Did you mean graalvm?
  • 1
  • 0
    @kirui Asp is server side though? Am being stupid or is there some connection to JS that I'm not aware of?

    EDIT: Oh you mean what clientside js framework is best in combination with ASP.NET. Don't know, they all kinda suck. Maybe try Svelte but that's more of a platform than a framework
  • 1
    @kirui
    That neither blends nor microwaves. Start with vanillajs and see where it takes you.
  • 0
    @12bitfloat you could use js on your ASP.NET Views... Razor pages, so I was seeking opinions on js frameworks that fit well with that.
  • 0
    dotnet-js /s
  • 0
    @kirui Wat. Why would you even want to do that, I'm so confused
  • 0
    @12bitfloat what if I need to fetch result without reloading the page?
  • 4
    @kirui
    I wouldn't recommend that most of the time, given how browser rendering works. Razor pages are for producing modestly dyanamic server side rendered content. Their server-oriented model isn't suited for much js dynamism, so you end up producing polyglot spaghetti solutions with innumerable cross-cutting concerns that are non-deterministic in terms of debugging.

    If you're looking for a js framework, pick a spa framework (any of them are fine) and use aspnet core to write an API for data interaction and serving the base index file. Microsoft will recommend angular or react in that order.

    Important concepts:

    https://developers.google.com/web/...

    https://developers.google.com/web/...

    From the information above, you find some very specific issues with the razor pages + js design:

    - with disconnected frameworks (jQuery, bs, etc), you have no way to control when updates occur relative to one another (shit performance, chaos)
    - a spa framework served over razor pages will require you to either hijack a routing framework, or deploy large amounts of duplicate data (complexity and pattern violation or excessive data transfer are your two options)

    Tl;Dr blending server side rendering and js is a great way to punish both yourself and your users. Don't cross the streams.
  • 2
    Honestly, I'd just go with an oldschool C# backend without a frontend framework. I personally have never had a good experience with any js framework. Either they have bad performance, really odd architecture or force you to use some assbackwards paradigm like flux

    The best thing I've seen is Svelte but their Typescript support still isn't final and it's not a framework really, anyways
  • 2
    @12bitfloat
    I write intensely performant angular, and It's definitely not easy. That said, it's grokkable for .net users as it is basically the same architecture, paradigm and injector strategy as aspnet mvc.
  • 1
    @SortOfTested Just hearing Angular makes the hairs on the back of my neck stand up.
    I haven't tried it to be fair. Probably should and see for myself

    Does it do TypeScript?
  • 0
    @12bitfloat
    If words like "MVVM," "reactivex" and "alt.net" make you happy, it's great. If not, here thar be dargons.
  • 0
    @SortOfTested They do, I'm quite fond of MVVM. And now that you mention it, I actually do need a frontend framework. Maybe not a bad time to check it out :D
  • 0
    There's a Blazor.. Though new and I don't know it's support and community. Any experience?
Add Comment