Repository navigation
[API Spec] XamlOptionalChanges: opt-in API for breaking perf changes - #11110
Conversation
Adds the API spec for XamlOptionalChanges, a mechanism for apps to opt into breaking changes (e.g. performance improvements that alter layout trees) before XAML initialization. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Sundaram Ramaswamy (@sundaramramaswamy) Where and when is this spec discussed? I am really interested in the different opinions, pro and con. Let's be transparent. Having that said, I would like to share what are my first, quick thoughts are...
As you can see, the entire idea of selective features in a certain release is a no-go for me in the first place. But that's my opinion... |
Jay (@Jay-o-Way) This PR is where and when — the spec is being drafted and discussed right here, right now. Your feedback and everyone else's shapes the design. As for the broader concern: this isn't feature-flighting like Windows xxH2 rollouts. These are developer-controlled, deterministic settings — the app author explicitly opts in, not a server-side toggle. No surprises, no silent rollbacks. The design is a middle ground between progress and backward compat: we want to ship perf improvements without forcing breakage on apps that aren't ready, but we also don't want to carry old behavior forever. The proposed lifecycle gives developers a 2-major-version runway to adapt before a change becomes permanent. |
There are prior art to these flags, e.g. react native's turbo module, fabric render engine. Having these flags allow eager developers to test feature early, without requiring hesitant developers to join or wait for the next major version upgrade. I in principle support this feature flag spec. I only have two concerns:
|
Isn't that what beta/preview versions are for? 🤓 |
|
Windows App SDK currently already ships a similar system with RuntimeCompatibilityChange. What does this do that theirs doesn't? Can you maybe leverage their system? https://github.com/microsoft/WindowsAppSDK/blob/main/specs/Compatibility/RuntimeCompatibilityOptions.md |
They serve different purposes. Servicing changes are, by definition, fixes — |
Preview versions help with testing but don't solve the problem: when a breaking change ships in stable, it's on for everyone with no escape hatch. This API lets individual apps adopt breaking changes on their own schedule in stable, not just preview. |
(1) The strict semver lifecycle keeps maintenance bounded — changes are default-off within a major, default-on at the next, removed at the one after. No indefinite dual code paths. (2) Agreed — an MSBuild property is planned (see the thread on line 62). No one will need |
|
DISCUSSION: Xaml island scenario where different islands want to use different Xaml options is problematic. WASDK versions have similar problem. So this is not new problem. |
|
|
My initial feedback on this is the opt-in for performance: Performance should be the default. I understand there might be behavioral changes, but you need to move this platform forward and create an SDK people are happy to use by default. Compare to .NET's feature switches, which is always opting-out of new features: https://learn.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/appcontextswitchoverrides-element It would also be nice for .NET developers to be able to use the well-known approach of using appcontext switches to control features, rather than having to use a different way when developing for WinUI. |
exactly. performance should always be the default in a native framework that is designed to be consumed by languages projections. |
|
Interesting... API Now Exist! |
|
So what's the point of this PR if you already wrote the code and merged it in? cc64a0b EDIT: I don't know what pre-seed means in this context, that's not community or common terminology. I feel like you wasted my time with fake community engagement. |
In this case, we chose to implement the feature in parallel with the spec review as we did not expect major divergence as an outcome of the review. The commit you saw is simply our initial implementation and it is fully our intention to revise it based on the feedback from this review. |
|
Sounds good, thanks Evelyn Wu (@evelynwu-msft)! |
|
Thanks for the feedback, Tushar Singh (@tusharsnx).
|
Remove 'eventually removed' wording from rationale sections. The spec commits to [deprecated] attributes on graduated enum values, not physical removal, which is consistent with WinRT's additive-only type system. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds the API spec for
XamlOptionalChanges, a mechanism for apps to opt into breaking changes (e.g. performance improvements that alter layout trees) before XAML initialization.Summary
XamlOptionalChanges- static class withEnableChange(),DisableChange(),IsChangeEnabled(),Lock()XamlChangeId- enum identifying individual breaking changesApplication.Start()orWindowsXamlManager.InitializeForCurrentThread()Lock()Spec file:
specs/XamlOptionalChanges/XamlOptionalChanges-Spec.md