leaflet.extras icon indicating copy to clipboard operation
leaflet.extras copied to clipboard

Is it possible to modularize the package dependencies?

Open dracodoc opened this issue 6 years ago • 1 comments

In installing the github version of package, I saw the size of zip is 24M. There are a lot of plugins supported in the package, but user probably will not use all of them.

One method I can think of is to only install the core files (install_github function will download the whole repo, so we will need to move the dependency lib to another repo), then user can enable plugins by something like this

# extra_plugins is a list of available plugins, defined in package
extra_plugins <- list(heat = "heat", pulse_icon = "pulse_icon", ...)
# user can use the autocomplete of rstudio so he/she don't need to remember/copy the exact name
enable_plugins(c(extra_plugins$heat, extra_plugins$pulse_icon))
# then this function should download the relevant libs from the dependency repo
# of course it's possible to just enable all if user don't mind
enable_plugins(extra_plugins)  # we can convert the list to vector in enable_plugins

It's also possible to create a rstudio addon to download them in a shiny gadget UI. I can help to create the addon when the functions are available. I didn't try to create a PR by myself because I'm not sure if you want this dramatic change.

dracodoc avatar Oct 24 '17 21:10 dracodoc

It's not the plugins themselves but rather the example folder. I will move them to a diff. branch so as to reduce the main branch size. Thanks!

bhaskarvk avatar Nov 06 '17 13:11 bhaskarvk