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

docs: add extensions reactive upgrade node #2557

Merged
merged 8 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions doc/reactive-migration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
ajpinedam marked this conversation as resolved.
Show resolved Hide resolved
uid: Extensions.Migration.Reactive
---

# Upgrading Extensions Reactive Version

## Upgrading to Extensions Reactive V5

Upgrading to Uno.Extension.Reactive V5 should not require any changes to your application code. However, there are new features and improvements that you may want to take advantage of.

### MVUX Generated Code

In V4, the MVUX analyzer generates a bindable proxy for each of the models in your app. For example, the bindable proxy for `MainModel` was named `BindableMainModel`.

This behavior has changed in V5, and the MVUX analyzer will now generate a ViewModel class for each of your app's models. For example, the generated code for `MainModel` will be named `MainViewModel`.

> [!IMPORTANT]
> You don't have to do anything if you update but want to keep the old behavior. The generator will continue to generate the bindable proxies.

To upgrade your application and use the latest generator, you must set an assembly level attribute, `BindableGenerationTool`, in the `GlobalUsing.cs`.

```csharp
// GlobalUsing.cs
[assembly: Uno.Extensions.Reactive.Config.BindableGenerationTool(3)]
```

You will also need to update the references to the generated classes. These are usually referenced in the code-behind file when using XAML, for example, `MainPage.xaml.cs`, or in the Page UI definition when using C# for Markup, for example, `MainPage.cs`.

```csharp
// V4
public MainPage()
{
this.InitializeComponent();
DataContext = new BindableMainModel();
}
```

```csharp
// V5
public MainPage()
{
this.InitializeComponent();
DataContext = new MainViewModel();
}
```
2 changes: 2 additions & 0 deletions doc/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
items:
- name: Overview
href: Reference/Reactive/concept.md
- name: Upgrading Extensions Reactive
href: reactive-migration.md
ajpinedam marked this conversation as resolved.
Show resolved Hide resolved
- name: General guidelines
href: Reference/Reactive/general.md
- name: Feed
Expand Down
Loading