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#
- 星标
- 783
- 派生
- 80
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/node-api-dotnet 的其他 Issue
-
难度 1/5 1-3 小时 新手友好度 88/100
microsoft/node-api-dotnet#484 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
microsoft/node-api-dotnet#481 ·
-
难度 5/5 一周以上 新手友好度 35/100
microsoft/node-api-dotnet#486 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 35/100
microsoft/node-api-dotnet#483 · 1 条评论 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 45/100
microsoft/node-api-dotnet#479 ·
查看 microsoft/node-api-dotnet 的全部 Issue
相似的 Issue
-
ci-failure-cause test-failure
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
-
area:frontend bug FE hotspot:css mvp P3
难度 1/5 1 小时以内 新手友好度 90/100
klasolsson81/jobbliggaren#1856 ·
维护者通常 1 天内回复
-
Area: App+Library Build
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
Aaronontheweb/freshdesk-cli#148 ·