daniilsokolyuk / nodereact.net Goto Github PK
View Code? Open in Web Editor NEWLibrary to render React library components on the server-side with C# as well as on the client.
License: MIT License
Library to render React library components on the server-side with C# as well as on the client.
License: MIT License
Hi!
Thanks for a truly great and smart package!
I was looking at this package as an alternative to ReactJS.NET since I would like to be able to use React v18 and SSR for things like React.Suspense
.
I'm running NodeJS on my machine and I played around with this library to compare, I like the API and it feels really easy to use. However, when I made a simple little comparison for the performance I was a little concerned. I basically had the same application with both libraries and just switched between them to run the test. I know that the test with NodeReact.NET probably should be slower since it handles/renders the content inside a React.Suspense-component and also since it's interop to node, but the throughput was quite low.
I used a simple tool called NetLing to send some requests to the server (was running IIS Express via Visual Studio) and found that:
This was done on a quite big machine with an Intel Core i9 12900K processor. I'm wondering if I did something wrong here? Are the numbers too off from what you would expect? Is there anything I can do to improve this? I'm thinking of configuration, set up etc. Is there any settings that would be "preferable" over others? I know that documentation is not the funniest thing to spend time on but I would very much like to try to squeeze as much as possible out of this to know if it would be a viable solution for upcoming projects so it would be valuable to know more about the "recommended" setup.
Once again, thank you very much for sharing the great work done so far!
UPDATE:
I figured I wanted to try this again with only NodeReact.NET and it looks to me that there is something around the threading, when there are more threads hitting the page the RPS goes down maybe this is the interop to NodeJS that has some bottlenecks? It would interesting to see if and how things can be configured for better throughput.
*UPDATE AGAIN:
Rookie-mistake on my end. I was hitting the app when it was built in Debug-mode, after switching to Release mode I got a lot better throughput. It's strange that ReactJS.NET performed so much better in Debug mode but these numbers are a lot better than the once I saw in Debug mode.
Sorry for putting on a "false alarm". Maybe this is something that should be mentioned in docs somewhere so that people don't think that the package is slow.
Hi,
We were planning to move our dotnet core application that renders react on the server using ReactJS.Net to linux, for which we switched from using JavaScriptEngineSwitcher.V8 to JavaScriptEngineSwitcher.ChakraCore but were facing some issues with ChakraCore.
So as per @Taritsyn 's suggestion We tried out JavaScriptEngineSwitcher.Node . While JavaScriptEngineSwitcher.Node is working fine on linux, the performance when compared to JavaScriptEngineSwitcher.V8 is not good (p50 of ~90ms on V8 vs p50 of ~160ms on Node) for rendering our webpages.
We are unable to use NodeReact.NET due to #5 .
As per this the above observation is correct but the benchmarks provided in NodeReact.NET prove otherwise that better performance can be achieved with Node.
I would like to understand why NodeReact.NET has better performance than ReactJS.Net + JavaScriptEngineSwitcher.Node. Is it because of using workerpool ? or something else.
Thanks.
Hi, I want to try this library but the lack of support for Render functions is a blocker for me. Can it be implemented in NodeReact.Net ? I'd be happy to help.
Are you open to a pull request to add support for .NET Framework 4? I have it started in a POC on my local machine and would be willing to clean it up and submit a PR if it would be considered.
Also im working on workaround support for MUI/Emotion/StyledComponents with the renderToPipeableStream and would like to also see about maybe getting that PR'd in around a feature flag for people to opt-in to add its usage
Are there any examples of usage?
Also how would we leverage something like Material UI? Currently I do this using render functions
Reference: Moving createRoot/hydrateRoot to react-dom/client
Thoughts on updating these references
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.