Skip to content

Commit

Permalink
Don't include the default version as an explicit version in v3 (#3924)
Browse files Browse the repository at this point in the history
Due to low confidence on the migration path in v2, we added all resource
being used in the default version as explicit versions too.

With the improved aliasing approach from #3872, this is not required any
more.

See the preview generation against the v3 branch:
v3...dont-duplicate-default-as-explicit-v3-preview

This has a net reduction of 1,118,866 lines of SDK code and an
uncompressed size reduction of just under 7% to deliver a 48% overall
reduction for v3.

| SDK | v2 size | v3 size | new v3 size |
|-----|-------|------|---------|
| dotnet | 653M | 363M | 340M |
| nodejs | 300M | 166M | 156M |
| python | 717M | 401M | 376M |
  • Loading branch information
danielrbradley authored Feb 4, 2025
1 parent 1a58192 commit 84b62e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions provider/pkg/versioning/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ func (v VersionMetadata) ShouldInclude(moduleName openapi.ModuleName, version *o
if version == nil {
return true
}
// Keep any resources in the default version lock
if v.DefaultVersions.IsAtVersion(moduleName, typeName, *version) {
// In v2 only: Keep any default versions as explicit versions too
if v.MajorVersion < 3 && v.DefaultVersions.IsAtVersion(moduleName, typeName, *version) {
return true
}
// Keep any resources in the previous version lock for easier migration
Expand Down

0 comments on commit 84b62e5

Please sign in to comment.