Conversation
- 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
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
WalkthroughThe pull request updates the version of the 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|



Summary
Wave 3 of the TryGhost/Framework monorepo catch-up (Waves 1 and 2: #27514, #27517). Single package.
@tryghost/tplSplit out from the other leaf utilities because the upstream rewrite swaps the
lodash.templatebackend for a nativeString#replace, which is a meaningfully different execution path.Behaviour comparison
lodash.template)String#replace)tpl('Hi {name}', {name: 'x'})"Hi x""Hi x"tpl('Hi {name}', {})missing keyReferenceError: name is not defined(viawith())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-bracetpl('\\\\{\\\\{{h}}\\\\}\\\\}', {h:'get'})escaping"{{get}}""{{get}}"tpl('Hi {user.name}', {user:{name:'x'}})nested access"Hi x"ReferenceError: user.name is not definedtpl('Hi {name}', {name: null})"Hi ""Hi null"Bare minimum: if any code path feeds
null/undefinedinto atplcall, 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— cleancd ghost/core && pnpm test:unit— 6121 passingcd ghost/core && pnpm test:integration— 242 passingcd ghost/core && pnpm test:e2e— 1569 passingcd ghost/core && pnpm test:legacy— 451 passingcd ghost/core && pnpm lint— clean@tryghost/tplis only pinned inghost/core, so no app version bumps required