Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The coup de grace is functioning and sane server side rendering of ReactJS apps by c# applications. If Microsoft can make that easy and simple it will lead to a huge churn as many software companies replace less efficient nodeJS applications for that use case. Typescript will always have its placed client-side but there will be huge user benefits if we can have more and better server side rendering.


You can already do that by running Node with SSR (or any npm/js code) in .NET using Node Services [1] or use ReactJS.NET that packages everything for you [2].

But Microsoft won't officially do any more since they have Blazor which lets you run C#/.NET in the browser with both client-side WASM and server-side SignalR/websocket running modes. It's much more advanced and functional than React already. [3]

1. https://channel9.msdn.com/Events/ASPNET-Events/ASPNET-Fall-S... 2. https://reactjs.net/ 3. https://dotnet.microsoft.com/apps/aspnet/web-apps/blazor


Blazor is currenlty hobbled by having to haul its runtime across the wire and is thus not in a position to compete with React or Vue.


The server-side model doesn't have this issue and the client-side WASM model is brand new with the first production release a month ago so it will get better soon.

The browser runtime is trimmed down to the APIs actually used, has dynamic async loading now, and it's around the 1.5MB mark which is competitive with the big SPA payloads.


But those "big SPA payloads" contain the whole app. With Blazor you incur a 1.5Mb overhead before you've written any app code. That's simply unacceptable on many devices so Blazor's current implementation is only relevant for internal apps.


Same with Blazor. The mon.wasm runtime is around 400kb compressed and the biggest DLL is mscorlib at 600kb. The actual DLLs for the app are just a few kb.

Here's a very old build: https://blazor-demo.github.io/

And a recent build: https://stevesandersonms.github.io/BlazorOnGitHubPages/

Yes you can be smaller with JS but not by much these days, and given the amount of functionality you get with Blazor it's hard to compare on file size alone. Also if you're just making internal apps with controlled usage then server-side is better anyway.


Very cool, thank you for sharing.

> It's much more advanced and functional than React already.

I’m sure this is true, but I can’t imagine there’s much of a community around it? The thing is with React you have a huuuuuuge community and ecosystem. You can share code with React Native. It’s so deep...


Well Blazor is new so React will have a bigger community, however there are millions of C# devs around the world and they can be instantly productive with Blazor so it shouldn't be that far behind, if at all.

While React's ecosystem might be huge, the quality trails off quickly and it's pretty messy even with the popular stuff, much of which is to add functionality that every app needs but isn't included in React itself. Blazor already comes with everything included, but can also use the full power of C#, the massive standard library, plenty of 3rd-party packages, and the tight integration with the backend.

I suggest looking at some of the Blazor presentations (by Steven Sanderson the original creator) to get a sense of just how quickly you can build: 1. https://www.youtube.com/watch?v=Khn7sDUSEJM 2. https://www.youtube.com/watch?v=QnBYmTpugz0 3. https://www.youtube.com/watch?v=kLhoRyLxwAE


I like Blazor, but to be fair, coming from VueJs, it feels not finished. Some things are just more complicated that they should be. But things are changing, so we will see what happens in the next releases.


Sadly Node Services has gone the way of the Dodo bird. I'm not aware of any replacement.

https://github.com/dotnet/aspnetcore/issues/12890


Yea I'm in that thread. It's no longer maintained by Microsoft but the code still exists and runs just fine, and there's not much to maintain other than keeping up with the Node releases and API changes.

The closest community project is https://github.com/JeringTech/Javascript.NodeJS and should be a drop-in replacement for `INodeServices`

If you just want V8/JS scripting then there's https://github.com/microsoft/ClearScript


Have you used it by chance with .NET Core 3 or .NET 5? I was considering using it for some tooling during the build process without using Node.


.NET Core 3 can still use the existing NodeServices package, it'll just show `obsolete` warnings. Haven't tried with .NET 5 yet but will probably switch to that first linked package.


I really enjoy how TS is the same on server and client. The C# runtime is way richer, but I like the TS type system more. Not sure I’d want to use different platforms on backend/front end even if C# did server rendering like React.



Yeah this is one of the ways I think C# is clearly improvable is having a type system closer to TS.


Not sure what you mean by different platforms. Did you mean languages as React and Node are separate entities? Personally, if I had to hire a developer the minimum requirement would be competence in JS/React and a statically-compiled server-side language. JS-only developers are to be avoided.


Different platforms meaning JavaScript vs C# vs Java and their respective runtimes. Yes server and client JS are not the same runtime but they are easy enough to smooth over that they are practically “the same”

Yes a JS only developer is probably lacks certain experience but I am well versed in Java and have had solid exposure to C#, like they them both a lot, but today would prefer to use TS on backend and front end for any small project. The fact that I can share types and validation code (Joi) on both server and client is really powerful in my opinion. There’s only so much you have time to focus on when you’re working on a small project. Context switching two platforms is a big impediment in such cases.


Out of curiosity what if I'm good, say above average, with C# backend, but never used React commercially, though have used Vue on personal projects for the last several years, but consider my JS a bit of a weak spot?


If was thinking more about full-stack development so professionally you'd need some commercial exposure with JS.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: