Skip to content

Conversation

@CertainLach
Copy link
Contributor

@CertainLach CertainLach commented Sep 16, 2025

Fresh uses vite in dev mode, and vite uses node:http server for requests

However Fresh itself uses Request/Response objects everywhere, requiring conversions between native and node requests. To avoid that, deno:request event allows access to the original deno request for users of node:http

Fresh counterpart: denoland/fresh#3446

Context:

@CertainLach
Copy link
Contributor Author

Draft until further course of action is suggested by fresh maintainers

@CertainLach
Copy link
Contributor Author

At the same time, I would like to get feedback from the Deno side.
As far as I can see, there was no precedents to providing access to deno types from node api, yet there is at least this use-case.

@CertainLach CertainLach marked this pull request as ready for review September 16, 2025 14:17
}
}

export class DenoRequestEvent {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to use extends Event there so that users would use typical e.preventDefault() pattern, but it seems strange to mix node's EventEmitted with browser events.

It would also require both setting pendingResponse and cancelling the event, instead of just setting the response field

@CertainLach CertainLach force-pushed the feat/experiment-http-deno-request-event branch 2 times, most recently from fc0ab3d to 409343a Compare September 18, 2025 03:26
@CertainLach CertainLach force-pushed the feat/experiment-http-deno-request-event branch from 409343a to bf72bdd Compare September 19, 2025 13:43
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.

1 participant