Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(demo): use h3/nitro for deployment packaging #146

Closed
wants to merge 15 commits into from

Conversation

hi-ogawa
Copy link
Owner

@hi-ogawa hi-ogawa commented Dec 21, 2023

todo

blocker?

Actually there are too much indirection between web req/res and node req/res due to:

  • in edge runtime adapters, nitro reads Request.body ahead of time...

https://github.com/unjs/nitro/blob/c40a3bd0cb13799ce00d66173eb8107277d6e5e5/src/runtime/entries/cloudflare-module.ts#L49
https://github.com/unjs/nitro/blob/c40a3bd0cb13799ce00d66173eb8107277d6e5e5/src/runtime/entries/vercel-edge.ts#L9

  • then h3's toWebRequest will make it back to ReadableStream...

https://github.com/unjs/h3/blob/53703dc860f1ff6fe7ce71d543deff1cfa810b11/src/utils/request.ts#L181-L192

  • also nitro actually makes use of toNodeListener internally...

https://github.com/unjs/nitro/blob/c40a3bd0cb13799ce00d66173eb8107277d6e5e5/src/runtime/app.ts#L95-L105

The movement to reduce indirection on h3 seems to be finished in:

But maybe nitro integration still has some issue?

@hi-ogawa hi-ogawa marked this pull request as draft December 21, 2023 08:21
@hi-ogawa hi-ogawa closed this Jun 10, 2024
@hi-ogawa hi-ogawa deleted the refactor-nitro-adapter branch June 10, 2024 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

integrate nitropack for deployment
1 participant