Skip to content

Conversation

@stephentoub
Copy link
Member

Fixes #110505

@ghost ghost added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Feb 5, 2025
@ghost
Copy link

ghost commented Feb 5, 2025

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@ghost
Copy link

ghost commented Feb 5, 2025

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@TrayanZapryanov
Copy link
Contributor

I am wondering if concerns about exposing ValueStringBuilder are not applicable here too. Soon I've copied ValueStingBuilder in our codebase and build a handler like DefaultInterpolatedStringHandler but storage was VSB. Then was asked by colleagues what will happen if they forgot about calling Clear(Dispose in our case).

@stephentoub
Copy link
Member Author

Then was asked by colleagues what will happen if they forgot about calling Clear(Dispose in our case).

An ArrayPool array may not be returned to the pool.

@stephentoub stephentoub added area-System.Runtime.CompilerServices and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Feb 5, 2025
@stephentoub stephentoub requested a review from mgravell February 19, 2025 15:58
@stephentoub stephentoub merged commit 38f7ca1 into dotnet:main Feb 26, 2025
136 of 139 checks passed
@stephentoub stephentoub deleted the interptext branch February 26, 2025 20:17
@hamarb123
Copy link
Contributor

Is there any particular reason why Text and ToString aren't marked readonly, btw?

@mgravell
Copy link
Contributor

mgravell commented Mar 4, 2025

@hamarb123 valid question; they probably could/should be

@stephentoub
Copy link
Member Author

Is there any particular reason why Text and ToString aren't marked readonly, btw?

@hamarb123 valid question; they probably could/should be

Lots of members could be. Why should these be? Passing around a DefaultInterpolatedStringHandler by in seems like a bad idea.

@mgravell
Copy link
Contributor

mgravell commented Mar 4, 2025

You're right, upon consideration; adding readonly is only useful on a flavor of usage that actively does not apply to this type.

@ericstj
Copy link
Member

ericstj commented Apr 4, 2025

@mgravell @stephentoub - should we announce this one in dotnet/core#9824?

@mgravell
Copy link
Contributor

mgravell commented Apr 4, 2025

@ericstj possibly too niche - maybe better to wait until I get the related HybridCache changes merged (which are more consumer-facing), and announce all together as a related batch?

@ericstj
Copy link
Member

ericstj commented Apr 4, 2025

Sure, just pinging on the PRs that look like they might be interesting.

@github-actions github-actions bot locked and limited conversation to collaborators May 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API Proposal]: DefaultInterpolatedStringHandler - expose buffer and reset

5 participants