From 45b991f7d3f54c8b3b60d65fb87ef82872ab4035 Mon Sep 17 00:00:00 2001 From: Pranjal Raihan Date: Sun, 22 Dec 2024 23:49:13 -0800 Subject: [PATCH] Use whisker for html Summary: Whisker is a replacement for mustache and is largely backward compatible. It brings several quality of life improvements like... error checking. You can read more about the details [in this post](https://fb.workplace.com/groups/498666380550247/permalink/2051389461944590/). This diff moves `t_mstch_html_generator` to use whisker instead of mstch. This requires some changes to the templates to work around the bugs in mstch that have been previously worked around. #buildall Reviewed By: dtolnay Differential Revision: D67569371 fbshipit-source-id: adf9968a91ea8c24ce0d3c0deafba2e2bc66d341 --- .../src/thrift/compiler/generate/t_mstch_html_generator.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/third-party/thrift/src/thrift/compiler/generate/t_mstch_html_generator.cc b/third-party/thrift/src/thrift/compiler/generate/t_mstch_html_generator.cc index 491bc3afa62f0e..32a7ec919dc949 100644 --- a/third-party/thrift/src/thrift/compiler/generate/t_mstch_html_generator.cc +++ b/third-party/thrift/src/thrift/compiler/generate/t_mstch_html_generator.cc @@ -22,6 +22,12 @@ class t_mstch_html_generator : public t_mstch_generator { public: using t_mstch_generator::t_mstch_generator; + std::optional use_whisker() const override { + whisker_options opts; + opts.allowed_undefined_variables = {}; + return opts; + } + std::string template_prefix() const override { return "html"; } void generate_program() override {