Repository navigation
chore: bump minijinja from 2.24.0 to 3.0.0 - #4442
Conversation
Bumps [minijinja](https://github.com/mitsuhiko/minijinja) from 2.24.0 to 3.0.0. - [Release notes](https://github.com/mitsuhiko/minijinja/releases) - [Changelog](https://github.com/mitsuhiko/minijinja/blob/main/CHANGELOG.md) - [Commits](mitsuhiko/minijinja@minijinja-go/v2.24.0...minijinja-go/v3.0.0) --- updated-dependencies: - dependency-name: minijinja dependency-version: 3.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]>
worktrunk-bot
left a comment
There was a problem hiding this comment.
minijinja 3.0 removed or changed six APIs that worktrunk calls, so the bump doesn't compile, and each build, lint, and test job that has finished on this head failed on those errors. I'm pushing the migration to this branch:
Value::from_serialize→Value::from(Serde(..))for parsed JSON vars. Plain maps now useValue::from.Environment::set_keep_trailing_newline→ rebuild the env'sSyntaxConfigwithkeep_trailing_newline(true).machinery::parsedropped its whitespace-config argument.- The new
Expr::TupleAST variant gets a read-visiting arm inTemplateVars. Assignment targets still parse asList, sobounddetection is unchanged. The existing{% set a = 1, repo_root %}normalization test exercises the new arm. - 3.0 names the undefined expression in its error detail (
undefined value: `vars.missing` is undefined), sotest_undefined_namespace_values_do_not_name_unreached_typosnow pins the expected name for each template. Each case still names the expression actually reached, never the unreachedbrnchtypo.
A decision for a maintainer before merging: 3.0 also changes template semantics to match Jinja2, and those changes reach users' hook, alias, and prompt templates. Sequences and maps now render with Python-style quotes, tojson uses Jinja2 spacing, division by zero is an error, round rounds half to even, and // and % follow Jinja2 semantics. No template in this repo's docs or examples depends on these, and the integration suite produced no snapshot changes, but a user template that prints a list or relies on those operators renders differently after upgrading.
- Value::from_serialize -> Value::from(Serde(..)) / Value::from - set_keep_trailing_newline -> SyntaxConfig::to_builder().keep_trailing_newline(true) - machinery::parse dropped its whitespace-config argument - visit the new Expr::Tuple variant in TemplateVars - pin minijinja 3's undefined-value detail, which names the reached expression
MiniJinja names the undefined expression only when Environment::debug() is on, which defaults to debug_assertions, so the nix-flake check (a release build) saw the bare message.
|
Pushed the minijinja 3 migration (
So release builds keep today's |
worktrunk-bot
left a comment
There was a problem hiding this comment.
The minijinja 3 migration looks right. Its one gap is the debug/release branch in test_undefined_namespace_values_do_not_name_unreached_typos, and that branch is what keeps codecov/patch red (see the inline suggestion). I'm pushing that change to this branch. The template-semantics decision raised in the earlier review is still open for a maintainer.
The cfg!(debug_assertions) else arm only ran in release builds, leaving it uncovered in the debug coverage build.
|
@worktrunk-bot Please refresh this PR branch against current main, preserving your MiniJinja 3 migration commits, and bring in the Windows-only The outstanding maintainer decision on MiniJinja 3 template behavior remains pending.
|
…pendabot/cargo/minijinja-3.0.0
|
I merged current main into the branch as Compared with main, the PR's diff is still only the migration ( I also ran some focused checks locally. The decision on MiniJinja 3's Jinja2-aligned template behavior is still open for you. |
Since the minijinja 3 upgrade in #4442, `{{ vars.cfg }}` renders a JSON object or array var in Python style (`{'port': 3000}`) where v0.80.0 rendered JSON, and `{{ vars.cfg | tojson }}` fails with "unknown filter" because minijinja's `json` feature was off. Since #3129 removed JSON on hook stdin, templates are how hooks get structured values, so they had no way to pass one to `jq` or `curl -d`. This enables the `json` feature and documents `tojson` beside the vars dot-access example in `wt hook --help`. `tojson` writes `'`, `<`, `>` and `&` inside strings as `\u` escapes, which JSON parsers decode; the shell formatter still single-quotes the result, so `-d {{ vars.config | tojson }}` passes one argument. Two adjustments come with the feature. It makes minijinja choose JSON autoescaping from a template name ending in `.json`, `.js`, `.yaml` or `.yml`, as it already did HTML escaping for `.html`. Worktrunk's template names are config keys, so a custom column named `json` would have rendered JSON-quoted cells, and one named `html` already rendered HTML-escaped cells; the shared template environment now turns name-based autoescaping off. minijinja's `tojson` also writes an undefined value as `null`, so a wrapper rejects it the way printing does, and a mistyped `vars` key errors instead of sending `null`. Verified by rerunning the release-review repro against the branch binary: `{{ vars.cfg | tojson }}` now renders `{"list": [1, 2], "port": 3000}`, and a custom column named `json` or `html` renders the raw value. New coverage: a doc-template test for the documented `curl` example in POSIX mode, a missing-key `tojson` error case, and the custom-column test now uses a header named `json`. Each of the three fails with its part of the change reverted. Bare `{{ vars.cfg }}` still renders Python-style; `tojson` is the supported way to get JSON. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Bumps minijinja from 2.24.0 to 3.0.0.
Changelog
Sourced from minijinja's changelog.
... (truncated)
Commits
c1e7e23chore(release): 3.0.07a8f76bdocs(changelog): consolidate the 3.0.0 alpha entriesc123ab4docs: complete the MiniJinja 3 upgrade guide7a92676feat(playground): add an empty example1be8515feat(playground): add a console tab for logged messages85e5206fix(playground): replace empty configs with the default configde65258feat(playground): use commented out examples as default config2d95b1ffeat(playground): add config tab and preview mode toggle2e76f5efeat(playground): align colors with the MiniJinja logo3982db0fix(ci): exclude minijinja-js from MSRV buildsDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)