Needle Editor Sync should show updates in browser developer Console?

Should the Needle Editor Sync (NES) component on a 3D object in Unity help show the latest value on a Component, on reload? I thought it would. I still have to F5 or refresh the page to see updates in the browser Developer Console. The console states the hot reload was done, again it does not show the updated value (number). I left the NES Component at its default values. Iā€™ve tried it on the Content for a Scene, as well as directly on the 3D object. Am I just overlooking something simple? Thanks.

Console seen:
[Needle Engine] Hot reloading /src/scripts/ā€¦
[vite] hot updated: /src/scripts/ā€¦

Example code you can use to test:


export class Rotate extends Behaviour
{
    start(){
        // logging this is useful for debugging in the browser. 
        // You can open the developer console (F12) to see what data your component contains
        console.log(this); // Works as expected

        this.printNumber(42); // NES does not show this update if I for example change to 84, save the file in Visual Studio Code.
    }

    private printNumber(myNumber : number){
        console.log("My Number is: " + myNumber);
    }
}

image.png

Original Post on Discord

by user 276719669878980608

Changed the channel name: Needle Editor Sync should show updates in browser developer Console without manual refresh?

by user 276719669878980608

Hi, NES and hot reload are two separate things. What you talk about is hot reload (ES is used to send modified values inside the editor to your website whereas what you want here is reload and replace parts of your code(!!) while the app stays running)

So to answer your question:

Hot reload does replace modified methods inside components and it runs onDisable and onEnable when hot reloading. So start is not called again (since the component has already started)
It also will not replace instance variables (e.g. if 42 was declared as myNumber: number = 42. And you change it to 86 in code it will not be replaced to not modify state)

Start, makes sense, oof! Thanks on the replace instance variables note. :slightly_smiling_face: Thanks again @marcel :cactus:

by user 276719669878980608

Changed the channel name: (ANSWERED) Needle Editor Sync should show updates in browser developer Console?

by user 276719669878980608

Changed the channel name: Needle Editor Sync should show updates in browser developer Console?

by user 276719669878980608