Skip to content

Allow serializers to return hooks and a serializer function. Port all image serializers to use new functionality - #630

Merged
schloerke merged 23 commits into
masterfrom
register_device
Aug 6, 2020
Merged

schloerke merged 23 commits into
masterfrom
register_device

Conversation

@schloerke

@schloerke schloerke commented Aug 4, 2020 •

Copy link
Copy Markdown
Collaborator

Now users will be able to register their own image serializers that require preexec and postexec hooks.

  • Added png, jpeg, svg, tiff, bmp, and pdf for the default set.
  • (Also added a tsv serializer)
  • Moved content type to top level argument to allow routes to set the content type of the serializer

No more need to hand coding all of the image serializers and custom searching.

PR task list:

  • Update NEWS
  • Add tests
  • Update documentation with devtools::document()
  • Update vignettes

* serializer_{jpeg, png, bmp, tiff, svg, pdf}()
* Allow serializers to return hooks and a serializer with `hooks_and_serializer()`
* Endpoints and filters now handle serializer output from `hooks_and_serializer()`
@schloerke
schloerke marked this pull request as draft August 4, 2020 17:17
@schloerke
schloerke marked this pull request as ready for review August 4, 2020 18:59
@schloerke
schloerke requested a review from cpsievert August 4, 2020 18:59
@schloerke schloerke added this to the v1.0.0 - Next CRAN release milestone Aug 4, 2020
Comment thread tests/testthat/files/device.R
Comment thread R/serializer.R Outdated
Comment thread R/serializer.R
Comment thread R/serializer.R Outdated
Comment thread R/serializer.R Outdated
Comment thread R/serializer.R Outdated
Comment thread R/serializer.R Outdated
Comment thread R/serializer.R Outdated
Comment thread R/serializer.R
Comment thread R/serializer.R
Comment thread R/serializer.R Outdated
Comment thread R/serializer.R Outdated
Comment thread R/serializer.R Outdated
Comment thread R/serializer.R Outdated
Comment thread R/serializer.R Outdated
Comment thread R/serializer.R
Comment thread R/plumber-step.R Outdated
Comment thread R/globals.R Outdated
Comment thread R/plumb-block.R Outdated
Comment thread NEWS.md
@cpsievert
cpsievert self-requested a review August 5, 2020 19:02

@cpsievert cpsievert left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with suggestions

Comment thread R/plumber-step.R Outdated
schloerke and others added 10 commits August 5, 2020 15:25
Co-authored-by: Carson Sievert <cpsievert1@gmail.com>
Co-authored-by: Carson Sievert <cpsievert1@gmail.com>
https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types

> For example, for any MIME type whose main type is text, the optional charset parameter can be used to specify the character set used for the characters in the data.

Co-authored-by: Carson Sievert <cpsievert1@gmail.com>
@schloerke
schloerke merged commit c7ce15a into master Aug 6, 2020
@schloerke
schloerke deleted the register_device branch August 6, 2020 17:07
schloerke added a commit that referenced this pull request Aug 7, 2020
* master:
  Add `plumb_api()` and `available_apis()` (#631)
  Allow serializers to return hooks and a serializer function. Port all image serializers to use new functionality (#630)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants