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: update to work with single fetch responseStub #18

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

GuptaSiddhant
Copy link

@GuptaSiddhant GuptaSiddhant commented May 16, 2024

Description

This PR is a POC (not expected to be merged). With the arrival of single-fetch in remix, I wanted to see this great project reflect the changes required.

It still may requires additional props like customStatus, etc.

Fixes #17

If this is a new feature please add a description of what was added and why below:

  • Replace ResponseInit param with ResponseStub in all functions.
  • Use ResponseStub to set cookie headers
  • Either throw response for redirects or return bare object for json data.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Unit tests

Checklist:

  • My code follows the guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@AlemTuzlak
Copy link
Contributor

Hey @GuptaSiddhant Thank you so much for htis PR, the reason I haven't yet implemented single fetch implementation is that it's still unstable and the last remix sprint planning Ryan and MJ confirmed a change to the api and the responseStub so I'm still waiting to see what comes out of it, but this is definitely the way with the current instance of unstable fetch!

@matamatanot
Copy link

https://x.com/remix_run/status/1844820850312352165

future.v3_optimizeDeps is stable now!

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.

Working with SingleFetch (Remix v2.9.0)
3 participants