-
Notifications
You must be signed in to change notification settings - Fork 831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Stringable on storage attributes #1810
base: 3.x
Are you sure you want to change the base?
Conversation
What's the use case for this? You'll always need to iterate over the iterable since that won't be properly stringified. Can you provide some arguments for why this should be added to the library and not just live in some formatting code that lives in consuming projects? |
Improve the DX. |
That's on a different level though, there is an iterable of Where I'm going with this is that the specific formatting you suggest (or any other specific format) will always only be useful in very specific use cases. I don't think this will affect the DX in any meaningfull way for 99% of the developers. |
The stringified format can indeed be revised, but making these objects Stringable is a common OOP technique that enhances flexibility. It’s useful for logging, debugging, and simple displays, allowing developers to handle these objects without needing to explicitly map them each time. This improves developer experience in many cases without imposing any specific usage. |
I fully agree with those points, there are downsides as well though:
Any ideas on how you'd tackle that? |
@SamMousa I added an annotation to the interface to trigger depreciation for uses of it outside the package. |
I didn't want to add the extends to the StorageAttributes interface to avoid breaking changes, but it can be done in the future if you want this feature