View Issue Details

IDProjectCategoryView StatusLast Update
0002239NoesisGUIC++ SDKpublic2022-02-07 14:12
Reporterjsantos Assigned Tosfernandez  
PrioritynormalSeverityfeatureReproducibilityN/A
Status assignedResolutionopen 
Product Version3.1 
Summary0002239: Hot-Reloading improvements
DescriptionWe are using this ticket as a place holder for all improvements and ideas we have to improve current Hot-Reloading implementation.
TagsNo tags attached.
PlatformAny

Activities

sfernandez

sfernandez

2022-01-13 18:24

manager   ~0007733

Add a virtual method to FrameworkElement equivalent to ConnectEvent for the FindNames, something in the line of:

 - virtual void ConnectName(BaseComponent* source, const char* name);
sfernandez

sfernandez

2022-01-13 18:25

manager   ~0007734

Consider deprecating Reloaded event in favor of a more friendly cycle of events for the user:

 - Unloaded
 - "load and parse xaml"
 - Initialized
 - Loaded
jsantos

jsantos

2022-01-13 18:31

manager   ~0007735

We are also keeping an internal list of "named" elements to avoid dangling pointers on the client that is probably unnecessary as it doesn't cover all scenarios.
stonstad

stonstad

2022-01-13 22:05

reporter   ~0007736

I understand the desire to encourage users to use DataContext. But I think forcing users to adopt this path when it is not required in WPF, UWP, and prior versions of Noesis is not sensible. I need a mechanism to opt out because data binding is not always the right solution. The targeting system for my game should not use data contexts. The proposed Noesis solution is that I port controls over to an opinionated design or live with runtime breakage each time I modify XAML during Unity playback. A sensible interim solution is an opt out flag, i.e. "Disable Runtime Reload".
jsantos

jsantos

2022-01-17 11:10

manager   ~0007738

I think the only way to retain the state is using Data Context. The improvements commented in this ticket are in the line of fixing as much as possible to avoid breakage (not using DataContext). This is the approach closer to WPF also (if you hot-reload in Visual Studio).

To understand more about your scenario could you tell us more about why are you editing XAML during play if you don't expect it to reload?

Anyway, @sfernandez is is extremely confusing that editing a resource dictionary reload all dependencies and reset the state of all its XAML even when hot-reloading is not supported in ResourceDictionaries,
stonstad

stonstad

2022-01-17 16:44

reporter   ~0007740

I edit XAML during playback for the same reason I edit code -- to correct bugs and apply fixes. There are scenarios in which I purposefully do not use data context. Is there a Noesis Unity CS file I may modify to disable this behavior?
jsantos

jsantos

2022-01-17 18:45

manager   ~0007742

I know, yes, but I am trying to understand, if you want to disable XAML reloading what's the purpose of editing xaml while in Play mode? It will behave exactly as not editing xaml.
stonstad

stonstad

2022-01-18 15:46

reporter   ~0007744

Hot reload is a great feature that I intend to use but at present this isn't possible. With regard to my daily workflow -- the reason I make changes during runtime is because Unity has a slow iteration time -- this is the time between editor stop and subsequent playback. I could take notes of necessary product changes as I play the game or I can just make the changes directly. Which one seems easier to you? When I am developing I am usually working on multiple changes at once. For each editor iteration, I am likely testing two changes (which can only be confirmed through visual play) and working on new code for a subsequent change. Having Noesis forcibly remove control state which was previously set in the game breaks this development workflow.
Faerdan

Faerdan

2022-01-19 16:26

reporter   ~0007748

I have had to disable hot reloading (by modifiying the code) in our project for reasons similar to stonstad.

As well as breaking some elements, it was also triggering XAML imports during play, which was frustrating as you have to wait for it to complete before doing anything in the Editor.
jsantos

jsantos

2022-01-20 12:07

manager   ~0007750

In 3.1.2 we added two important improvements to Hot-Reloading

 - ResourceDictionaries do not reload. So if you touch them, nothing happens
 - Reimport times are now an order of magnitude faster. From second to milliseconds.

We also observed that setting 'Preferences > General > Script Changes While Playing' to 'Recompile After Finished Playing' disables Hot-Reloading (because it disables import for all assets)
stonstad

stonstad

2022-01-20 16:29

reporter   ~0007752

> We also observed that setting 'Preferences > General > Script Changes While Playing' to 'Recompile After Finished Playing' disables Hot-Reloading

I'm not sure this is the case for many Unity versions. I'm running Unity 2021.2.5f1 with Recompile After Finished Playing set and Noesis still hot reloads. See https://issuetracker.unity3d.com/issues/a-false-pup-up-appears-when-modifying-a-script-and-having-recompile-after-finished-playing-set
stonstad

stonstad

2022-02-01 22:49

reporter   ~0007768

Any updates on whether this will be a supported feature, i.e. disabling hot reload via noesis configuration?
jsantos

jsantos

2022-02-02 12:34

manager   ~0007769

We need to discuss about this, but definitely is not happening on 3.1.3 that we plan to release very soon.

Could you disable this by code for now? (NoesisPostProcessor.cs)
stonstad

stonstad

2022-02-04 15:59

reporter   ~0007778

Yes, a work-around is fine. Do I add an Editor.isPlaying check to OnPostprocessAllAssets?
jsantos

jsantos

2022-02-07 14:12

manager   ~0007782

yes, something like that should work for now

Issue History

Date Modified Username Field Change
2022-01-13 18:10 jsantos New Issue
2022-01-13 18:11 jsantos Assigned To => sfernandez
2022-01-13 18:11 jsantos Status new => assigned
2022-01-13 18:11 jsantos Product Version RTL => 3.1
2022-01-13 18:24 sfernandez Note Added: 0007733
2022-01-13 18:25 sfernandez Note Added: 0007734
2022-01-13 18:31 jsantos Note Added: 0007735
2022-01-13 22:05 stonstad Note Added: 0007736
2022-01-17 11:10 jsantos Note Added: 0007738
2022-01-17 11:10 jsantos Status assigned => feedback
2022-01-17 16:44 stonstad Note Added: 0007740
2022-01-17 18:45 jsantos Note Added: 0007742
2022-01-17 18:45 jsantos Status feedback => assigned
2022-01-17 18:45 jsantos Status assigned => feedback
2022-01-18 15:46 stonstad Note Added: 0007744
2022-01-19 16:26 Faerdan Note Added: 0007748
2022-01-20 12:07 jsantos Note Added: 0007750
2022-01-20 12:07 jsantos Status feedback => assigned
2022-01-20 16:29 stonstad Note Added: 0007752
2022-02-01 22:49 stonstad Note Added: 0007768
2022-02-02 12:34 jsantos Note Added: 0007769
2022-02-02 12:34 jsantos Status assigned => feedback
2022-02-04 15:59 stonstad Note Added: 0007778
2022-02-07 14:12 jsantos Note Added: 0007782
2022-02-07 14:12 jsantos Status feedback => assigned