[00:00:06] Hi everyone. Thanks for joining. I'm [00:00:07] Alex from the Windows team. [00:00:09] Uh, sorry for my coarse voice. I'm still [00:00:11] recovering from uh mild cold. [00:00:14] So for the next 25 minutes half an hour, [00:00:16] we'll be looking at Microsoft UI [00:00:17] Reactor, which is an experimental way to [00:00:20] build native Windows applications where [00:00:22] all the UI is pure and plain C Sharp. [00:00:25] There are no XAML files, there are no [00:00:27] code behind, there's no view models. And [00:00:30] I mean experimental as an invitation. [00:00:32] The design is still soft enough that [00:00:34] what you tell us now uh can change the [00:00:36] design. So uh please keep the chat busy [00:00:40] and let's try to leave with an opinion. [00:00:42] So let's get started. [00:00:45] Um so I I want to start with a question. [00:00:47] Uh what if a complete application could [00:00:50] be just a single C Sharp file? [00:00:52] Uh and I'm talking about a native [00:00:54] Windows app. Uh no project file, no XAML [00:00:57] dot not no app dot XAML, no code behind, [00:01:00] no view model, just one file that you [00:01:02] can read from top to bottom. And if you [00:01:05] run that file with a plain dotnet run, [00:01:07] it just runs your full UI. [00:01:09] So that's where we'll start today and [00:01:12] then we'll build up from it uh to some [00:01:14] real applications. [00:01:15] So this is what Reactor tries to [00:01:17] simplify. Um but what Reactor Reactor [00:01:20] really is is actually three things. [00:01:23] First it is MVU, so the model view [00:01:25] update model. It is not MVVM. So your UI [00:01:28] is a function of the state. So if you [00:01:30] use React, SwiftUI, Jetpack Compose, uh [00:01:33] you already know the shape of it. [00:01:35] And if you know MVVM, think of MVU as [00:01:38] its counterpart. Uh two patterns with [00:01:41] different trade-offs on the exact same [00:01:44] platform. And very important here, this [00:01:46] is not a new UI platform. There's no new [00:01:49] renderer and no fork of WinUI. Uh when [00:01:53] you write a button in Reactor, you get a [00:01:55] real WinUI button. [00:01:56] And this is a third an experiment built [00:01:59] in open, on GitHub with the MIT license. [00:02:03] Um so, today there are no guarantees on [00:02:05] the API surface today, uh which is [00:02:07] exactly why your feedback matters so [00:02:09] much right now. We can shape it uh to [00:02:11] whatever we decide for it to be. [00:02:14] Um it's also where WinUI can try new [00:02:15] controls and patterns first like MVU. [00:02:19] Um and the ones that actually prove [00:02:21] themselves can actually be candidates to [00:02:23] land in WinUI itself for all apps, XAML [00:02:25] included. [00:02:27] So, um this is an example of a full [00:02:30] application. We're working to reduce [00:02:32] those first five lines to a single one [00:02:35] with a custom SDK. Uh but this is what [00:02:37] we have today. So, this is literally the [00:02:39] whole application, not a piece of it. If [00:02:41] you copy paste this code into a Notepad [00:02:43] file, uh just save it as .cs and run [00:02:46] dotnet run on it, it's just going to [00:02:47] run. The first five tops five lines at [00:02:50] the top are just the .NET [00:02:52] .NET 10 file-based app directives which [00:02:55] include the package reference, the build [00:02:57] settings like use WinUI because this is [00:03:00] a WinUI application. Um then right after [00:03:02] that you have just some usings and the [00:03:04] reactor app .run line which actually [00:03:06] starts your application. And we only [00:03:08] have one component in this app. It's [00:03:10] actually a very simple app which is the [00:03:11] my app here. So, the render method [00:03:13] inside that class is what returns the [00:03:16] description of your UI. You have a title [00:03:18] bar, you have the heading with the [00:03:20] count, and you have two buttons, one of [00:03:22] them with an accent. Um the use state [00:03:25] method that we're calling gives us the [00:03:27] count and a function, the set count that [00:03:29] allows us to change that value, the [00:03:31] count. [00:03:32] Um so, here's a question I like to ask [00:03:34] about any screen when I look at it. What [00:03:37] does it look like when, for example, [00:03:39] count is equal to five? [00:03:41] So, with reactor you read the render [00:03:43] method from top to bottom and that's it. [00:03:46] That's the whole thing. Uh let's show it [00:03:49] in action in an actual demo. [00:03:52] So, let's see if this works. Okay. [00:03:55] So, here we have just see where my mouse [00:03:58] is. Perfect. [00:04:01] So, if I I I literally just have that [00:04:03] file here, the the the counter.cs that I [00:04:05] just showed you, and if I run .NET run, [00:04:10] it will [00:04:11] um build my application and start [00:04:14] running it, of course in the wrong [00:04:15] screen, so let me move it. [00:04:18] So, um [00:04:20] this is a real WinUI application with a [00:04:22] real WinUI window, a real title bar. We [00:04:25] have Mica behind it, and we have that [00:04:27] accent button um in that uh plus sign. [00:04:31] None of it is drawn by Reactor itself or [00:04:34] or by our application. We're just [00:04:36] telling what Reactor should orchestrate [00:04:38] with WinUI. Reactor literally just [00:04:41] coordinates the creation of the objects [00:04:43] and the update of the states. So, these [00:04:45] are exactly the same controls that every [00:04:47] WinUI app built with XAML gets. [00:04:50] So, if I click on the plus button, [00:04:53] we're calling that um set count method, [00:04:57] and every time that I call it, it is [00:04:59] calling that method and it's calling the [00:05:01] render method again. So, Reactor handles [00:05:04] it all for us. We don't have to do [00:05:05] anything extra here. It writes literally [00:05:08] only what changes, which in this case is [00:05:10] very simple. It's just one tax property [00:05:12] in this one tax block. [00:05:14] Uh and because this is a real WinUI [00:05:16] window, the things that you expect to [00:05:18] work just work. So, if I resize this [00:05:20] window, if I change Windows to dark [00:05:22] mode, if I turn on Narrator, all the [00:05:25] accessibility from Windows and from [00:05:26] WinUI just kicks in and it just works. [00:05:29] Um and in this case, it is a packaged [00:05:32] application with packaged identity. So, [00:05:34] I can call AI APIs, I can call literally [00:05:36] everything from here. Um [00:05:38] that second package line that we had in [00:05:40] in in the file is what actually lets the [00:05:42] .NET run uh [00:05:45] run it as a packaged application, the [00:05:46] same way that WinApp run works. You [00:05:50] probably saw the the presentation that [00:05:51] we had earlier today [00:05:53] um by News. Um but the the one [00:05:57] file is literally just a start, right? [00:05:59] You're not going to ship You could if [00:06:01] you wanted to because this actually has [00:06:03] identity. You can package this and ship [00:06:04] it as an MSIX, but you probably want [00:06:07] something a little bit bigger um [00:06:08] organized in multiple files. Um so for [00:06:12] that we actually do need a CS proj. So [00:06:14] let's do that. [00:06:17] And here I'm going to call a command [00:06:20] from the WinApp CLI called the WinApp [00:06:22] New. [00:06:24] Uh WinApp is our command line for [00:06:26] Windows app development. So running [00:06:28] WinApp New here without any arguments [00:06:30] will let us pick uh over the new WinApp [00:06:33] SDK templates that we released not long [00:06:36] ago. Actually we shipped a new version [00:06:38] earlier today with with some fixes [00:06:40] specific for reactor and some there are [00:06:41] not only reactor only. Uh so if you [00:06:44] watched Morton and [00:06:46] Nils's presentation earlier this [00:06:47] morning, these are exactly the same [00:06:49] templates that they showed. Um the [00:06:51] WinApp here is simply handing off to the [00:06:53] new .NET experience. It's exactly the [00:06:56] same thing. [00:06:58] Um so you see that we also have some [00:07:00] XAML templates here too, uh but we also [00:07:03] have five experimental uh reactor [00:07:05] templates. So I'm going to pick the [00:07:07] navigation view here. [00:07:09] Uh let's give it a name. I'll just call [00:07:11] it conf demo. [00:07:13] Uh and once this creates my template, [00:07:17] I have a full featured application. If I [00:07:20] just go to that folder and list the [00:07:22] files, you see that we we have an [00:07:24] agents.md that helps uh with a few [00:07:26] things. We have an an Apex manifest. We [00:07:28] have our app.cs that actually contains [00:07:31] uh all of our code. And now if I just do [00:07:33] uh a simple WinApp run, [00:07:36] this is just going to bundle that [00:07:37] application, install it locally with [00:07:39] identity, launch it. Um and everything [00:07:42] that WinApp did here uh it could have [00:07:44] done um with a simple .NET New and a [00:07:47] .NET Run as well. The WinApp just takes [00:07:49] care of the packaging boilerplate for [00:07:51] us. [00:07:52] Uh so WinApp is building it, it's [00:07:54] registering it, it's launching it with [00:07:55] package identity. And in this case it's [00:07:58] just a simple navigation view right from [00:08:00] the the new templates. [00:08:02] Um but we can definitely do uh more [00:08:04] complex applications such as the reactor [00:08:08] uh WinUI gallery. [00:08:10] So every UI framework has a beautiful [00:08:13] counter like the one that I just showed [00:08:15] you, but this is the other extreme of [00:08:16] the scale, [00:08:18] the reactor gallery which is a [00:08:19] counterpart to what we have on the WinUI [00:08:22] gallery. [00:08:23] This last I checked, we have around 90 [00:08:26] something, I think 93 pages with [00:08:29] controls showing literally everything [00:08:31] that reactor exposes in very simple and [00:08:34] copy pasteable samples and snippets. [00:08:37] So over here, if I can find my mouse, [00:08:41] if I just search for button [00:08:43] and select this very first demo here, [00:08:46] you'll see that we have some examples of [00:08:49] how this code actually looks like and [00:08:51] this is not [00:08:53] a code that is [00:08:55] similar to what is executing. This is [00:08:57] exactly the code that is executing. It [00:08:59] is a live C# demo that is being built [00:09:02] into the application. [00:09:04] So we also have examples of data grids, [00:09:07] docking panes, navigation media. All of [00:09:09] these are just copy pasteable so you can [00:09:11] put it in any reactor application and [00:09:14] and test it for yourself. And again, [00:09:16] these are all real WinUI controls. There [00:09:18] are a few of them that are actually [00:09:20] ours. So if you search for [00:09:24] data grid, we built this before we had [00:09:27] the table view from WinUI, but we have a [00:09:30] full featured data grid built natively [00:09:33] in reactor. [00:09:34] Again, this fully supports everything [00:09:37] that I told you. So if I switch to dark [00:09:38] mode in the app, we have this [00:09:41] sweet little button here that lets me [00:09:43] test multiple [00:09:45] accent colors as well. [00:09:46] Sorry, just dark mode and light mode. [00:09:48] But I can also group things, [00:09:51] order things differently and see how [00:09:53] this control behaves. And if you just [00:09:55] scroll down a little bit a little bit, [00:09:56] you have the full source code of what [00:09:58] that that actually looks like and you [00:10:00] can copy paste it and and play with it [00:10:02] and do whatever. [00:10:04] But this is what an application can look [00:10:07] like with reactor. Let's now talk a [00:10:09] little bit about [00:10:10] you actually [00:10:12] work with an app and how it actually [00:10:14] works, how Reactor itself works. [00:10:17] So [00:10:19] these were the demos. Okay. [00:10:20] So if there is no view model, where does [00:10:23] the state actually live? [00:10:26] So the state lives inside those [00:10:28] components, right? In that first demo [00:10:29] that I showed, we had literally just one [00:10:31] component, [00:10:33] but within the component there is a [00:10:35] concept of a numbered slot. So [00:10:38] Reactor handles that for us [00:10:40] automatically and it hands it back for [00:10:43] us at every render. So in in this [00:10:45] example [00:10:47] count is just a plain integer. It's not [00:10:50] a property and there's nothing observing [00:10:52] it. [00:10:53] It is the actual value of the counter [00:10:56] for this render. [00:10:58] So the set count method writes a new [00:11:01] value into that same slot and schedules [00:11:03] a new render, so a new execution of the [00:11:05] render method. [00:11:06] So when the render method runs again top [00:11:08] to bottom, [00:11:09] Reactor patches only the difference into [00:11:12] the real WinUI controls. [00:11:14] This is basically the whole reactivity [00:11:16] model. There's no step that you're [00:11:18] missing. [00:11:19] And those slots are numbered in call [00:11:22] order and that's actually super [00:11:23] important. So the first use state [00:11:27] is using slot number one or slot number [00:11:30] zero if you want. And the second one is [00:11:32] using slot number one. [00:11:34] So Reactor keeps all of them alive [00:11:37] between multiple renders. And hold on to [00:11:40] that idea because it will come back in a [00:11:41] couple of slides. [00:11:43] If you come from MVVM, [00:11:45] the biggest difference is there is no I [00:11:47] notify property changed. There's no [00:11:50] binding pulling new values. Calling that [00:11:53] setter is the actual announcement. [00:11:56] So if you look at a text blocks [00:11:59] a value and a callback, right? That's [00:12:01] basically it. That's your two-way [00:12:02] binding. There's no mode to set and [00:12:05] there's no wondering which like [00:12:07] direction is winning in a binding. [00:12:11] What [00:12:12] when a screen several pieces [00:12:14] of state that that actually changed [00:12:16] together, the separate setters will very [00:12:19] soon stop scaling. That's why we provide [00:12:22] another method called the use reducer, [00:12:25] and that's what it's for. It's the [00:12:26] update in the MVU pattern or model view [00:12:30] update. [00:12:31] This code is an example of a simple [00:12:33] Minesweeper game. [00:12:35] The state is a record, and every move is [00:12:38] also a record. So the review, the toggle [00:12:40] flag, the new game, they they're just [00:12:44] records here, and these are our states. [00:12:46] Those four lines are literally the [00:12:48] complete list of what can happen inside [00:12:51] this game. So the use reducer method [00:12:54] gives us the current state and a [00:12:55] dispatch function. [00:12:57] So a cell by itself doesn't change [00:12:59] anything. It just dispatches the review, [00:13:01] the toggle flag, the new game, [00:13:04] and the reducer is just a plain C sharp [00:13:06] function. It has state, and with the [00:13:09] state you have an action, that's [00:13:11] basically your input, and then you have [00:13:12] your next state out. So state and action [00:13:15] in and next state out. [00:13:17] There are no controls, no dispatcher, no [00:13:19] UI types. [00:13:21] This means that you can unit test this [00:13:23] whole application [00:13:25] with literally every single move in a [00:13:27] headless [00:13:28] app app or a headless task project [00:13:30] without any windows, which is also a [00:13:32] nice benefit when you were you are doing [00:13:34] unit testing. [00:13:36] So let's say that a bug report comes in [00:13:38] and say that your game got into some [00:13:40] weird state. [00:13:42] This makes it easier very easy for us to [00:13:44] debug this since literally every single [00:13:47] single possible transition is in one [00:13:49] switch expression [00:13:51] in literally just this one file. [00:13:54] Now there's one rule to be aware, and it [00:13:57] comes from those numbered slots, which [00:13:59] is very important. The the hooks, which [00:14:01] is what we're calling [00:14:03] the methods that actually hook into the [00:14:05] those slots, they're tracked by the call [00:14:08] order. So the call order is super [00:14:09] important. [00:14:10] So the slot numbers will only line up if [00:14:14] you do same calls within a render [00:14:17] method, [00:14:18] within the same order on every render. [00:14:20] So you should absolutely never call any [00:14:24] of those hooks conditionally. [00:14:27] So there are no hooks inside ifs or [00:14:29] inside a loop or after an early return. [00:14:33] If you do that, the numbering can and [00:14:36] will change and things will fail [00:14:38] miserably, so you have to be careful. [00:14:41] So call the hook every time and branch [00:14:44] on the values instead, [00:14:46] not on actually calling the method. [00:14:48] That's basically the same rule that you [00:14:50] have with React and for exactly the same [00:14:53] reason. [00:14:53] It sounds strict, but in practice you're [00:14:56] going to hit it once, you're going to [00:14:57] get a red squiggle that will tell you [00:14:59] why and you're going to fix it once and [00:15:02] you move on. [00:15:03] You don't have to remember it at 2:00 [00:15:05] 2:00 a.m. in the morning when you're [00:15:06] actually building and debugging anything [00:15:08] because we do have an analyzer, a Roslyn [00:15:10] analyzer that flags it as you type it, [00:15:13] as we'll see in a few slides as well. [00:15:16] Next is lists, which is super important. [00:15:19] Most applications shows lists of things. [00:15:23] So frameworks such as Reactor really [00:15:26] have to optimize for these. [00:15:29] In this example, we have our Minesweeper [00:15:31] example again. [00:15:32] So that very first for each goes over 16 [00:15:35] rows and then another one inside it goes [00:15:38] over 16 cells for each row. [00:15:41] So that's 256 interactive buttons and [00:15:45] every cell get [00:15:47] gets a key [00:15:49] within that very nested with key method. [00:15:52] So the key gives each cell a stable [00:15:55] identity. [00:15:56] So when the border renders again, [00:15:58] Reactor matches each cell to the control [00:16:00] that already represents it instead of [00:16:02] trying to guess by position. [00:16:06] So if you review a corner on an empty [00:16:08] board [00:16:09] and the reducer flips 200 cells in one [00:16:12] action, right? You don't have to write [00:16:14] and update this control line. [00:16:16] You produce one new description of the [00:16:18] and Reactor writes only the cells that [00:16:20] actually changed. [00:16:22] There's no incremental path um for for [00:16:24] updates. So there's nothing um in theory [00:16:27] to get wrong. [00:16:28] And you can see the the second line from [00:16:30] the bottom. You can see that we have the [00:16:31] automation name at the bottom. Uh it's [00:16:34] literally simple interpolated string. So [00:16:37] screen readers can also just say row [00:16:39] four column seven instead of just [00:16:41] button. [00:16:44] Um and why do keys matter so much, [00:16:46] right? So take a list and insert insert [00:16:49] a new row at the top. Without the keys, [00:16:51] the diff can only compare by position. [00:16:53] So row one used to be A and now it's X. [00:16:57] So rewrite it. [00:16:59] Row two used to be B and it's now A. So [00:17:02] rewrite that one too. So every row [00:17:04] changes and any focus or state inside [00:17:07] those rows goes with it. [00:17:09] With keys, Reactor matches the rows by [00:17:11] the identity. So A will still be A, B [00:17:14] will still be B, etc. [00:17:16] It just figures out the minimal set of [00:17:18] moves required by itself. [00:17:20] Um there's a very complex algorithm [00:17:22] internally that actually does that. Um [00:17:24] so if you insert at the top of 1,000 [00:17:26] rows, that's the one control created and [00:17:29] zero controls actually moved. [00:17:31] So that's why we push so hard on keys [00:17:34] and uh we even have an analyzer that [00:17:36] will nudge you when you forget to add [00:17:38] one, which is quite helpful. [00:17:41] Um so now these are some of the Roslyn [00:17:44] analyzers that we were shipping with [00:17:45] Reactor. [00:17:46] Uh we have more than 60 of them. I think [00:17:49] 62. [00:17:50] Um and we [00:17:53] um [00:17:54] and but here's just some of them that [00:17:55] are actually interesting. Uh the first [00:17:57] two are the ones that I just mentioned [00:17:59] on the the the few slides. [00:18:01] Uh a hook called inside an if and a list [00:18:04] without a key. You get a red squiggle [00:18:06] the moment you type it before you even [00:18:08] build anything because it is just C [00:18:10] Sharp. So we're just leveraging Roslyn [00:18:12] analyzers. It is just Roslyn. [00:18:14] The rest catches things that are just [00:18:16] easy to miss like a hard-coded caller [00:18:20] that looks fine in light mode and breaks [00:18:22] in dark mode or an icon only button that [00:18:25] a screen reader uh can only analysis a [00:18:27] button or even a UI update [00:18:30] uh from a background thread which you [00:18:31] normally only find uh when the app [00:18:34] actually crashes. There's even um a very [00:18:36] cool one that is a did you mean this [00:18:38] analyzer which is quite cool. Uh for [00:18:40] example if you type button with a single [00:18:42] T instead of just getting a build error [00:18:45] with a name not found you actually get [00:18:48] did you mean button with two Ts? [00:18:50] Um so the idea is very simple. Uh if [00:18:52] there's a tool that can catch a mistake [00:18:54] it should catch it while you're typing [00:18:56] your code not only when you try to build [00:18:59] it or even worse when you're actually [00:19:01] running it. [00:19:02] Um so that's why because these are just [00:19:05] Roslyn analyzers it shows up in Visual [00:19:07] Studio, it shows up in VS Code and even [00:19:10] in just a build output from a simple [00:19:12] .NET build from the CLI. Again just [00:19:14] Roslyn just works. [00:19:16] Um now this is something that I wanted [00:19:19] to double down a little. Uh Reactor is [00:19:21] an experiment [00:19:23] being done completely out in the open. [00:19:25] So we have learned a few things along [00:19:27] the way. So this is just a few things [00:19:29] that we learned [00:19:31] while building real apps with it and [00:19:33] while building Reactor itself. [00:19:35] As I've shown you before keys matter a [00:19:37] lot. [00:19:38] It actually matters more than we [00:19:41] originally first thought that it would. [00:19:44] Early examples without keys looked okay [00:19:47] but reconciled very badly. Uh so that [00:19:50] feedback gives us a proper keyed diff so [00:19:53] you can provide that key to us so we [00:19:55] match the keys for you plus the analyzer [00:19:57] that you just saw. [00:19:59] Also when something felt slow everyone's [00:20:02] instinct instinct was just to say that [00:20:05] the diff itself was slow [00:20:07] which almost never was the case. The [00:20:09] profiler kept pointing at allocations. [00:20:12] So fluent modifier chains producing [00:20:14] piles of short-lived garbage on every [00:20:17] render. So also um every virtualized [00:20:20] list that we have exists because of a [00:20:22] sample app that had poor performance. [00:20:24] And finally implementing docking took [00:20:27] way more designing design time than the [00:20:30] reconciler did, which was not expected [00:20:32] at all. [00:20:33] Each one of these lessons came from [00:20:35] trying to build some real application [00:20:37] and or someone trying to build those [00:20:39] applications and telling us what was [00:20:41] wrong, what broke. [00:20:42] So this is the type of loop and feedback [00:20:45] that we're trying to get. [00:20:47] So please keep that feedback coming. [00:20:49] We're trying to make the product as good [00:20:50] as possible. [00:20:52] So [00:20:53] a quick word on XAML since the name of [00:20:56] the presentation is no XAML required and [00:20:59] required is the keyword here. XAML is a [00:21:02] first class way of building WinUI [00:21:04] applications and it is not deprecated. [00:21:07] Even more than that, we are ramping up [00:21:08] our investments in WinUI. Reactor is [00:21:11] just another way to use exactly the same [00:21:14] platform. [00:21:15] If WinUI doesn't go forward, Reactor [00:21:17] doesn't go forward. [00:21:18] And they work together in both [00:21:20] directions. So the the first block that [00:21:22] I'm showing here is new in Reactor [00:21:26] preview.17 that we shipped last week [00:21:28] where we now have a new tag in XAML that [00:21:31] lets you host a Reactor component right [00:21:33] inside your XAML. It is the same [00:21:35] process, the same visual tree and no [00:21:38] rewrite. And the second block goes the [00:21:40] other way. [00:21:41] The XAML page Reactor component brings [00:21:44] whole existing XAML page into a Reactor [00:21:47] component and the XAML host takes any [00:21:49] control, yours or a third party. [00:21:53] Also if you are on WinForms, there is [00:21:55] also an interop package for that too, so [00:21:57] you can modernize one panel at a time if [00:21:59] you want. [00:22:00] So our advice is do not migrate if you [00:22:03] don't have to. [00:22:04] If you want, pick something small and [00:22:06] new, [00:22:07] like one screen or an internal tool and [00:22:10] try Reactor there. [00:22:12] We would love to see what you're coming [00:22:13] up with. [00:22:15] So let's switch to our dev tools demo. [00:22:19] So [00:22:21] for this app [00:22:22] I'm going to run a command that is not [00:22:25] shipped publicly yet, which is the [00:22:27] WinApp run with minus-minus watch. We [00:22:29] did ship WinApp run, but not with [00:22:31] minus-minus watch. [00:22:33] Uh this is exactly the same uh [00:22:35] Minesweeper game that we had from some [00:22:36] slides before. [00:22:38] Um but [00:22:40] when this app runs, which will be in a [00:22:43] couple of seconds [00:22:47] and I switch it to the other screen. [00:22:48] Okay. [00:22:49] Um you can see that now we have um a a [00:22:52] bar at the bottom of the app that shows [00:22:55] me the dev tools. So this is um a React [00:22:58] application with the dev tools attached [00:23:00] and it shows me different things that we [00:23:02] can do within uh this dev tools, which [00:23:05] is specifically for React, not just uh [00:23:07] WinUI. So it knows the context of your [00:23:10] React applications and shows that to us. [00:23:12] So let me just switch this to [00:23:13] intermediate. Um let me just uh have [00:23:16] some actual state so I can show this um [00:23:21] Of course I hit a bomb. Doesn't matter. [00:23:23] Um so let me actually get the dev tools [00:23:28] and if I can see properly, think I hit [00:23:30] the right icon. [00:23:33] Nope, that's not the right one. [00:23:37] The one to the left of it, which is [00:23:40] hidden. [00:23:43] Just move this sideways so I can [00:23:45] actually [00:23:46] do this. Okay. Here it is. [00:23:50] Okay. [00:23:51] So if I click on any of these, [00:23:53] it will actually pop up the React dev [00:23:55] tools for me. [00:23:57] Uh and again, this is in preview. This [00:23:58] is not in um in the stable version 0.8 [00:24:02] that we shipped of the the CLI, of the [00:24:05] WinApp CLI. [00:24:06] But um it is in a PR that you can just [00:24:09] try it yourself with the WinApp uh PR uh [00:24:11] command line. [00:24:13] So if I go to [00:24:15] VS Code here [00:24:18] and I go to this one line here, perfect. [00:24:22] If I show you the app again, [00:24:24] you see the size of each um number here. [00:24:28] I'm just going to change that real quick [00:24:30] from 0.55 to 0. [00:24:33] 95 and I save it and I alt tab real [00:24:35] quick and it increase the size of the [00:24:37] font of just that one number. But [00:24:40] everything else in in the application [00:24:42] stay the same. So [00:24:44] my flags are still there, my bombs are [00:24:46] still there, the number is still there. [00:24:48] This is just hot reloading a live app. [00:24:50] So this is the the same .NET run with [00:24:52] minus minus watch that we have, but now [00:24:54] running with [00:24:56] within a packaged application and with [00:24:58] the context of a React app. So if I [00:25:01] switch back to my dev tools, [00:25:04] you see that not only I have [00:25:07] the lines of everything that [00:25:10] the app here as well. [00:25:13] Okay. [00:25:15] You can see that we have the context of [00:25:18] everything from the React component [00:25:20] itself. So up here you can see that this [00:25:22] is on grid number X and column number X. [00:25:25] We have all that information from the [00:25:27] React components. So React is exposing [00:25:30] that information. The dev tools are [00:25:32] attaching to that information and it's [00:25:34] showing to you. And of course I can just [00:25:35] change everything that I want from the [00:25:38] Zaml perspective. So you have a mix of [00:25:40] your Zaml components and your React [00:25:41] components together in the same screen. [00:25:46] So that is what I wanted to show from [00:25:50] the [00:25:51] dev tools. But it's interesting to see [00:25:53] that everything that is being shown here [00:25:55] can also be leveraged by a large [00:25:57] language model by by agents because all [00:26:00] the capabilities that are exposed by by [00:26:03] React to the dev tools are also exposed [00:26:06] to the dev tools from a command line [00:26:08] tool that an LLM can call. So we have an [00:26:11] example of that [00:26:12] [snorts] right here in my slides. [00:26:15] This is basically what the same what the [00:26:18] dev tools see. It's the same information [00:26:20] as what what you see using the dev [00:26:23] tools. [00:26:24] The WinApp dev tools inspect command [00:26:27] gives you the component tree and you can [00:26:29] specify how deep you want to see that. [00:26:31] Uh, but it also gives you the C# file [00:26:34] and the line for every node. [00:26:37] Uh, so the agent will actually have that [00:26:39] context and know which line of uh of of [00:26:42] uh [00:26:43] of code actually matches to what [00:26:46] property that it's trying to change or [00:26:47] what component in the visual tree uh is [00:26:50] actually provided by the uh the tooling. [00:26:52] So the get state command all uh shows [00:26:55] you each hook with its name, the types, [00:26:57] the values, and we also have a set state [00:26:59] that lets you change it. Um, passwords [00:27:02] are redacted, so the dev tools refuses [00:27:04] to write them. Exactly the same thing. [00:27:06] That's just the protocol in between the [00:27:07] two. [00:27:08] [snorts] So that's literally what any [00:27:10] coding agent can see and it can just do [00:27:12] exactly the same kinds of things that [00:27:14] the dev tools did. Just like the [00:27:16] previous presentation mentioned, it's [00:27:18] much better to actually have that [00:27:19] information from the visual tree [00:27:21] than um [00:27:22] than taking a screenshot and trying to [00:27:24] infer that information. [00:27:27] So um Reactor is not just a set of [00:27:29] samples, though we do have plenty of [00:27:31] them. We do have like an IDE with a tear [00:27:33] off with tear off docking panes, uh code [00:27:36] editor built with Monaco, um a chat [00:27:39] client, and about 20 more. [00:27:42] Each one of them would cause some kind [00:27:44] of redesign within the APIs that we [00:27:45] have, which is exactly why they exist [00:27:47] and why we're exposing them. [00:27:49] Uh, you probably also heard of Open [00:27:51] Claw. They recently announced their [00:27:53] Windows companion app and they are using [00:27:56] Reactor in production for the chat [00:27:58] window. It is all open source, so you [00:28:00] can just go read the code and see how [00:28:02] they are shipping apps uh using Reactor. [00:28:05] Um, the Uno Platform team also just [00:28:08] released their port of Reactor. Exactly [00:28:10] the same code. Not a single line has to [00:28:12] change. The same components, the same [00:28:14] hooks running also on macOS, Linux, [00:28:16] WebAssembly, Android, and iOS. And it's [00:28:19] again also experimental just like [00:28:21] Reactor. [00:28:22] And this whole idea is not fully tied to [00:28:24] .NET. Uh, there is a version of Reactor [00:28:27] within the Windows Reactor uh repo that [00:28:30] runs exactly the same experiment in [00:28:32] Rust. [00:28:33] And um [00:28:34] go check it out. Everything is also MIT [00:28:36] licensed and built out in the open. [00:28:39] So [00:28:40] pretty much closing here. Try and [00:28:42] Reactor should really take you just [00:28:43] three commands. Install the WinApp CLI [00:28:46] with WinGet, run WinApp New with the new [00:28:49] Reactor templates, and then just run [00:28:51] WinApp Run. [00:28:53] Or just pick from the templates like we [00:28:54] did earlier. Uh there are five of them. [00:28:57] Um you only need .NET 10 SDK. Also works [00:29:00] with .NET 11 SDK. We're already working [00:29:02] on bringing some of the new [00:29:04] functionalities from . from C# 15 into [00:29:07] Reactor and providing that extra [00:29:08] metadata to applications that want to [00:29:10] leverage it. [snorts] Um and but if you [00:29:12] rather just start with one file, [00:29:14] everything should just work [00:29:15] um as well with the first example that I [00:29:17] mentioned. And there is also a blog post [00:29:20] that we did uh about a month ago that [00:29:22] goes into the details. It's going to be [00:29:24] a series and we're finishing it up um [00:29:27] probably by early next year. [00:29:29] Uh that's basically it from me. The [00:29:33] repo, the guy, the blog posts are all on [00:29:35] the screen. Uh if you do try Reactor, [00:29:38] tell us what you think, good or bad. [00:29:40] Um and thanks for spending this half [00:29:42] hour with us.