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

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

Merged
merged 2 commits into from
Aug 9, 2023

Conversation

jacob-ebey
Copy link
Member

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

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
Copy link

changeset-bot bot commented Aug 8, 2023

🦋 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
@MichaelDeBoey MichaelDeBoey added feat:typescript runtime:node feat:fetch Issues related to @remix-run/web-fetch labels Aug 8, 2023
@jacob-ebey jacob-ebey merged commit 9543712 into dev Aug 9, 2023
9 checks passed
@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
Copy link
Contributor

github-actions bot commented Aug 9, 2023

🤖 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
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 feat:fetch Issues related to @remix-run/web-fetch feat:typescript runtime:node
Projects
No open projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

2 participants