Re: [R-pkg-devel] Package with JS dependency

2025-02-24 Thread Viechtbauer, Wolfgang (NP)
Like Duncan's rgl package, the mathjaxr package 
(https://cran.r-project.org/package=mathjaxr) also contains JS code (for 
MathJax). And one of the requirements to get the package onto CRAN was that the 
source package had to contain the unminified javascript files. The minification 
then happens during the installation process with the help of the 'js' package 
(using the lovely named uglify_files() function). So if you want to get the 
package on CRAN, I suspect you would have to go a similar route.

Best,
Wolfgang

> -Original Message-
> From: R-package-devel  On Behalf Of
> Michael Chirico
> Sent: Saturday, February 22, 2025 17:30
> To: Jon Harmon 
> Cc: R Package Development 
> Subject: Re: [R-pkg-devel] Package with JS dependency
>
> Ah, thanks for looking into it further, I was a but surprised myself.
> Apologies for the misstatement & added noise.
>
> Could be that GitHub just doesn't index the potentially huge files, I've
> come across that with my r-mailing-list-archive repo.
>
> On Sat, Feb 22, 2025, 8:20 AM Jon Harmon  wrote:
>
> > There are definitely packages with minified JS. I suspect this GitHub
> > search policy is causing the empty search: "Vendored and generated code is
> > excluded"
> >
> > Even with "is:generated" and/or "is:vendored", I can't get a search to find
> > this, for example:
> >
> https://github.com/cran/cookies/blob/eb72bda92734d7537061e008191c2041dbe49dff/in
> st/js/js.cookie.min.js
> >
> > On  Fri, 21 Feb 2025 09:06 AM Michael Chirico 
> > wrote:
> >
> > > You might have a look at those. To Duncan's point, note there are also
> > > 0 min.js files:
> > >
> > https://github.com/search?q=org%3Acran+path%3Amin.js+-
> path%3ALICENSE.txt&type=code
__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Package with JS dependency

2025-02-24 Thread Dirk Eddelbuettel


On 24 February 2025 at 22:08, Viechtbauer, Wolfgang (NP) wrote:
| Like Duncan's rgl package, the mathjaxr package 
(https://cran.r-project.org/package=mathjaxr) also contains JS code (for 
MathJax). And one of the requirements to get the package onto CRAN was that the 
source package had to contain the unminified javascript files. The minification 
then happens during the installation process with the help of the 'js' package 
(using the lovely named uglify_files() function). So if you want to get the 
package on CRAN, I suspect you would have to go a similar route.

It is not only CRAN who may require it but _other downstream uses_ might too:
I maintain (among other packages) rgl and mathjaxr for Debian, and Debian
requires 'un-minified' sources (for the usual reasons of being able to make
changes to open source code) so the compromise of 'un-minified in source,
possibly minified in installed package' is something that seems to work for
everybody.

Cheers, Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel