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

Mocked node req and res proxies #472

Closed
pi0 opened this issue Jul 31, 2023 · 1 comment
Closed

Mocked node req and res proxies #472

pi0 opened this issue Jul 31, 2023 · 1 comment
Assignees
Labels
discussion enhancement New feature or request

Comments

@pi0
Copy link
Member

pi0 commented Jul 31, 2023

(see #73 for context)

With unenv we provide almost full Node.js compatibility layer for h3 and nitropack.

However, we are going to remove Node.js dependency step by step and make sure h3 is fully platform agnostic by itself and without or with minimum breaking changes.

For this, I am thinking to introduce a lighter proxy shim for req and res, to use it internally ourselves first and make sure all tests pass with the proxies instead of actually depending on Node.js. It is also useful to develop a web fetch adapter asap (#458)

Nitro mocks might be useful to inspire: https://github.com/unjs/nitro/blob/f71cdebd3003f25c27de6570fb1f9bfab31c67b1/src/runtime/cache.ts#L227

@pi0 pi0 added enhancement New feature or request discussion labels Jul 31, 2023
@pi0 pi0 self-assigned this Jul 31, 2023
@pi0
Copy link
Member Author

pi0 commented Aug 2, 2023

Thinking more, it is too much rework for h3 v1 to reimplement req, res. Using unenv is much much safer.

@pi0 pi0 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant