Skip to content

Commit 3b89f31

Browse files
authored
update to handlebars v5 (#1310)
* update to handlebars v5 * update test for different error message from code updated for handlebars 5 * update test for different error message from code updated for handlebars 5 * fix test compare
1 parent 1133f58 commit 3b89f31

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

josh-core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ bitvec = "1.0.1"
1515
git-version = "0.3.5"
1616
git2 = { workspace = true }
1717
glob = "0.3.1"
18-
handlebars = "4.4.0"
18+
handlebars = "5.1.1"
1919
hex = "0.4.3"
2020
indoc = "2.0.4"
2121
itertools = "0.11.0"

josh-core/src/query.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ impl handlebars::HelperDef for GraphQLHelper {
102102
_: &handlebars::Handlebars,
103103
_: &handlebars::Context,
104104
rc: &mut handlebars::RenderContext,
105-
) -> Result<handlebars::ScopedJson<'reg, 'rc>, handlebars::RenderError> {
105+
) -> Result<handlebars::ScopedJson<'rc>, handlebars::RenderError> {
106106
return Ok(handlebars::ScopedJson::Derived(
107107
self.josh_helper(
108108
h.hash(),
109109
rc.get_current_template_name().unwrap_or(&"/".to_owned()),
110110
)
111-
.map_err(|e| handlebars::RenderError::new(format!("{}", e)))?,
111+
.map_err(|e| handlebars::RenderErrorReason::Other(format!("{}", e)))?,
112112
));
113113
}
114114
}

tests/filter/graphql_hbs.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@
335335
- add file2
336336
- add file1
337337
$ josh-filter -q "render=sub1/tmpl_file_err&tmpl_param1=tmpl_param_value1&tmpl_p2=val2"
338-
ERROR: Error rendering "sub1/tmpl_file_err" line 1, col 14: Variable "tmpl_param12" not found in strict mode.
338+
ERROR: Error rendering "sub1/tmpl_file_err" line 1, col 14: Failed to access variable in strict mode Some("tmpl_param12")
339339
[1]
340340
$ josh-filter :/sub1 -q render=file2
341341
contents2

tests/proxy/query.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ Graphql works
7979
Failing render for lack of variable
8080
$ curl -i -s http://localhost:8002/real_repo.git?render=tmpl_file
8181
HTTP/1.1 422 Unprocessable Entity\r (esc)
82-
content-length: 100\r (esc)
82+
content-length: 112\r (esc)
8383
date: *\r (esc) (glob)
8484
\r (esc)
85-
JoshError(Error rendering "tmpl_file" line 1, col 8: Variable "param_val" not found in strict mode.) (no-eol)
85+
JoshError(Error rendering "tmpl_file" line 1, col 8: Failed to access variable in strict mode Some("param_val")) (no-eol)
8686

8787

8888

0 commit comments

Comments
 (0)