JohnCoene / javascript-for-r-comments

1 stars 0 forks source link

Chapter 6: Dependencies #11

Open MayaGans opened 3 years ago

MayaGans commented 3 years ago

To really make sure I'm getting this, I'm following along with the chapter and also attempting to make my own widget, with its own dependencies - this is so great!

File to download and name

I kind of just guessed in my d3 example what to put here:

dir.create("./inst/htmlwidgets/d3", recursive = TRUE)
d3 <- paste0("https://d3js.org/d3.v6.js") 
download.file(d3, "./inst/htmlwidgets/d3/d3.min.js")

It might be helpful after the example to generalize a bit and comment on where you found the link to download piety (maybe from the readme?) and you'll always be saving to .min.js

*[...is that even true? If not how do you choose how to name this file? Is it best practice to download the minified js?]

YAML

The name, src, and script we get from the files we created, but it might be helpful to say where you got the version info from too [For instance I looked in the package-lock.json to find the most recent version... is that how you do it?]

  - name: peity
    version: 3.3.0
    src: htmlwidgets/peity
    script: jquery.peity.min.js
MayaGans commented 3 years ago

@JohnCoene I think your comment on issue #9 is hinting to this!

JohnCoene commented 3 years ago

Oh my 😱 !! Thank you so much for all the time and dedication! These are precisely the kind of things I was bound to miss.

I will definitely add a section on that!