Skip to content

v1.0.0

Latest

Choose a tag to compare

@ColinFay ColinFay released this 15 Sep 16:01
· 3 commits to main since this release

brochure 1.0.0

First tagged release. {brochure} has been installable from GitHub since 2020;
this is the point where the API is stable enough to be pinned.

Routing is rewritten on top of {routr},
which brings parameterised routes and per-method pages, and fixes a family of
bugs that came from keeping the current page in shared state.

Highlights

  • Parameterised routes, read with get_keys() — with no argument inside a
    page server, and get_keys(request) inside a page ui.
  • Per-method pages: page() and redirect() take a method, so a page can
    answer on something other than GET.
  • Request and response middleware actually run. req_handlers and
    res_handlers passed to page() were stored and never called, which made the
    documented /healthcheck endpoint and the per-page cookies of the README
    silent no-ops.
  • Deployment behind a prefix works, whether the proxy strips the mount
    (Posit Connect, nginx with a trailing slash) or passes it through (ShinyProxy,
    proxy_pass without one). basepath is now removed from the incoming path,
    as documented, and not only prepended to the urls the app emits.
  • Cookies are safer by default: set_cookie() defaults to
    http_only = TRUE and same_site = "Lax", remove_cookie() takes path and
    domain, and everything interpolated into a header or a Location is
    validated.
  • Seven vignettes and a pkgdown site — getting started, handlers, cookies,
    design, deployment, testing, and building a brochure app as a {golem}
    package.

The bug worth calling out

Two people browsing two different pages of the same app could each run the
other's server. The matched page was kept in a single per-app environment,
written by the http handler and read back when the websocket opened. The page is
now resolved per request in the ui, and per session in the server.

Breaking changes

  • keys is gone — use get_keys(). The old object was installed in the global
    environment, shadowed any user object of that name, and was invisible from a
    module, a golem app or any local().
  • set_cookie() defaults changed (see above); pass http_only = FALSE or
    same_site = NULL for the previous header.
  • set_cookie(), remove_cookie() and server_redirect() reject values they
    used to interpolate as is.
  • ... in brochureApp() no longer accepts anything: pages, redirects, tags,
    tag lists, html dependencies and strings only. A bare list of pages is now
    spliced instead of being injected into every page.

Installation

remotes::install_github("ColinFay/brochure@v1.0.0")

Full changelog: NEWS.md

What's Changed

New Contributors

Full Changelog: https://github.com/ColinFay/brochure/commits/v1.0.0