Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Supporting SSR scenarios

Abierto
#460 0 comentarios 2 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
csharp, node.js, react, typescript, vite
Área
backend, web-dev

Línea de trabajo

Comienza revisando el prototipo enlazado, especialmente su init.js parcheado, NodeSsrHost.cs y vite.config.ts, junto con los issues #440 y #330. Aclara si la contribución prevista es compatibilidad SSR reutilizable para un host CLR ya inicializado, la reescritura de imports durante la compilación, o ambas cosas; done debe definirse mediante un diseño aceptado y una cobertura SSR funcional.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

One of my motivations to use this is for using my .NET server as a runtime for my React frontend. In order to do that, I need to execute SSR code through Node.js in .NET and I think the two options right now are edge-js and node-api-dotnet.

I've completed a prototype of supporting React Router SSR with node-api-dotnet here:

https://github.com/kamranayub/dotnet-ssr

However, I did run into a few issues:

  • Debugging doesn't work, since it's targeting net8.0 and there's an issue with that #440
  • You can't use the node-api-dotnet npm package vanilla within SSR context because the CLR host is already initialized #330

For the second issue, I've worked around it by patching the init.js manually and injecting a dotnetHost global, which works!

https://github.com/kamranayub/dotnet-ssr/blob/be9dc260c5cc23c31f037cc60e74872c7fd8d30a/web/patches/node-api-dotnet%2B0.9.15.patch

https://github.com/kamranayub/dotnet-ssr/blob/be9dc260c5cc23c31f037cc60e74872c7fd8d30a/src/server/NodeSsrHost.cs#L57-L71

I think this could be contributed back to the library, but not sure where/how to do that. I'm up for it if that would be accepted, I just need some guidance.

I haven't yet prototyped this with edge-js, I only know it also does in-proc communication -- what I don't know is if I can set it up like this so the SSR code can invoke .NET APIs, plus I love that this generates the typedefs which make this work great under Vite dev mode 🚀

To get that working, you need to rewrite the import paths at build time:

https://github.com/kamranayub/dotnet-ssr/blob/be9dc260c5cc23c31f037cc60e74872c7fd8d30a/web/vite.config.ts#L12-L65

Lenguaje dominante
C#
Estrellas
783
Forks
80
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microsoft/node-api-dotnet

Todos los issues de microsoft/node-api-dotnet

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.