refactor: rename DefaultMediaUploader to InternalMediaClient - #627
Draft
jkmassel wants to merge 1 commit into
Draft
refactor: rename DefaultMediaUploader to InternalMediaClient#627jkmassel wants to merge 1 commit into
jkmassel wants to merge 1 commit into
Conversation
`DefaultMediaUploader` reads as an implementation of a host-facing protocol — the "default" one, as against a host's. It is not. It is GutenbergKit's own HTTP client for the configured site: it performs the uploads no host took over, and it relays every media delete, because every attachment lives on that site no matter who delivered it. Rename it, and the `defaultUploader` parameters and properties that carry it, on both platforms. On iOS this also narrows two signatures. `passthroughResponse` and `handleDelete` took the whole `UploadContext` and touched only the client. Pass it directly. On the delete path that is more than tidiness: a deletion always relays to the configured site, never to a delegate. That was a convention the signature let you break; now the type won't. The three functions that keep the context genuinely need every field. Android's server holds the client as a constructor property rather than threading a context, so it needs the rename only.
4 tasks
XCFramework BuildThis PR's XCFramework is available for testing. Add the following to your .package(url: "https://github.com/wordpress-mobile/GutenbergKit", branch: "pr-build/627")Built from a1abfb9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #626. Fourth of ten PRs splitting #621. No behavior change.
What?
DefaultMediaUploader→InternalMediaClienton both platforms, and thedefaultUploaderparameters and properties that carry it.Why?
The name reads as an implementation of a host-facing protocol — the "default" one, as against a host's. It is not. It is GutenbergKit's own HTTP client for the configured site: it performs the uploads no host took over, and it relays every media delete, because every attachment lives on that site no matter who delivered it.
The name gets actively confusing in #628, which adds a
MediaUploaderprotocol. Renaming first keeps that PR's diff about the new API rather than about disambiguating two similar names.How?
Mechanical, ~21 sites on trunk plus tests. On iOS it also narrows two signatures:
passthroughResponseandhandleDeletetook the wholeUploadContextand touched only the client, so they now take it directly.On the delete path that is more than tidiness — a deletion always relays to the configured site, never to a delegate. That was a convention the signature let you break; now the type won't. The three functions that keep the context genuinely need every field.
Android's server holds the client as a constructor property rather than threading a context, so it needs the rename only.
Testing Instructions
swift test— host suite green:Gutenberg:testDebugUnitTestgreenxcodebuild