Skip to content
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 to handlebars v5 #1310

Merged
merged 4 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion josh-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ bitvec = "1.0.1"
git-version = "0.3.5"
git2 = { workspace = true }
glob = "0.3.1"
handlebars = "4.4.0"
handlebars = "5.1.1"
hex = "0.4.3"
indoc = "2.0.4"
itertools = "0.11.0"
Expand Down
4 changes: 2 additions & 2 deletions josh-core/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ impl handlebars::HelperDef for GraphQLHelper {
_: &handlebars::Handlebars,
_: &handlebars::Context,
rc: &mut handlebars::RenderContext,
) -> Result<handlebars::ScopedJson<'reg, 'rc>, handlebars::RenderError> {
) -> Result<handlebars::ScopedJson<'rc>, handlebars::RenderError> {
return Ok(handlebars::ScopedJson::Derived(
self.josh_helper(
h.hash(),
rc.get_current_template_name().unwrap_or(&"/".to_owned()),
)
.map_err(|e| handlebars::RenderError::new(format!("{}", e)))?,
.map_err(|e| handlebars::RenderErrorReason::Other(format!("{}", e)))?,
));
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/filter/graphql_hbs.t
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@
- add file2
- add file1
$ josh-filter -q "render=sub1/tmpl_file_err&tmpl_param1=tmpl_param_value1&tmpl_p2=val2"
ERROR: Error rendering "sub1/tmpl_file_err" line 1, col 14: Variable "tmpl_param12" not found in strict mode.
ERROR: Error rendering "sub1/tmpl_file_err" line 1, col 14: Failed to access variable in strict mode Some("tmpl_param12")
[1]
$ josh-filter :/sub1 -q render=file2
contents2
4 changes: 2 additions & 2 deletions tests/proxy/query.t
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ Graphql works
Failing render for lack of variable
$ curl -i -s http://localhost:8002/real_repo.git?render=tmpl_file
HTTP/1.1 422 Unprocessable Entity\r (esc)
content-length: 100\r (esc)
content-length: 112\r (esc)
date: *\r (esc) (glob)
\r (esc)
JoshError(Error rendering "tmpl_file" line 1, col 8: Variable "param_val" not found in strict mode.) (no-eol)
JoshError(Error rendering "tmpl_file" line 1, col 8: Failed to access variable in strict mode Some("param_val")) (no-eol)



Expand Down
Loading