Supporting SSR scenarios
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 25/100
- Issue 類型
- 功能
- 描述清晰度
- 需要釐清
- 活躍度
- 停滯
- 技術堆疊
- csharp, node.js, react, typescript, vite
研究方向
先檢視連結的原型,尤其是其中經過修改的 init.js、NodeSsrHost.cs 和 vite.config.ts,以及 issue #440 和 #330。釐清預期的貢獻是為已初始化的 CLR host 提供可重複使用的 SSR 支援、在建置時重寫 import,還是兩者兼具;done 應定義為已接受的設計和可正常運作的 SSR 覆蓋範圍。
由索引模型根據 Issue 內容生成。
描述
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.0and there's an issue with that #440 - You can't use the
node-api-dotnetnpm 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!
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:
- 主要語言
- C#
- 星號
- 788
- 分支
- 80
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
microsoft/node-api-dotnet 的其他 Issue
-
難度 1/5 1-3 小時 新手友好度 88/100
microsoft/node-api-dotnet#484 ·
-
Embedding args occasionally get trailing garbage on .NET (missing null terminator on a pooled buffer)可能已有人在做 @tolmachev-pravo 於 98 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 82/100
microsoft/node-api-dotnet#481 ·
-
JSError.ThrowError(Exception) aborts the process when a Worker terminates during a .NET call可能已有人在做 @GalaxiasKyklos 於 6 天前認領。 未關閉
難度 4/5 3-5 天 新手友好度 18/100
microsoft/node-api-dotnet#505 ·
-
難度 3/5 1-2 天 新手友好度 70/100
microsoft/node-api-dotnet#504 ·
-
難度 3/5 1-2 天 新手友好度 82/100
microsoft/node-api-dotnet#502 ·
查看 microsoft/node-api-dotnet 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 66/100
gavin-wolfe/wolfden#104 ·
維護者通常 1 天內回覆
-
[BUG] Still libmicrohttpd dependency is not removed properly from External-Dependency-Info.txt file未關閉type/bug
難度 1/5 1 小時以內 新手友好度 72/100
維護者通常 1 天內回覆
-
[辞書] かんそうりつ->乾燥率未關閉辞書
難度 1/5 1 小時以內 新手友好度 62/100
維護者通常 1 天內回覆
-
bug good first issue
難度 2/5 1-3 小時 新手友好度 76/100
thomhurst/TUnit#7201 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 88/100
ArduPilot/MissionPlanner#3826 ·
維護者通常 1 天內回覆