Deprecating older packages#19897
Deprecating older packages#19897joheredi wants to merge 3 commits intoAzure:mainfrom joheredi:update-agrifood
Conversation
xirzec
left a comment
There was a problem hiding this comment.
I really like that we are able to re-use the same core packages for REST now.
I think it would have felt a little better to do the FarmBeats change in a separate PR from the removals, especially since its API surface is unreviewably large, but I didn't think of that until I scrolled through most of it. I left a few comments :)
| "versionPolicyName": "core" | ||
| }, | ||
| { | ||
| "packageName": "@azure-rest/core-client-lro", |
There was a problem hiding this comment.
were any of these in the vs code workspace file?
| area?: Measure; | ||
| associatedBoundaryId?: string; | ||
| attachmentsLink?: string; | ||
| avgMaterial?: Measure; | ||
| createdDateTime?: Date; | ||
| createdDateTime?: Date | string; |
There was a problem hiding this comment.
this feels strange to me. Presumably if it's a string, it's something we can parse into a Date, so why make the consumer have to handle both?
| operationEndDateTime?: Date | string; | ||
| operationModifiedDateTime?: Date | string; | ||
| operationStartDateTime?: Date | string; | ||
| properties?: Record<string, Record<string, unknown>>; |
There was a problem hiding this comment.
So it's a property bag of property bags? The previous type was just Record<string, unknown> so why the additional nesting?
| Description?: string; | ||
| ETag?: string; | ||
| FarmerId?: string; | ||
| file?: string | Uint8Array; |
There was a problem hiding this comment.
wonder if this should eventually support streams...
There was a problem hiding this comment.
Seems like these are form-encoded in the request, so maybe we have to collect it into a buffer anyway before sending? I'm interested in whether that can be supported without core support for doing it.
There was a problem hiding this comment.
Yeah we need to support streams. I'm planning to pick up again the RLC work to support streams now that we have the fetch client available.
Right now I believe we'd just be able to send the file if it is loaded in memory as a Uint8Array or string, which of course is problematic for larg files.
I think I'll take on this for the March milestone
| * | ||
| ###### Note: | ||
| * | ||
| 1. The **‘contentType’** in the request header should be **'application/merge-patch+json'**. |
There was a problem hiding this comment.
it feels strange that we are doing **'contentType'** - especially since the single quotes look like smart quotes?
Also the header is "Content-Type" not "contentType"... but I am guessing this remark comes from swagger?
There was a problem hiding this comment.
Yeah this is coming from the Swagger
|
API changes have been detected in |
witemple-msft
left a comment
There was a problem hiding this comment.
Couple of comments I noticed passing through.
| names?: Array<string>; | ||
| operationBoundaryIds?: Array<string>; | ||
| propertyFilters?: Array<string>; | ||
| sources?: Array<string>; |
There was a problem hiding this comment.
I have to wonder why all the X[] types changed to Array<X>. Most style guides I've read prefer the former.
There was a problem hiding this comment.
Thanks Will, Is there any difference for Typescript when using Array<X> vs X[]?
I have filed an issue to track RLC design questions and added this one. Azure/autorest.typescript#1286
There was a problem hiding this comment.
No, there is no type-level difference, just a stylistic one.
| minOperationEndDateTime?: Date; | ||
| minOperationModifiedDateTime?: Date; | ||
| minOperationStartDateTime?: Date; | ||
| minCreatedDateTime?: Date | string; |
There was a problem hiding this comment.
Feels pretty bad to have to constantly check to see if a value is a Date instance or a date-formatted string.
There was a problem hiding this comment.
Hi Will, we are generating this union for Input types only, Output is always a string because we cannot safely deserialize without runtime mapping*.
(*note that this is an RLC which don't have any runtime mapping)
The reason these inputs are string or Date is to give the user a chance to work with them as it is more convenient for their use case.
For example, if they are round-tripping data from and to the service it may be more convenient to just take the date as received from the service and put it in the request without having to convert it to a Date. On the other hand, if users are crafting a request from scratch, it may be more convenient to say Date.now() than crafting the date as a string.
I believe this has value, especially since it is for input types, users shouldn't need flow control to work with these types.
There was a problem hiding this comment.
it is for input types
I didn't catch this! If it's for inputs but not outputs then it doesn't feel bad anymore.
There was a problem hiding this comment.
I also didn't see that it was only for input types 😅
That's a cool feature though and I like it alot!
| Description?: string; | ||
| ETag?: string; | ||
| FarmerId?: string; | ||
| file?: string | Uint8Array; |
There was a problem hiding this comment.
Seems like these are form-encoded in the request, so maybe we have to collect it into a buffer anyway before sending? I'm interested in whether that can be supported without core support for doing it.
| name?: string; | ||
| properties?: FarmerPropertiesDictionary; |
There was a problem hiding this comment.
I don't see any other instances of this type name other than its deletion here. Did we mean to change these from named property bags to anonymous maps to any?
|
Abandoning this PR to split it in 2. The first one #20059 will update Agrifood with the latest code gen version and remove dependency in the packages about to be deprecated. Following a PR to delete the deprecated code |
**Checklists** - [x] Added impacted package name to the issue description **Packages impacted by this PR:** @azure-rest/agrifood-farming **Describe the problem that is addressed by this PR:** Re-generate Agrifood Farming using the latest version of RLC generator. This package was one of the first-ever RLCs generated and codegen has changes quite a bit since then. Regenerating against the same swagger. Major changes since last generation: - Switched away from @azure-rest/core-client-lro and @azure-rest/core-client-paging in favor of @azure/core-lro and @azure/core-client - Split Output and Input models **Does this PR needs any fixes in the SDK Generator?** _(If so, create an Issue in the [Autorest/typescript](https://github.com/Azure/autorest.typescript) repository and link it here)_ NO **Are there test cases added in this PR?**_(If not, why?)_ NO, it already has tests **Provide a list of related PRs**_(if any)_ #19897 **Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ `rushx generate:client`
**Checklists** - [x] Added impacted package name to the issue description **Packages impacted by this PR:** @azure-rest/agrifood-farming **Describe the problem that is addressed by this PR:** Re-generate Agrifood Farming using the latest version of RLC generator. This package was one of the first-ever RLCs generated and codegen has changes quite a bit since then. Regenerating against the same swagger. Major changes since last generation: - Switched away from @azure-rest/core-client-lro and @azure-rest/core-client-paging in favor of @azure/core-lro and @azure/core-client - Split Output and Input models **Does this PR needs any fixes in the SDK Generator?** _(If so, create an Issue in the [Autorest/typescript](https://github.com/Azure/autorest.typescript) repository and link it here)_ NO **Are there test cases added in this PR?**_(If not, why?)_ NO, it already has tests **Provide a list of related PRs**_(if any)_ Azure#19897 **Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ `rushx generate:client`
Checklists
Packages impacted by this PR:
Issues associated with this PR:
#18729
Describe the problem that is addressed by this PR:
There are a few packages that need to be drprecated. This PR drops any dependencies on those packages and removes code from the repository to prepare for deprecation. After this PR is merged NPM packages will be marked as deprecated
Command used to generate this PR:(Applicable only to SDK release request PRs)
rushx generate:client for agrifood-farming