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

Update SK example, fix bugs #182

Merged
merged 2 commits into from
Nov 20, 2023
Merged

Update SK example, fix bugs #182

merged 2 commits into from
Nov 20, 2023

Conversation

jasongin
Copy link
Member

  • Update Semantic Kernel package in the example to 1.0.0-beta8, and revise JS code for API changes
  • Skip indexed properties when marshalling structs. SK added a reference to System.Text.Json.JsonElement which is a struct with an indexed property that returns (another) JsonElement. This caused a stack overflow: Struct property with circular reference can cause stack-overflow in JS marshalling expression builder #181. Skipping indexed properties is correct anyway and is a convenient way to avoid the crash for now, though structs with non-indexed self-referential properties may still trigger it. (I have not found any yet.)
  • Add limited support for marshalling ReadOnlyMemory<T>, only when the memory was originally allocated by a JS typed array. SK added some APIs that referenced ReadOnlyMemory<T> and that was causing an exception due to indirect references to Span<T> (which isn't supported and is normally skipped by the marshaller). Adding this special handling for ReadOnlyMemory<T> resolves the issue.
  • Improve overload resolution for array parameters. SK loves to overload their APIs. (We don't yet handle resolution of overloads that differ only in object class: Marshalling: Advanced overload resolution #134)

@jasongin jasongin merged commit 0cb2d3d into main Nov 20, 2023
7 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.

2 participants