New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Freemarker and support multiple extensions for views (#2196) #2213

Merged
merged 3 commits into from Nov 19, 2017

Conversation

Projects
None yet
3 participants
@FredDeschenes
Contributor

FredDeschenes commented Nov 16, 2017

Fixes #2196 but breaks compatibility for external ViewRenderers (although it's a simple fix) and configuration files (also simple to change).

  • Updated Freemarker to 2.3.27
  • Renamed ViewRenderer::getSuffix to getConfigurationKey
  • Changed configuration keys in yaml/json file:
    • .ftl -> freemarker
    • .mustache -> mustache
  • Use regexes to match renderable templates in ViewRenderers (Freemarker's .ftlh/.ftlx extensions can now be used, as well as .ftl.html and similar paths)

FredDeschenes added some commits Nov 16, 2017

Update Freemarker to 2.3.27-incubating
'-incubating' is just because it's now an incubating Apache project and
has nothing to do with the stability of the version.
Renamed `ViewRenderer::getSuffix` to `getConfigurationKey`
This will remove ambiguity when multiple file formats for the same
renderer type are implemented (ex: Freemarker supports .ftl as well as
.fltx and .flth).

Keys in the views configuration are now `freemarker` instead of `.ftl`
and `mustache` instead of `.mustache`.
Use regexes to match view renderers
This allows us to match any valid Freemarker extension (.ftl, .ftlx, or
.ftlh) as well as matching "double extension" (ex: .ftl.html).

@dropwizard dropwizard deleted a comment from coveralls Nov 17, 2017

@arteam arteam merged commit 7f7b855 into dropwizard:master Nov 19, 2017

4 of 5 checks passed

coverage/coveralls Coverage decreased (-0.02%) to 87.151%
Details
ci/circleci Your tests passed on CircleCI!
Details
codeclimate All good!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@arteam

This comment has been minimized.

Member

arteam commented Nov 19, 2017

Thank you!

@arteam arteam added this to the 1.3.0 milestone Nov 19, 2017

@arteam arteam added the improvement label Nov 19, 2017

@ddekany

This comment has been minimized.

ddekany commented Nov 19, 2017

I hope you plan to update to FreeMarker 2.3.27 in the backward-compatible branch as well.

@arteam

This comment has been minimized.

Member

arteam commented Nov 20, 2017

Applied to the 1.2.1 branch: 71ff55d

sankate pushed a commit to sankate/dropwizard that referenced this pull request Nov 21, 2017

Update Freemarker and support multiple extensions for views (dropwiza…
…rd#2196) (dropwizard#2213)

* Update Freemarker to 2.3.27-incubating

'-incubating' is just because it's now an incubating Apache project and
has nothing to do with the stability of the version.

* Renamed `ViewRenderer::getSuffix` to `getConfigurationKey`

This will remove ambiguity when multiple file formats for the same
renderer type are implemented (ex: Freemarker supports .ftl as well as
.fltx and .flth).

Keys in the views configuration are now `freemarker` instead of `.ftl`
and `mustache` instead of `.mustache`.

* Use regexes to match view renderers

This allows us to match any valid Freemarker extension (.ftl, .ftlx, or
.ftlh) as well as matching "double extension" (ex: .ftl.html).

@FredDeschenes FredDeschenes deleted the FredDeschenes:issue-2196 branch Nov 24, 2017

aaanders added a commit to aaanders/dropwizard that referenced this pull request Sep 20, 2018

Update Freemarker and support multiple extensions for views (dropwiza…
…rd#2196) (dropwizard#2213)

* Update Freemarker to 2.3.27-incubating

'-incubating' is just because it's now an incubating Apache project and
has nothing to do with the stability of the version.

* Renamed `ViewRenderer::getSuffix` to `getConfigurationKey`

This will remove ambiguity when multiple file formats for the same
renderer type are implemented (ex: Freemarker supports .ftl as well as
.fltx and .flth).

Keys in the views configuration are now `freemarker` instead of `.ftl`
and `mustache` instead of `.mustache`.

* Use regexes to match view renderers

This allows us to match any valid Freemarker extension (.ftl, .ftlx, or
.ftlh) as well as matching "double extension" (ex: .ftl.html).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment