Skip to content

Conversation

@twpayne
Copy link
Owner

@twpayne twpayne commented Dec 7, 2025

Refs #2668.

This should be fully backwards-compatible.

Draft for now.

@marmitar
Copy link

marmitar commented Dec 8, 2025

I decided to test it and the biggest change I felt is with dig. In sprig you had dig ...PATH DEFAULT DICT and DEFAULT was required, but in sprout it's dig ...PATH DICT which returns nil if missing.

I think sprout's implementation is more natural, since I actually have forgotten about the default quite a few times before, writing something like dig ...PATH DICT | default DEFAULT. Anyway, just wanted to let you know about this change.

@twpayne
Copy link
Owner Author

twpayne commented Dec 8, 2025

Thank you very much for the testing! This PR needs more work, specifically:

  • Currently this PR uses sprout's sprigin package, which should provide 100% compatibility with sprig. Therefore, there should be no change to the documentation in this PR.
  • To migrate to sprout properly, users should be able to switch from sprig to sprout in their templates at their own pace. I'm not sure if this should be configured globally or on a per-file basis.

I'll update the PR to migrate to sprigin internally, which should have no user-visible changes.

@twpayne twpayne changed the title feat: Switch to sprout for template functions chore: Switch to sprout for template function implementation Dec 8, 2025
@twpayne twpayne changed the title chore: Switch to sprout for template function implementation chore: Switch to github.com/go-sprout/sprout for internal tools Dec 9, 2025
@twpayne twpayne marked this pull request as ready for review December 9, 2025 00:57
@twpayne twpayne merged commit ba620a3 into master Dec 9, 2025
26 checks passed
@twpayne twpayne deleted the sprout branch December 9, 2025 00:57
@twpayne
Copy link
Owner Author

twpayne commented Dec 9, 2025

Thanks again for the testing. This PR now only touches internal tools and adds some tests for sprig's behavior. Actually migrating to sprout will require more work, as described in #2668 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants