⬇️ Downgrade System.Collections.Immutable #382
Merged
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.
✨ What's this?
This PR downgrades the
System.Collections.Immutable
reference to 6.0.0.It also replaces some references to
ImmutableList
toImmutableArray
which is a more appropriate data structures in our use cases.🔍 Why do we want this?
System.Collections.Immutable
isn't a "true" NuGet package. Rather it is part of the .NET runtime. Therefore, as long as we support .NET 6, we should stick with the current version.Now... why not drop .NET 6 support you might ask? Well, because the Roslyn Source Generators in Rider completely break down if you target a runtime newer than .NET 6. If we want to be able to keep using types from
Bearded.Utilities
in binaries referenced by source generators (for example, in TD we useId<T>
) we will want to stick with .NET 6 for now.One change to consider is to split the complex types, such as the algorithms and data structures, from the simpler stuff, so that it becomes easier to access some of the more atomic types (which could target a relatively low .NET version because we use no advanced features) without needing to pull in the bigger dependencies needed for complex code.
The change from
ImmutableList
toImmutableArray
is to ensure that access by index is a constant time operation.🏗 How is it done?
Manual replacement in VS Code.
💥 Breaking changes
There is only one case where the public API used
ImmutableList
, that is the return type ofCoffmanGraham
. If you only rely on that being a collection anyway, code should remain compatible when recompiling (less likely to be binary compatible).