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

Replace to HTTPTypes.HTTPRequest from Helpers.HTTPRequest #568

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

zunda-pixel
Copy link
Contributor

@zunda-pixel zunda-pixel commented Oct 15, 2024

Description

Replace to HTTPTypes's Components.

  1. Helpers.HTTPRequest -> (request: HTTPRequest, bodyData: Data?)
  2. Helpers.HTTPResponse -> (Data, HTTPTypes.HTTPResponse)

Breaking Changes

  1. FunctionsClient.FetchHandler and PostgrestClient.FetchHandler
    • old: (_ request: HTTPRequest) async throws -> HTTPResponse
    • new: (_ request: HTTPRequest, _ bodyData: Data?) async throws -> (Data, HTTPResponse)
  2. HTTPError.response and PostgrestResponse.response
    • HTTPURLResponse -> HTTPResponse
  3. remove StorageHTTPSession.upload

Copyright

URLSession for HTTPRequest(URLSession+AsyncAwait.swift) code from apple/swift-http-types
We need this code until update to Swift 6

Remove Helpers.HTTPRequest and Helpers.HTTPResponse
@grdsdev
Copy link
Collaborator

grdsdev commented Oct 15, 2024

Thanks for taking the leap on this @zunda-pixel.

We're not in the stage on having breaking changes at the moment, I'm planning a v3 for next couple of months, breaking changes will have to wait until then. For now, we need to make sure changes are retro-compatible.

@grdsdev grdsdev linked an issue Oct 15, 2024 that may be closed by this pull request
@zunda-pixel
Copy link
Contributor Author

zunda-pixel commented Oct 16, 2024

Ok, I am looking forward to v3.
Supabase v3 is based release/v3 branch?

@grdsdev
Copy link
Collaborator

grdsdev commented Oct 16, 2024

Yes @zunda-pixel , that is the branch.

There are basically 3 issues that I want to fix yet on v2 before I move focus to v3, they are these ones: https://github.com/supabase/supabase-swift/issues?q=is%3Aopen+is%3Aissue+milestone%3Av2

@grdsdev grdsdev added this to the v3 milestone Oct 16, 2024
# Conflicts:
#	Sources/Auth/AuthError.swift
#	Sources/Auth/Internal/APIClient.swift
#	Sources/Auth/Internal/Contants.swift
#	Sources/Auth/Internal/SessionManager.swift
#	Sources/Helpers/URLSession+AsyncAwait.swift
#	Sources/Helpers/Version.swift
#	Sources/Storage/MultipartFormData.swift
#	Sources/Storage/StorageFileApi.swift
#	Tests/AuthTests/SessionManagerTests.swift
#	Tests/IntegrationTests/StorageFileIntegrationTests.swift
#	Tests/StorageTests/SupabaseStorageTests.swift
@zunda-pixel zunda-pixel marked this pull request as draft October 23, 2024 16:25
@zunda-pixel
Copy link
Contributor Author

@grdsdev
Should I create pull-request to v3 branch?

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.

Adopt HTTPRequest and HTTPResponse type from swift-http-types
2 participants