Skip to content

fetch middware rework #1556

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

Closed
wants to merge 5 commits into from
Closed

fetch middware rework #1556

wants to merge 5 commits into from

Conversation

ohroy
Copy link

@ohroy ohroy commented Feb 20, 2024

Changes

This PR rework middleware add feature:

  • a new method send, that warp fetch with middleware, it accept the stand Request and return the stand Response.
  • resend request in middleware by send with the stand request object.
  • get pathSchame from merge options not request BREAK CHANGE
  • add the final request url and options to mergeOptions, so that we can remake request easily, does't need to care about the body readable.

It also provider 5 tests for check above work or not.
It also update some docs for explain, but my English is sooo poor uhhhh

Checklist

  • Unit tests updated
  • docs/ updated (if necessary)
  • pnpm run update:examples run (only applicable for openapi-typescript)

Copy link

changeset-bot bot commented Feb 20, 2024

⚠️ No Changeset found

Latest commit: b62e614

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@ohroy ohroy mentioned this pull request Feb 20, 2024
1 task
@drwpow
Copy link
Contributor

drwpow commented Feb 20, 2024

As outlined in the CONTRIBUTING.md guidelines:

However, if adding a feature or breaking change, please open an issue first to discuss. This ensures no time or work is wasted writing code that won’t be accepted to the project (see Project Goals). Undiscussed feature work may be rejected at the discretion of the maintainers.

This PR introduces breaking changes to the API, and we’re not open to that at this stage. There was plenty of time to provide feedback in the issue, and this exact API was available for testing as a beta version before the 0.9.0 stable release.

I’m going to close this PR as it introduces too many changes without discussion (not to mention the tests fail). But that said, I would love to hear more about the send function introduced here as a new issue. Please open a proposal first as a new issue about how you’d like the API to change, and I would really love to fold those in to make the middleware API even better (granted it doesn’t introduce any breaking changes). But let’s talk about a proposal first before jumping in to write code and break things for existing users.

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.

2 participants