Skip to content

Conversation

@sliekens
Copy link
Contributor

@sliekens sliekens commented Jan 20, 2026

This PR lights up features like collection expressions for projects which use System.Memory v4.5.4, which previously required at least v4.5.5.

Reasons for this change:

  • API surface is the same so I don't expect this change has the potential to break anything (famous last words)
  • Lowers the barrier for consumers
  • System.Memory 4.5.4 is more widely transitively included than 4.5.5.
    • e.g. System.Text.Json 6.0.x is a popular target for .NET Standard 2.0 libraries and depends on System.Memory 4.5.4
  • 4.5.4 remains the version with the highest download count, ensuring broad compatibility without requiring unnecessary upgrades.
image

- Lowers the barrier for consumers on older environments.
- System.Memory 4.5.4 is more widely transitively included than 4.5.5.
- 4.5.4 remains the version with the highest download count, ensuring broad compatibility without requiring unnecessary upgrades.
@SimonCropp
Copy link
Owner

why would we want to make a change that encourages/enables people to use an older buggier version of an package?

@sliekens
Copy link
Contributor Author

It has to do with collection expressions being in a broken state if you use Polyfill in an older TFM with System.Memory <4.5.5, which has quite a high possibility because many other packages import 4.5.4. All the primitives are there, just the polyfills are missing (gated behind 4.5.5).

@SimonCropp
Copy link
Owner

just the polyfills are missing (gated behind 4.5.5).

then i would prefer a warning that tells people to upgrade to at least the min supported version

@sliekens
Copy link
Contributor Author

Okay but extending that line of thought, why not require 4.6.3?

@SimonCropp
Copy link
Owner

why not require 4.6.3?

that would be a breaking change

the outcome absolutely should be that people should be using the latest stable of any dependencies, notwithstanding technical blocker. AFAIK there is no blocker for you updating to 4.6.3. the actual problem is that you got no feedback that you were using an incompatible version of a dependency

@dahlbyk
Copy link
Contributor

dahlbyk commented Jan 21, 2026

the outcome absolutely should be that people should be using the latest stable of any dependencies

While this is true, it's not this library's responsibility. My preference would be that Polyfill depend on the minimum compatible version to give consumers more flexibility.

If a lower incompatible version is detected then a warning instead of silent failure would be great, but that's not the case with this particular version adjustment.

@sliekens
Copy link
Contributor Author

sliekens commented Jan 21, 2026

I can appreciate recommending people to upgrade their dependencies, but as a user I also don't want my Polyfill library to warn me for using outdated dependencies, I'm already well aware. I'm also a bit reluctant to add a System.Memory dependency to my own library's nuspec beyond what is needed for System.Text.Json 6.0.11. I'm on the fence about reopening a different PR to add a warning for <4.5.5. I believe it should just work.

//edit: whether this is accepted or not, the warning for incompatible versions is always a good idea so I will proceed with that in a different PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants