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

Requested API breaking changes for a v2 API #2811

Open
MikeStall opened this issue Jan 11, 2025 · 1 comment
Open

Requested API breaking changes for a v2 API #2811

MikeStall opened this issue Jan 11, 2025 · 1 comment

Comments

@MikeStall
Copy link
Contributor

MikeStall commented Jan 11, 2025

Current nugets are v1. Here are API breaking changes to consider for a v2 nuget. No change to language semantics here - just API breaking to take advantage of lessons learned in v1.

[1] Remove all [Obsolete] APIs*

[2] No usage of hidden awaits / .Result.
This is especially important for sandbox/governor scenarios - the host must know when any network calls are being made.

[3] Improved TableValue.Rows management
This is a case where it's too easy to call .Result under the hood. Improve to:

  • ensure host has full visibility into traversals. It's too easy to traverse a million rows.
  • allow optimizations like Sequence(100000) can be lazy and doesn't have to eagerly create the table.
  • better align with delegation. -

[4] Remove any FormulaValue equality, especially for RecordValues.
The Fx language does not allow equality operators on records. The API should not have operators that don't correspond to language semantics.

FormulaType equality is still valid, especially when comparing primitives.

More broadly - how can we ensue #2788 would have been a compile-time error, and that Distinct/Summarize/Join all have the same semantics.

[5] Remove FormulaValue.ToObject
This works well for primitives, but there are too many cases this fails for other types. Having RecordValue return a dynamically created object was too clever. Most usage of this API beyond primitives is just wrong. Callers will call ToObject to get an object and test it - there needs to be a way to conduct that test upfront.

TryGetPrimitive is good:

public bool TryGetPrimitiveValue(out object val)

We can add other safe TryGet accessors as needed.

[6] Any changes on PowerFxConfig?
PowerFxConfig is in core and used across engines. So it can't have any interpreter config.
What does config have that Engine doesn't? Need a clear articulation on the split.

@anderson-joyle
Copy link
Contributor

Can we move FormulaValue and all derived to the interpreter?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants