Skip to content

[RFC 9651] Implement adjustments for backward compatible update #40

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

Conversation

clintonpi
Copy link
Contributor

Motivation:

swift-http-structured-headers has to be updated to RFC 9651. And it will be convenient for users to have this update as a SemVer minor.

Modifications:

  • Deprecate the BareItem type and replace it with RFC9651BareItem, retaining existing behaviours. Updates for the new RFC will be based on RFC9651BareItem.

Result:

The library can be updated to the new RFC in a backward-compatible manner.

Motivation:

`swift-http-structured-headers` has to be updated to [RFC 9651](https://www.ietf.org/rfc/rfc9651.html). And it will be convenient for users to have this update as a SemVer minor.

Modifications:

- Deprecate the `BareItem` type and replace it with `RFC9651BareItem`, retaining existing behaviours. Updates for the new RFC will be based on `RFC9651BareItem`.

Result:

The library can be updated to the new RFC in a backward-compatible manner.
@Lukasa Lukasa added the 🆕 semver/minor Adds new public API. label Oct 23, 2024
@Lukasa
Copy link
Contributor

Lukasa commented Oct 23, 2024

@swift-server-bot add to allowlist

Copy link
Contributor

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

This is a genuinely lovely patch @clintonpi, thank you very much!

@Lukasa
Copy link
Contributor

Lukasa commented Oct 23, 2024

One minor formatting issue:

diff --git a/Sources/RawStructuredFieldValues/ComponentTypes.swift b/Sources/RawStructuredFieldValues/ComponentTypes.swift
index 99941f5..75cba3f 100644
--- a/Sources/RawStructuredFieldValues/ComponentTypes.swift
+++ b/Sources/RawStructuredFieldValues/ComponentTypes.swift
@@ -218,6 +218,7 @@ public struct Item: Sendable {
             try! self.rfc9651Parameters = newValue.mapValues { try .init(transforming: $0) }
         }
     }
+
     /// The `BareItem` that this `Item` contains.
     public var rfc9651BareItem: RFC9651BareItem
 

@clintonpi clintonpi requested a review from Lukasa October 23, 2024 09:56
@Lukasa Lukasa merged commit f069b10 into apple:main Oct 23, 2024
5 of 6 checks passed
@clintonpi clintonpi deleted the rfc-9651/adjustments-for-backward-compatible-update branch October 23, 2024 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🆕 semver/minor Adds new public API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants