refactor(dev/vite): use @mjackson/node-fetch-server
#13927
Draft
+20
−114
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@acusti mentioned in #12774 (comment) that
@mjackson/node-fetch-server
could be used as a drop-in replacement for the currentnode-adapter.ts
fileThis started my journey and I came to the following history of the file:
Since this is not really supported by
@mjackson/node-fetch-server
, I kept the small wrapper.@mjackson if a custom basename would be supported in the lib, then I probably looked over it, so please point me towards the correct docs
If it's not (yet) available in the lib and you would like to somehow support it, I'm happy to help out with a PR
@mjackson I created fix(node-fetch-server): fix logic for aborting requests mjackson/remix-the-web#74 to do the same in
@mjackson/node-fetch-server
:
increateHeaders
https://github.com/mjackson/remix-the-web/blob/4f69c6cdfd71d8c5376269e778f2e3a1611924fa/packages/node-fetch-server/src/lib/request-listener.ts#L180
sendResponse
(yet).@mjackson if it would be supported in the lib, then I probably looked over it, so please point me towards the correct docs
If it's not (yet) available in the lib and you would like to somehow support it, I'm happy to help out with a PR
https
protocol in dev mode #13746 (resubmission of fix(dev): detect https protocol remix#10199) is already handled increateRequest
https://github.com/mjackson/remix-the-web/blob/4f69c6cdfd71d8c5376269e778f2e3a1611924fa/packages/node-fetch-server/src/lib/request-listener.ts#L139-L140
@mjackson I just created refactor(node-fetch-server): add type-safety to
socket
check increateRequest
mjackson/remix-the-web#75 to make it a bit more type-safeSo it seems like once mjackson/remix-the-web#74 is merged (and released) and 2️⃣ & 6️⃣ have more clarity, we can indeed just replace the current
node-adapter.ts
file with@mjackson/node-fetch-server
.Added benefit here is that we don't need to rely on
set-cookie-parser
anymore and we now rely on a lib that's going to be part of Remix v3 anywaysI'm sure people from the wider @e18e ecosystem cleanup (like @43081j & @outslept) will be very happy to see these kind of changes as well