Skip to content

feat(remix-node): replace extended classes for NodeRequest & NodeResponse with interface type casts#7109

Merged
jacob-ebey merged 2 commits into
devfrom
jeeyoungk-request-retarget
Aug 9, 2023
Merged

feat(remix-node): replace extended classes for NodeRequest & NodeResponse with interface type casts#7109
jacob-ebey merged 2 commits into
devfrom
jeeyoungk-request-retarget

Conversation

@jacob-ebey

@jacob-ebey jacob-ebey commented Aug 8, 2023

Copy link
Copy Markdown
Member

Retarget to dev of #7069, credit to @jeeyoungk

Closes #3480
Closes #4148
Closes #4395
Closes #7059

This is a fix for the referenced issue; The fix is by

  • Replace NodeRequest and NodeResponse classes with interfaces.
  • However, class is still needed (as people may want to do new NodeRequest or x instanceof NodeRequest). For this purpose, WebRequest and WebResponse are exposed as classes.

This code is quite tricky as we're exporting types and values separately. The correct way of doing this is to define a type and value with the same identifier, export handles this correctly.

  • Docs
  • Tests

Testing Strategy: new integration and unit tests

…onse with interface type casts

Co-authored-by: jeeyoungk
Co-authored-by: Michaël De Boey <info@michaeldeboey.be>
Co-authored-by: Jacob Ebey <jacob.ebey@live.com>
@changeset-bot

changeset-bot Bot commented Aug 8, 2023

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 948d7c4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@remix-run/node Patch
@remix-run/architect Patch
@remix-run/express Patch
@remix-run/serve Patch
@remix-run/testing Patch
@remix-run/dev Patch
create-remix Patch
remix Patch
@remix-run/cloudflare Patch
@remix-run/cloudflare-pages Patch
@remix-run/cloudflare-workers Patch
@remix-run/css-bundle Patch
@remix-run/deno Patch
@remix-run/eslint-config Patch
@remix-run/react Patch
@remix-run/server-runtime Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@MichaelDeBoey MichaelDeBoey changed the title feat(remix-node): replace extended classes for NodeRequest & NodeResponse with interface type casts feat(remix-node): replace extended classes for NodeRequest & NodeResponse with interface type casts Aug 8, 2023
@jacob-ebey jacob-ebey merged commit 9543712 into dev Aug 9, 2023
@jacob-ebey jacob-ebey deleted the jeeyoungk-request-retarget branch August 9, 2023 00:01
@github-actions github-actions Bot added the awaiting release This issue has been fixed and will be released soon label Aug 9, 2023
@github-actions

github-actions Bot commented Aug 9, 2023

Copy link
Copy Markdown
Contributor

🤖 Hello there,

We just published version v0.0.0-nightly-a179aa7-20230809 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Hello there,

We just published version v0.0.0-nightly-b1149bb-20230810 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting release This issue has been fixed and will be released soon CLA Signed

Projects

No open projects
Status: Merged

Development

Successfully merging this pull request may close these issues.

2 participants