Skip to content

Releases: strazto/mandrake

mandrake 1.1.1 - Handle exceptions thrown by styler

22 Apr 06:42
63fff66
Compare
Choose a tag to compare

Mandrake 1.1.1

Fixes

Frontend Dependency Management

Fix dependency problems when using attach_dependencies(standalone = TRUE):

  • bootstrap
    • Fully embed entire bootstrap package, including all assets, not just css
    • Attach src from top level of bootstrap, so all assets are bundled.
  • jquery:
    • Fix missing package argument in jquery's htmlDependency()
      definition
  • attach jquery & bootstrap dependencies before other frontend dependencies,
    as other dependencies require jquery (especially) to be loaded already.
  • mustache templates:
    • Fix outdated refEREnce to template file test.html.mustache, which was deleted.
    • Now include display.html.mustache

Frontend

  • make embedHandler() backwards compatible with graphs generated by
    mandrake<1.1.0
    • In mandrake<1.1.0, R generated html directly and this was passed to
      visNetwork to be rendered directly
    • In mandrake>=1.1.0, R encodes the data into json & passes this object
      to visNetwork, which can be decoded & flexibly rendered by the frontend.
    • Now, embedHandler() tries to parse the input as json, then rendering it
      into a template, but if JSON.parse raises a syntax error, the input will be
      given directly to the DOM
  • (Everything to be given to the DOM is still cleaned by DOMPurify)

Backend

  • When styling code from plan commands, now wrap styler::style_text() in try block
  • That way, if code that can't be parsed by styler (eg, contains a pretty printed quosure),
    it won't crash the workflow

Misc

  • Remove "Remotes" section from DESCRIPTION, change a few dependency packages from github/development head to
    CRAN