Skip to content

Rename a number of types and modules. #13

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

Merged
merged 1 commit into from
Jul 2, 2021

Conversation

Lukasa
Copy link
Contributor

@Lukasa Lukasa commented Jul 1, 2021

Motivation:

In general we should try to be specific about what we're referring to.
"Structured headers" is not really an accurate description of what this
module works with: "Structured Header Field Values", or "Structured
Field Value" is usually better. To that end this change adjusts our
naming to be closer to what we want. It also changes our module names to
prioritise the use of the Codable-based one.

Modifications:

  • Renamed CodableStructuredHeaders to StructuredFieldValues.
  • Renamed StructuredHeaders to RawStructuredFieldValues.
  • Renamed a number of types from Field to FieldValue.
  • Renamed a number of types from Header to Field or FieldValue.
  • Renamed some functions along the above lines.

Result:

Better and more consistent terminology will be used.

@Lukasa Lukasa added the 🆕 semver/minor Adds new public API. label Jul 1, 2021
@Lukasa Lukasa force-pushed the cb-rename-modules-and-types branch from 5b90d1c to 2d4fae7 Compare July 1, 2021 11:50
Copy link
Contributor

@PeterAdams-A PeterAdams-A left a comment

Choose a reason for hiding this comment

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

Seems reasonable.

README.md Outdated

The top-level structured header field must identify what kind of header field it corresponds to: `.item`, `.list`, or `.dictionary`. This is inherent in the type of the field and will be specified in the relevant field specification.
The top-level structured header field value must identify what kind of header field it corresponds to: `.item`, `.list`, or `.dictionary`. This is inherent in the type of the field and will be specified in the relevant field specification.
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure why you've made the capitalisation different between this line and the one above but it was like that before.

Copy link
Contributor

@glbrntt glbrntt left a comment

Choose a reason for hiding this comment

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

Left suggestions for a few existing typos. Looks good otherwise.

Did you consider adding availability annotations for renaming? I suspect it might be more effort than it's worth though.

README.md Outdated

HTTP Structured Header fields are a HTTP extension recorded in [RFC 8941](https://www.rfc-editor.org/rfc/rfc8941.html) . They provide a set of data types and algorithms for handling HTTP header field values in a consistent way, allowing a single parser and serializer to handle a wide range of header field values.
HTTP Structured Header Field Values are a HTTP extension recorded in [RFC 8941](https://www.rfc-editor.org/rfc/rfc8941.html) . They provide a set of data types and algorithms for handling HTTP header field values in a consistent way, allowing a single parser and serializer to handle a wide range of header field values.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
HTTP Structured Header Field Values are a HTTP extension recorded in [RFC 8941](https://www.rfc-editor.org/rfc/rfc8941.html) . They provide a set of data types and algorithms for handling HTTP header field values in a consistent way, allowing a single parser and serializer to handle a wide range of header field values.
HTTP Structured Header Field Values are a HTTP extension recorded in [RFC 8941](https://www.rfc-editor.org/rfc/rfc8941.html). They provide a set of data types and algorithms for handling HTTP header field values in a consistent way, allowing a single parser and serializer to handle a wide range of header field values.

README.md Outdated

`swift-http-structured-headers` has a simply, easy-to-use high-level API for working with structured header fields. To begin with, let's consider the [HTTP Client Hints specification](https://www.rfc-editor.org/rfc/rfc8942.html). This defines the following new header field:
`swift-http-structured-headers` has a simply, easy-to-use high-level API for working with structured header field values. To begin with, let's consider the [HTTP Client Hints specification](https://www.rfc-editor.org/rfc/rfc8942.html). This defines the following new header field:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
`swift-http-structured-headers` has a simply, easy-to-use high-level API for working with structured header field values. To begin with, let's consider the [HTTP Client Hints specification](https://www.rfc-editor.org/rfc/rfc8942.html). This defines the following new header field:
`swift-http-structured-headers` has a simple, easy-to-use high-level API for working with structured header field values. To begin with, let's consider the [HTTP Client Hints specification](https://www.rfc-editor.org/rfc/rfc8942.html). This defines the following new header field:

Motivation:

In general we should try to be specific about what we're referring to.
"Structured headers" is not really an accurate description of what this
module works with: "Structured Header Field Values", or "Structured
Field Value" is usually better. To that end this change adjusts our
naming to be closer to what we want. It also changes our module names to
prioritise the use of the Codable-based one.

Modifications:

- Renamed CodableStructuredHeaders to StructuredFieldValues.
- Renamed StructuredHeaders to RawStructuredFieldValues.
- Renamed a number of types from Field to FieldValue.
- Renamed a number of types from Header to Field or FieldValue.
- Renamed some functions along the above lines.

Result:

Better and more consistent terminology will be used.
@Lukasa Lukasa force-pushed the cb-rename-modules-and-types branch from 2d4fae7 to 885ef64 Compare July 2, 2021 10:19
Copy link
Member

@fabianfett fabianfett left a comment

Choose a reason for hiding this comment

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

I like the new names

@Lukasa Lukasa merged commit 27e163f into apple:main Jul 2, 2021
@Lukasa Lukasa deleted the cb-rename-modules-and-types branch July 2, 2021 10:48
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.

4 participants