Provide string interpolation support for async/dynamic dep attributes in R#1048
Provide string interpolation support for async/dynamic dep attributes in R#1048
Conversation
🔪 commented out line 🙈 fix case errors and parens 🙈 move async/dynamic to correct pos
| function_frame_body = ",\n".join(function_frame) | ||
| elif len(alldist) == 1: | ||
| rpp = alldist[0]["relative_package_path"] | ||
| dep = alldist[0] |
There was a problem hiding this comment.
Not part of this change, but I'm having trouble understanding why we process an array of length one differently from an array of length N
There was a problem hiding this comment.
The code doesn't really make much sense as written, but that's because I had trouble getting it to work with enumerate when I wrote it a year ago. I had only been programming in Python for a week or two, so this code is pretty much a giant pile of 💩. It needs some love and refactoring, no disagreement there.
| # then return the properly formatted string if so, i.e. | ||
| # " async = TRUE,". a dependency can have async or | ||
| # dynamic elements, neither of these, but never both. | ||
| def check_async_type(dep): |
There was a problem hiding this comment.
Would suggest renaming to get_** instead as this doesn't check but rather returns some specific value to use as-is
package-lock.json
Outdated
| @@ -0,0 +1,14115 @@ | |||
| { | |||
There was a problem hiding this comment.
This looks like 🔪 - there's no corresponding package.json file.
| "R package.", | ||
| file=sys.stderr, | ||
| ) | ||
| sys.exit(1) |
There was a problem hiding this comment.
As discussed on slack: javascript docstrings should NOT contain escapes for % characters, that would look weird in JS (and in Python). So the right way to handle this is to automatically insert the escapes when translating from JS to R.
|
The tests failures we are seeing here are caused by a regression from the dcc.Graph responsiveness -- not related to this PR (https://circleci.com/gh/plotly/dash/13778#tests/containers/1) |
Marc-Andre-Rivet
left a comment
There was a problem hiding this comment.
Failures are coming from a regression in DCC. This looks fine. 💃
|
I'm going to add one last feature here -- to scrub examples from docstrings in packages such as DDK when generating the R packages, will relocate them to |
fixed in b471d35 |
* ✨ async/dynamic support in R pkg deps * 🔪 remove Authors block * 🔪 insert package version number * 🔨 use verbose 📦 title and desc from YAML * ✨ autodetect vignettes * check for author/maintainer address * ✋ halt processing if fatal errors found * autopopulate KeepSource * auto-escape % in docstrings * 🔪 filter examples from docstrings in R
This PR proposes to add support for generating
asyncordynamicattributes within the JavaScript metadata Dash for R uses to manage dependencies.Additionally, improvements to the package generator have been introduced:
dash-info.yamlfirst, and then from information inpackage.jsonwhen it is unavailable or the relevant keys are missing.js,.map,.css) are now properly generated to match versioning within the library of originvignettesdirectory is present, the generator will add aVignetteBuilderentry toDESCRIPTIONand appendknitr, rmarkdownto theSuggestsfield, but it will not build the vignettes itself (that requires runningR CMD buildand is out of scope at this time)**Example Usage**will now be filtered out of the R help pagesKeepSourceis set to true in generated R packages, to facilitate line numbering in stack traces%within docstrings will silently and automatically be escaped when generating.Rdfiles within R packages, as these are comment characters in R help files and will break package installationCloses #1002. Fixes plotly/dash-core#69, resolves plotly/dash-core#71.