{golem} 0.4.0 is now available

[This article was first published on Rtask, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

You can read the original post in its original format on Rtask website by ThinkR here: {golem} 0.4.0 is now available

The new version of {golem} is available!

Read the complete version of this article at https://golemverse.org/post/golem-0.4.0-release-on-cran/

What’s up with this new version?

Lighter dependency tree

When we release the first version of {golem} on CRAN, we made the decision that all {golem}-based app should depend on {golem}. This was a conscious decision ,and we made it because {golem} comes with a bunch of internal functions that are used at runtime.

For example bundle_resources() links all the external resources (CSS, JS, …), is_running(), detecting that the current app is a {golem} app, with_golem_options() allows passing arguments to your run_app() functions, and others. We were very aware that this choice came with a drawback: adding a dependency to every {golem}-based app.

Dependency management is a big topic in the software engineering world, and some projects tend to go for minimizing as much as possible the number of dependencies.

They are right (to a certain extent): more dependencies means that you can be subject to some troubles, notably if one of the package you’re relying on gets removed from the CRAN.

Even in a contained world where you have your own CRAN-like repository, there is always the drawback of installation time: the more dependencies you have, the longer it takes to install the package, and by consequence to compile a Docker image, for example. This is why we could have been tempted to imagine a different approach for {golem}: creating files inside your project that would contain everything you need. But I think that this approach can be more dangerous and is not “complete” for reasons developped on the blogpost on the golemverse website.

{golem} has two types of dependencies: dev dependencies (the packages you’re using when developing with {golem}) and the runtime dependencies (the ones used when the application runs). In version 0.3.3 of {golem}, we started removing dev dependencies. The first to go was {dockerfiler}, and now with 0.4.0 we have moved all the dev dependencies to the Suggests section of the DESCRIPTION. What that means is that if you’re using {golem} in a fresh R distribution, the dependency tree is way lighter. 65 dependencies for 0.3.5, and 37 for 0.4.0.

Maintenance mode

One new feature I’m particularly excited about is the “Maintenance mode” option.

This feature was born out of a specific need: in production, I needed to make an application go “offline”, as I knew the db was about to migrate. That implied doing some weird changes in the UI for a short period of time, before putting the app back.

That’s when the idea of a “Maintenance mode” was born, for the times when you need your application to be unavailable: database update, API changes, etc. When this maintenance mode is turned on, your application will be paused and a specific page will be displayed to your users. And the cool thing is that it’s just an environment variable away: you don’t need to change anything in your app.

The maintenance mode will be turned on whenever the R process detects that the GOLEM_MAINTENANCE_ACTIVE environment variable is set to TRUE.

Read more at https://golemverse.org/post/golem-0.4.0-release-on-cran/

 

Header via https://commons.wikimedia.org/wiki/File:Praha,_Werichova_vila,_Golem.jpg

This post is better presented on its original ThinkR website here: {golem} 0.4.0 is now available

To leave a comment for the author, please follow the link and comment on their blog: Rtask.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)