rshinygolem

Launching the app does not track changes when using golem framework


I have just stumbled upon golem and had a very good experience using it so far. The documentation is also excellent.

My only issue is regarding running the app / launching it (not deployment). I usually have the app instance running in a browser on one monitor, make changes in my code on another monitor, and simply refresh the browser page every time to update it. That works for everything, even css file modifications.

There is also the built-in 'Run App' button in RStudio which is quite handy.

This time with golem, I have to manually enter golem::run_dev() every time.
Using the .Global_Env run_app() that is in the run_app.R file refreshes the instance but does not update according to my changes in my code, and neither does refreshing the browser. The RStudio Run App also is not available.

So in short, the usual way of refreshing does not track changes.
Not only that, but running golem::run_dev() also detaches golem from the active library so I can't just use the shorter the following time run_dev().

How should one go about having responsive updates to the app instance using golem?

I get that most of you on here can just code for a good half-hour knowing how the app will respond then launch it, but for me, I do need to play around quite a bit and go back and forth between code and app.

Kindly let me know, I am curious to know more about the golem workflow.


Solution

  • I usually restart my app every 2 minutes using golem::run_dev(), which has always been working and display the changes. I suppose your issue here is with retyping the command every time?

    Are you aware of the RStudio addin that can be mapped to a keyboard shortcut?

    enter image description here

    enter image description here

    So here is my workflow:

    [Edit] The shift + R was just an example for the sake of clarity, I'm actually using Cmd + R / Cmd + D (Run Dev)