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(core, common): add webdav http methods support #13164

Closed
wants to merge 13 commits into from
Closed

feat(core, common): add webdav http methods support #13164

wants to merge 13 commits into from

Conversation

johaven
Copy link
Contributor

@johaven johaven commented Feb 5, 2024

Closes #9459

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #9459

What is the new behavior?

add new decorators for webdav methods, like @propfind

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@coveralls
Copy link

coveralls commented Feb 5, 2024

Pull Request Test Coverage Report for Build 520beb78-4e7f-4e59-bea1-f1dd49941824

Details

  • 21 of 21 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 92.183%

Totals Coverage Status
Change from base Build 2bf2e4c8-5da9-4dd1-8f93-3b733029afc6: 0.02%
Covered Lines: 6757
Relevant Lines: 7330

💛 - Coveralls

@johaven
Copy link
Contributor Author

johaven commented Feb 5, 2024

Its sounds good to me 🙂

@Tony133
Copy link
Contributor

Tony133 commented Feb 6, 2024

There is already a PR here: #12925

@johaven
Copy link
Contributor Author

johaven commented Feb 6, 2024

There is already a PR here: #12925

My bad, i did not see it.

But this PR (#12925) is just a copy/paste from the old PR #9465 which contains obvious errors.

All new methods in packages/core/adapters/http-adapter.ts return the propfind function.

@@ -47,6 +47,20 @@ export interface HttpServer<
put(path: string, handler: RequestHandler<TRequest, TResponse>): any;
patch(handler: RequestHandler<TRequest, TResponse>): any;
patch(path: string, handler: RequestHandler<TRequest, TResponse>): any;
propfind(handler: RequestHandler<TRequest, TResponse>): any;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change. We shouldn't add methods to an interface on a patch release.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really see how this is a breaking change, adding decorators only allows access to methods already implemented in Express and Fastify.
Many of us have been waiting for this feature for a very long time ...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding non-optional methods to a public interface that should be implemented for adapters means that anyone who is maintaining their own adapter, say for Koa, or hyper-express, etc, now must make these changes or possibly have their packages broken by a transient upgrade.

This is a braking change, and while you may have been waiting for it for a while, that doesn't mean it's any more urgent to get out, as we want to avoid making several small breaking changes and would rather lump them together over a major upgrade.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is. Updating a public interface results in breaking changes in another library implementing this interface. We can alternatively update this method to be optional; in this case, we won't have to wait for a major release.

see #13000

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmcdo29 I agree, I prefer this explanation guys :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dammy001 I can try to adapt starting from what was done by @doronguttman here: 385d21b but I don't know if that will be enough.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johaven i think that should be enough

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.

WebDAV request method support
6 participants