Skip to content
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

API whishlist #28

Open
nikeee opened this issue May 21, 2018 · 2 comments
Open

API whishlist #28

nikeee opened this issue May 21, 2018 · 2 comments

Comments

@nikeee
Copy link
Owner

nikeee commented May 21, 2018

Assume we can do breaking changes, what could we do?

Implementation couold look like this:

class Response : IReadOnlyDictionary<string, string>
{
    private readonly IReadOnlyDictionary<string, string> _rawFields; // init via setter mechanism during response processing
    // ...
    // Implement indexer with getter only, just returning _rawFields's entry
    // ...
}
  • How about generating the data classes in the Specialzed-Namespace? Pros? Cons?
    • Pros:
      • Maybe (tm) faster de-serialization as we could define a general setter method that calls hand-written converters based on an auto-generated switch-statement. No dynamic invocations needed.
      • Debugging is easier for single responses
      • We might share/maintain the declaration with https://github.com/ReSpeak/tsdeclarations
    • Cons:
      • Generating code before compilation can introduce (caching) errors
      • Generating code requires a generator... which has to run on all plattforms that can compile C#. Maybe use a sub-project? Or a Roslyn-API?
  • Can we somehow benefit from C# 7.x/8 features? Span<T>, Memory<T>, Ref-Returns/In-Parameters, Local-Refs? Pattern matching? Nullable-Ref-Types?

This list is open to everyone!

@nikeee
Copy link
Owner Author

nikeee commented Apr 20, 2019

#14 is also a candidate for this list.

@nikeee
Copy link
Owner Author

nikeee commented Dec 11, 2021

Most likely, #75 will contain a breaking change. Also, #58 will require some API changes. We also may streamline the method names (Connect -> ConnectAsync) to align with the .NET styles.

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

No branches or pull requests

1 participant