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

Blazor forms model binding #48759

Closed
13 of 24 tasks
SteveSandersonMS opened this issue Jun 13, 2023 · 1 comment
Closed
13 of 24 tasks

Blazor forms model binding #48759

SteveSandersonMS opened this issue Jun 13, 2023 · 1 comment
Assignees
Labels
area-blazor Includes: Blazor, Razor Components feature-full-stack-web-ui Full stack web UI with Blazor
Milestone

Comments

@SteveSandersonMS
Copy link
Member

SteveSandersonMS commented Jun 13, 2023

In scope:

  • Conversion (deserialization) of incoming form post data into .NET objects.
  • Any layering work needed if there's an immediate plan to share code with Minimal

Out of scope:

  • Any other aspect of the form handling system besides the pure data mapping part.

The following items were originally taken from #46688:

  • Declarative binding
  • Primitive values
  • Collections
  • Dictionaries
  • Complex types
  • Recursive complex types
  • Error handling
  • Security
  • Extensibility
    • Globalization
    • Ignored properties.
    • Changing the property name.
    • Required properties.
    • Custom converters for a given property.
  • Converter source generation
  • Optimization
    • Removing allocations during prefix computation.
    • Removing allocations from reading the form.
    • Optimized form data structure for common form sizes
      • Evaluate using a list instead of a dictionary for small sets of keys. AdaptiveCapacityDictionary
      • Filtering out keys we don't care about when reading the dictionary.
      • Sizing the dictionary ahead of time to avoid resizing it.
      • Inlining implementation for primitive types (bypass the converter)
      • Avoid allocating a prefix collection when there is only one dictionary on the type hierarchy (since will only process a single set of keys).

However some of the above should probably really be out of scope for .NET 8, e.g., "converter source generation".

@javiercn
Copy link
Member

Comparison against the System.Text.Json feature set:

  • X AllowTrailingCommas
  • V Converters
  • V DefaultBufferSize
  • X DefaultIgnoreCondition
  • X DictionaryKeyPolicy: Gets or sets the policy used to convert a IDictionary key's name to another format, such as camel-casing.
  • X Encoder: Gets or sets the encoder to use when escaping strings, or null to use the default encoder.
  • X IgnoreNullValues
  • X IgnoreReadOnlyFields
  • X IgnoreReadOnlyProperties
  • X IncludeFields Gets or sets a value that indicates whether fields are handled during serialization and deserialization. The default value is false.
  • V MaxDepth: Gets or sets the maximum depth allowed when serializing or deserializing JSON, with the default value of 0 indicating a maximum depth of 64.
  • X NumberHandling
  • X PropertyNameCaseInsensitive: Gets or sets a value that indicates whether a property's name uses a case-insensitive comparison during deserialization. The default value is false.
  • X PropertyNamingPolicy: Gets or sets a value that specifies the policy used to convert a property's name on an object to another format, such as camel-casing, or null to leave property names unchanged.
  • X ReadCommentHandling:
  • X ReferenceHandler: Gets or sets an object that specifies how object references are handled when reading and writing JSON.
  • V TypeInfoResolver: If we decide to do SG.
  • X UnknownTypeHandling: We don't deserialize anything we don't know about.

V are the things we potentially need,
X are the things we don't.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components feature-full-stack-web-ui Full stack web UI with Blazor
Projects
None yet
Development

No branches or pull requests

2 participants