Skip to content

Conversation

@SquirrelKiev
Copy link
Contributor

The addition of a new package and the details surrounding that new package somewhat irks me, so this PR removes said new package and replaces it with some simple #if NET9_0_OR_GREATERs. Should accomplish the same thing but without adding new stuff to the csproj.

@MarkCiliaVincenti
Copy link
Contributor

The package is set to run in source generator mode, which means that it won't actually add a dependency.

@SquirrelKiev
Copy link
Contributor Author

SquirrelKiev commented Dec 30, 2025

Not formally no but from what I can tell it just copies the runtime package into the source of the project.
But even if that's fine, the whole point of the package is to provide the APIs that lock provides to <NET 9, but we're not even using those - the entire package can be replaced with some #if NET9_0_OR_GREATERs with no consequence or extra build dependencies. This feels like the package was just added for the sake of adding the package.

@MarkCiliaVincenti
Copy link
Contributor

Right, but those directives are both an eyesore and limiting in scope. Yes, currently only the lock keyword is used but the polyfill allows for using the whole API.

For starters, using the preprocessor directives won't allow you to lock with a timeout, or you'd have to use preprocessor directives on the timeout lock call too.

@Misha-133 Misha-133 merged commit b386a0e into discord-net:dev Dec 31, 2025
2 checks passed
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