Skip to content

Bumped @tryghost/tpl to 2.1.0#27520

Merged
9larsons merged 1 commit intomainfrom
bump-tryghost-tpl-v2
Apr 23, 2026
Merged

Bumped @tryghost/tpl to 2.1.0#27520
9larsons merged 1 commit intomainfrom
bump-tryghost-tpl-v2

Conversation

@9larsons
Copy link
Copy Markdown
Contributor

Summary

Wave 3 of the TryGhost/Framework monorepo catch-up (Waves 1 and 2: #27514, #27517). Single package.

Package From To
@tryghost/tpl 0.1.40 2.1.0

Split out from the other leaf utilities because the upstream rewrite swaps the lodash.template backend for a native String#replace, which is a meaningfully different execution path.

Behaviour comparison

Case Old (lodash.template) New (String#replace) Ghost risk
tpl('Hi {name}', {name: 'x'}) "Hi x" "Hi x"
tpl('Hi {name}', {}) missing key ReferenceError: name is not defined (via with()) ReferenceError: name is not defined (explicit check)
tpl('{{#get}} took {ms}', {ms: 5}) handlebars passthrough "{{#get}} took 5" "{{#get}} took 5"
tpl('{{{helperName}}}', {helperName:'get'}) triple-brace ignored ignored
tpl('\\\\{\\\\{{h}}\\\\}\\\\}', {h:'get'}) escaping "{{get}}" "{{get}}"
tpl('Hi {user.name}', {user:{name:'x'}}) nested access "Hi x" ReferenceError: user.name is not defined grep'd every callsite — Ghost doesn't use this
tpl('Hi {name}', {name: null}) "Hi " "Hi null" runtime-only, test suites catch regressions

Bare minimum: if any code path feeds null/undefined into a tpl call, the error message text changes. All four ghost/core suites still pass locally, so no such regression is exercised by the existing coverage.

Test plan

  • pnpm install — clean
  • cd ghost/core && pnpm test:unit — 6121 passing
  • cd ghost/core && pnpm test:integration — 242 passing
  • cd ghost/core && pnpm test:e2e — 1569 passing
  • cd ghost/core && pnpm test:legacy — 451 passing
  • cd ghost/core && pnpm lint — clean
  • @tryghost/tpl is only pinned in ghost/core, so no app version bumps required
  • CI green

- wave 3 of the @tryghost/framework catch-up (waves 1 and 2 merged in
  #27514 and #27517); split out from the other leaf utilities because
  upstream replaced the lodash.template backend with a native regex
  replace, which is a different enough execution path to warrant its
  own PR
- both implementations still throw ReferenceError for missing keys and
  preserve the same escape and {{handlebars}} passthrough behavior, so
  the only shape of breakage would be placeholders relying on
  expression evaluation (e.g. {user.name}, {arr[0]}); grepped every
  tpl callsite and no Ghost code uses nested or bracket accessors
- the remaining runtime difference is that null/undefined values now
  render as the strings "null"/"undefined" instead of "" — ghost/core
  test suites catch any regression there, and all of unit (6121),
  integration (242), e2e (1569), and legacy (451) are green locally
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0cf9d2b6-4af9-4295-a248-2ef033909806

📥 Commits

Reviewing files that changed from the base of the PR and between 48069dc and 7f0426a.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • ghost/core/package.json

Walkthrough

The pull request updates the version of the @tryghost/tpl template library dependency in the ghost/core/package.json file from 0.1.40 to 2.1.0. This represents a significant version update to the template library package used by the project. The change is isolated to the dependency declaration and does not modify any exported or public entities or implementation code.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Bumped @tryghost/tpl to 2.1.0' directly and clearly describes the main change—a dependency version bump of @tryghost/tpl from 0.1.40 to 2.1.0, which is confirmed by the raw summary and package.json modification.
Description check ✅ Passed The description is detailed and directly related to the changeset. It explains the dependency bump, behavioral differences between versions, test results, and risk assessment—all relevant to the @tryghost/tpl update.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bump-tryghost-tpl-v2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.95%. Comparing base (48069dc) to head (7f0426a).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #27520   +/-   ##
=======================================
  Coverage   72.95%   72.95%           
=======================================
  Files        1556     1556           
  Lines      125792   125792           
  Branches    15212    15212           
=======================================
  Hits        91777    91777           
  Misses      33055    33055           
  Partials      960      960           
Flag Coverage Δ
admin-tests 49.79% <ø> (ø)
e2e-tests 72.95% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@9larsons 9larsons merged commit 0c29d20 into main Apr 23, 2026
46 checks passed
@9larsons 9larsons deleted the bump-tryghost-tpl-v2 branch April 23, 2026 13:01
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.

1 participant