Subject: [bug#42106] [PATCH 1/4] gnu: Add r-r2d3.

From: Ricardo Wurmus <[email-masked]>
Date: Mon, 30 Aug 2021 16:03:22 +0200

Ricardo Wurmus <[email-masked]> writes:

> Hi Peter,
>
>> * gnu/packages/cran.scm (r-r2d3): New variable.
>
> Unfortunately, I cannot merge this as is.  This package contains 
> a bunch
> of minified JavaScript files without the corresponding source 
> code:
>
> --8<---------------cut 
> here---------------start------------->8---
> r2d3/inst/www/d3/4.13.0/d3.min.js
> r2d3/inst/www/d3/3.5.17/d3.min.js
> r2d3/inst/www/d3/5.0.0/d3.min.js
> r2d3/inst/htmlwidgets/lib/webcomponents/webcomponents.js
> --8<---------------cut 
> here---------------end--------------->8---
>
> While we can easily replace the different d3 versions with 
> non-minified
> source code that we then minify in a build phase, we cannot do 
> this for
> webcomponents.js, which is compiled from TypeScript.  The source 
> code is
> here:
>
>     https://github.com/webcomponents/polyfills/tree/master/packages/webcomponentsjs

webcomponents.js looks very similar to this blob:

https://github.com/webcomponents/webcomponentsjs/blob/v2.0.1/webcomponents-bundle.js

> Arun is currently working on packaging swc, a transpiler that 
> supports
> TypeScript, so with some luck we might then be able to transpile 
> these
> TypeScript source files to webcomponents.js.

It’s a bit more complicated than that.  The source files import 
code from files in node_modules, which is supposed to be 
downloaded with npm.  If we can identify these actual source files 
we could include them explicitly.

-- 
Ricardo