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

Move CompositionSwitcher to Experimental namespace #12960

Merged
merged 9 commits into from
Apr 23, 2024

Conversation

acoates-ms
Copy link
Contributor

@acoates-ms acoates-ms commented Apr 17, 2024

This moves all the objects related to the composition switcher into an Experimental namespace.

On public objects that used to expose objects from the switcher we now directly expose Microsoft.UI.Composition objects. There are experimental interfaces that can be used to set composition switcher objects instead.

This should limit the effect of the switcher on the public interface. We still use the switcher internally to allow Office to be able to continue to inject a custom composition interface. But now when we remove this ability APIs outside of the experimental namespace should not need to change.

Example:

Before:

winrt::Microsoft::ReactNative::Composition::CompositionUIService::SetCompositionContext(
    InstanceSettings().Properties(),
    winrt::Microsoft::ReactNative::Composition::MicrosoftCompositionContextHelper::CreateContext(
        g_liftedCompositor));

// Have to use MicrosoftCompositionContextHelper to access actual Microsoft.UI.Composition visual.
auto rootVisual = winrt::Microsoft::ReactNative::Composition::MicrosoftCompositionContextHelper::InnerVisual(compositionRootView.RootVisual());

After:

winrt::Microsoft::ReactNative::Composition::CompositionUIService::SetCompositor(
    InstanceSettings(), g_liftedCompositor);

// CompositionRootView.RootVisual now directly returns a Microsoft.UI.Composition visual.
auto rootVisual = compositionRootView.RootVisual();
Microsoft Reviewers: Open in CodeFlow

@acoates-ms acoates-ms requested review from a team as code owners April 17, 2024 23:56
@jonthysell jonthysell added the Area: Fabric Support Facebook Fabric label Apr 23, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the New Architecture Broad category for issues that apply to the RN "new" architecture of Turbo Modules + Fabric label Apr 23, 2024
@@ -3,7 +3,6 @@

<PropertyGroup Label="Microsoft.ReactNative Experimental Features">
<UseHermes>true</UseHermes>
<UseFabric>true</UseFabric>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Maybe just leave in as <UseFabric>false</UseFabric>?

@acoates-ms acoates-ms merged commit 347922f into microsoft:main Apr 23, 2024
53 checks passed
acoates-ms added a commit to acoates-ms/react-native-windows that referenced this pull request Apr 23, 2024
* Move CompositionSwitcher to Experimental namespace

* Change files

* fix

* fix

* fix

* format

* fix

* fix

* format
acoates-ms added a commit that referenced this pull request Apr 23, 2024
* Move CompositionSwitcher to Experimental namespace

* Change files

* fix

* fix

* fix

* format

* fix

* fix

* format

Co-authored-by: Jon Thysell <jthysell@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Fabric Support Facebook Fabric New Architecture Broad category for issues that apply to the RN "new" architecture of Turbo Modules + Fabric
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants