HotReload LiveReload LiveXaml [Mac] [Windows] [nuget package] [opensource]

2»

Posts

  • AndreiMisiukevich_AndreiMisiukevich_ USMember ✭✭✭✭

    @batmaci i'm going to work around this case. And you won't have to update every xaml.cs file
    thanks

  • vladhorbyvladhorby MXMember

    Hey @batmaci !
    SignalR - it was just faster to setup everything with just 2 lines of code. Of course, it can be done with basic TcpClient and I will remove the dependency soon.
    ReactiveUI - the Reloader doesn't use it, there is no dependency on it. But I do use it on my Xamarin Forms projects, so I needed to make sure the xaml update plays well with it, mainly making sure that WhenActivated (Page.Appearing) gets called after update.

    I'm not sure if there is another use case for the live reload, that I'm not seeing. My use case is during the UI design development, making changes in the xaml file and seeing those changes reflected in the running apps without rebuilding and rerunning them again and losing a lot of time.
    From that point of view, it doesn't matter if the change is in memory or in the device - I just need to see the impact of the updates and when the next build is done they are included in the package.

    Do you have another use case in mind?

  • AndreiMisiukevich_AndreiMisiukevich_ USMember ✭✭✭✭

    Let me introduce new VS for mac extension for easy work with HotReload

    https://github.com/AndreiMisiukevich/HotReload#mac

  • AndreiMisiukevich_AndreiMisiukevich_ USMember ✭✭✭✭

    Hi all
    Just pushed new version of HotReload.

    1) Removed redundant dependency to Rx
    2) You needn't update every xaml.cs file anymore!

    using Xamarin.Forms;
    
    namespace YourNamespace
    {
        public partial class App : Application
        {
            public App()
            {
                InitializeComponent();
    #if DEBUG
                HotReloader.Current.Start(this);     
    #endif
                MainPage = new NavigationPage(new MainPage());
            }
        }
    }
    

    That's all :)

    install VS extension (Available for Win and Mac) and enjoy

    https://github.com/AndreiMisiukevich/HotReload

  • AndreiMisiukevich_AndreiMisiukevich_ USMember ✭✭✭✭

    New release of HotRelod for xaml live reloading:
    0) No need to modify every xaml.cs file! (Just run HotReloader)
    1) No need to set you device IP in code (Just set up in extension)
    2) Removed dependency to Rx library
    https://github.com/AndreiMisiukevich/HotReload

  • AndreiMisiukevich_AndreiMisiukevich_ USMember ✭✭✭✭

    New version :)
    https://github.com/AndreiMisiukevich/HotReload

    ResourceDictionary support

  • RHudsonRHudson CAMember ✭✭✭
    edited March 14

    @AndreiMisiukevich_

    This is fantastic work Andrei! I love it.

    A few ideas to improve if possible. When switching platforms, I have to keep changing the ip address on the toolbar.

    Is it possible to eliminate this altogether? Could the device somehow report back its ip address at runtime?

    Or, at least, could the tool store the 3 ip address for the 3 target devices and select automatically based on which platform I'm debugging on?

  • AndreiMisiukevich_AndreiMisiukevich_ USMember ✭✭✭✭

    @RHudson said:
    @AndreiMisiukevich_

    This is fantastic work Andrei! I love it.

    A few ideas to improve if possible. When switching platforms, I have to keep changing the ip address on the toolbar.

    Is it possible to eliminate this altogether? Could the device somehow report back its ip address at runtime?

    Or, at least, could the tool store the 3 ip address for the 3 target devices and select automatically based on which platform I'm debugging on?

    Hi) thanks for your feedback)
    Multi IPs is In progress now: https://github.com/AndreiMisiukevich/HotReload/issues/29
    Will be available soon (on weekend i guess :))

    As for your case.. hm) maybe we can create "IPs history" ? with last 10 IPs
    What do you think?

  • AndreiMisiukevich_AndreiMisiukevich_ USMember ✭✭✭✭

    @RHudson Or maybe we will add "profiles" feature :) and you will be switch among your profiles with stored IPs

  • AndreiMisiukevich_AndreiMisiukevich_ USMember ✭✭✭✭

    Added ViewCell xaml.cs support

  • batmacibatmaci DEMember ✭✭✭✭✭

    @AndreiMisiukevich_ said:
    Added ViewCell xaml.cs support

    what it means? you can edit xaml.cs during debugging and it will reload changes. when i edit xaml.cs files in vs2017, it breaks my debugging usual, how did you overcome this?

  • AndreiMisiukevich_AndreiMisiukevich_ USMember ✭✭✭✭
  • AndreiMisiukevich_AndreiMisiukevich_ USMember ✭✭✭✭

    @batmaci oh .... my bad
    Added ViewCell.xaml support...

  • Umar3xUmar3x FRMember ✭✭✭

    Awesome work ! Working with Prism & Syncfusion components in one shot. Well done !

  • hauphidaohauphidao Member ✭✭

    I Cant user it. not work for me

  • AndreiMisiukevich_AndreiMisiukevich_ USMember ✭✭✭✭

    @hauphidao have you read Readme yet?
    Set up all things correctly? If android emulator -- checked workaround section?

  • hauphidaohauphidao Member ✭✭

    @AndreiMisiukevich_ said:
    @hauphidao have you read Readme yet?
    Set up all things correctly? If android emulator -- checked workaround section?

    yep! i config like this

  • AndreiMisiukevich_AndreiMisiukevich_ USMember ✭✭✭✭

    @hauphidao and what platform do you test?

  • hauphidaohauphidao Member ✭✭

    @AndreiMisiukevich_ I test on android real devices

  • AndreiMisiukevich_AndreiMisiukevich_ USMember ✭✭✭✭

    @hauphidao but stop
    what the

    this (null) in constructor???

    you must initialize HotReload before creating page

  • hauphidaohauphidao Member ✭✭

    here i use Prism but not work

  • AndreiMisiukevich_AndreiMisiukevich_ USMember ✭✭✭✭

    @Umar3x said:
    Awesome work ! Working with Prism & Syncfusion components in one shot. Well done !

    could you please assist?

  • AndreiMisiukevich_AndreiMisiukevich_ USMember ✭✭✭✭

    @hauphidao said:
    here i use Prism but not work

    create small sample and post on github, if you want. I will check what's wrong

  • Umar3xUmar3x FRMember ✭✭✭

    @AndreiMisiukevich_ sure thing mate.

    @hauphidao I'm doing same as you are

    public partial class App : PrismApplication
        {
            /* 
             * The Xamarin Forms XAML Previewer in Visual Studio uses System.Activator.CreateInstance.
             * This imposes a limitation in which the App class must have a default constructor. 
             * App(IPlatformInitializer initializer = null) cannot be handled by the Activator.
             */
            public App() : this(null) { }
    
            public App(IPlatformInitializer initializer) : base(initializer) { }
    
            protected override async void OnInitialized()
            {
                Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("license");
                InitializeComponent();
    
                HotReloader.Current.Start(this);
                await NavigationService.NavigateAsync("MainPage/CustomNavigationPage/MainTabbedPage");
            }
    ......
    }
    

    It does not work at all, or the app launch but your changes does not display ? I think that just might be that you put the wrong IP.

  • hauphidaohauphidao Member ✭✭

    @Umar3x how to set right Ip? i set ip 127.0.0.1:8000, need set ip on device ?

  • Umar3xUmar3x FRMember ✭✭✭
    edited April 5

    @hauphidao

    Get target device's IP easily for Android :

    • Open adb command prompt
    • Run command adb shell
    • Run command ip -f inet addr show wlan0

    You'll see an ip, connec to this one in HotReload.

  • AndreiMisiukevich_AndreiMisiukevich_ USMember ✭✭✭✭

    @hauphidao

    ah yessss

    @Umar3x nice catch!

    Wrong IP

    127.0.0.1 is localhost

    Check application output for more info about device IP
    Hot reload post your device ip to application output

    "### AVAILABLE DEVICE's IP:"

  • hauphidaohauphidao Member ✭✭

    @Umar3x
    @AndreiMisiukevich_

    it working thanks all.

  • AndreiMisiukevich_AndreiMisiukevich_ USMember ✭✭✭✭

    happy days :)

  • AndreiMisiukevich_AndreiMisiukevich_ USMember ✭✭✭✭

    We are working on device auto-detection feature :)
    So, i hope you won't need to fill this IP at all in future :)

  • batmacibatmaci DEMember ✭✭✭✭✭

    @AndreiMisiukevich_ extension works for me on windows but i tried now using on mac with ios simulator, i am not getting it running. i enabled from tools menu. 127.0.0.1:8000 is the default ip and port. what could it be the problem?

  • AndreiMisiukevich_AndreiMisiukevich_ USMember ✭✭✭✭

    @batmaci hm
    good question
    try on sample project pls

  • batmacibatmaci DEMember ✭✭✭✭✭

    @AndreiMisiukevich_ it works fine for me on my mac also now. generally works great but sometimes, it stops and until i restart the visual studio it will not display the changes. did you experience this on mac?

  • AndreiMisiukevich_AndreiMisiukevich_ USMember ✭✭✭✭

    @batmaci hmm.. maybe there are some issues..

  • AndreiMisiukevich_AndreiMisiukevich_ USMember ✭✭✭✭

    Added inline css styles support :)

    https://github.com/AndreiMisiukevich/HotReload

  • alinescooalinescoo Member

    Hello,

    I gave HotReload a try and I find something confusing about setting it up. (Windows 10, android emulator 8.1)
    Here's what I did:
    1. added the extension, nuget package in the projects
    2. I am using emulator so tried with default 127.0.0.1:8000 but I did not see my xaml being updated as I changed it.
    3. I've set the port to another value in Init constructor and also used the adb forward.

    It worked for a little while, even if it threw some errors but I managed to get some preview, now it fails again to work. I press Connect and the icon turns green, no error shown.

    Interesting that on output I can see that HOTRELOAD STARTED and I see the emulator IP addresses, but they are different from localhost.

    What am I doing wrong? Any advices?

  • AndreiMisiukevich_AndreiMisiukevich_ USMember ✭✭✭✭
    > @alinescoo said:
    > Hello,
    >
    > I gave HotReload a try and I find something confusing about setting it up. (Windows 10, android emulator 8.1)
    > Here's what I did:
    > 1. added the extension, nuget package in the projects
    > 2. I am using emulator so tried with default 127.0.0.1:8000 but I did not see my xaml being updated as I changed it.
    > 3. I've set the port to another value in Init constructor and also used the adb forward.
    >
    > It worked for a little while, even if it threw some errors but I managed to get some preview, now it fails again to work. I press Connect and the icon turns green, no error shown.
    >
    > Interesting that on output I can see that HOTRELOAD STARTED and I see the emulator IP addresses, but they are different from localhost.
    >
    > What am I doing wrong? Any advices?

    Hi, could you please create issue on GitHub with all necessary information?

    As I understood, you was able to make it working, but now it doesn't. Weird
2»
Sign In or Register to comment.