Skip to content

chore: upgrade remark-hbs to 0.5.0 - #219

Merged
josemarluedke merged 1 commit into
mainfrom
chore/remark-hbs-0.5
Aug 21, 2026
Merged

chore: upgrade remark-hbs to 0.5.0#219
josemarluedke merged 1 commit into
mainfrom
chore/remark-hbs-0.5

Conversation

@josemarluedke

Copy link
Copy Markdown
Owner

Picks up remark-hbs 0.5.0, the ESM/unified 11 release. This removes the last stale link in Docfy's markdown pipeline — 0.4.1 was from 2021 and carried its own unist-util-visit 2 and unist-builder 2 alongside a tree running unified 11. 0.5.0 has unist-util-visit 5 as its only runtime dependency and takes unified 11 as a peer.

No source changes needed

All three call sites already import the package root, which is all the new exports map permits:

packages/ember-cli/src/get-config.ts:4   import remarkHbs from 'remark-hbs';
packages/ember-cli/src/get-config.ts:9   import type { RemarkHbsOptions } from 'remark-hbs';
packages/ember-vite/src/config.ts:195    const remarkHbs = (await import('remark-hbs')).default;

The option names Docfy sets (escapeCurliesCode, escapeCurliesInlineCode) are unchanged, and RemarkHbsOptions is still importable — now as a named export rather than off a namespace, which is what the existing import type already expected.

Things I checked rather than assumed

The CJS interop path works. @docfy/ember-cli compiles to CommonJS, so it does require('remark-hbs').default against an ESM-only package. The release notes say that works; confirmed:

keys: [ '__esModule', 'default' ] | typeof default: function

Worth recording how that nearly misled me: my first run returned keys: [] | typeof default: undefined, which looks exactly like broken interop. It was stale node_modules left by a baseline experiment I'd run minutes earlier — Object.keys() of 0.4.1's CJS function export. Reinstalling fixed it and the symlink now points at remark-hbs@0.5.0_unified@11.0.5. Had I trusted the first result I'd have filed a bug against a working package.

The new unified peer needs no declaration. @docfy/ember-cli and @docfy/ember-vite depend on remark-hbs without depending on unified directly, so I expected an unmet peer. pnpm satisfies it through @docfy/core, and pnpm peers check reports only the two pre-existing unrelated issues (ember-source via ember-cli-fastboot-testing, tailwindcss via @tailwindcss/typography).

Rendered output is unchanged — verified, not trusted. The release notes claim this, which is exactly the sort of claim worth testing independently. The committed .gjs templates are regenerated from docs/ on every build, so if remark-hbs altered a single character they would move. They come out byte-identical: the templates guard passes with no diff.

That check is only usable from a worktree thanks to #218, which landed first.

Verification

  • pnpm -r run compile clean
  • @docfy/core 59/59 across 12 files, @docfy/ember-vite 60/60, @docfy/plugin-with-prose 2/2
  • test-app-classic builds (the CJS/require-ESM path) with 19 distinct hljs-* classes including hljs-template-variable, so glimmer highlighting and curly escaping still work end to end
  • test-app-vite builds; routes guard passes; templates guard passes with zero diff
  • lint and lint:format clean

Follow-up worth considering

remark-hbs declares engines of ^20.19.0 || >=22.12.0 while Docfy now requires >=22.22.2, and its CI matrix tests Node 20/22/24. That's harmless — Docfy's range is a subset — but if remark-hbs is only ever consumed by Docfy, its floor could eventually be raised to match.

🤖 Generated with Claude Code

remark-hbs 0.5.0 is the ESM/unified 11 release, which removes the last stale
link in Docfy's markdown pipeline: 0.4.1 was from 2021 and carried its own
unist-util-visit 2 and unist-builder 2. 0.5.0 has unist-util-visit 5 as its only
runtime dependency and takes unified 11 as a peer.

No source changes were needed. All three call sites already import the package
root, which is all the new exports map allows, and the compiled CJS
`require('remark-hbs').default` path that @docfy/ember-cli relies on works
because the package ships a default export — verified directly rather than
assumed. The option names Docfy sets (escapeCurliesCode,
escapeCurliesInlineCode) are unchanged.

The new `unified` peer dependency needs no declaration in @docfy/ember-cli or
@docfy/ember-vite: pnpm satisfies it through @docfy/core, and `pnpm peers check`
reports only the two pre-existing unrelated issues (ember-source via
ember-cli-fastboot-testing, tailwindcss via @tailwindcss/typography).

The release notes claim rendered output is unchanged. That is verified here
independently rather than taken on trust: the committed .gjs templates are
regenerated from docs/ on every build, and they come out byte-identical, so the
templates guard passes with no diff at all.

Stacked on the worktree edit-URL fix, which is what makes that guard usable as
evidence from a worktree.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@josemarluedke josemarluedke added the dependencies Pull requests that update a dependency file label Aug 21, 2026
@josemarluedke
josemarluedke merged commit 6c18ac4 into main Aug 21, 2026
9 checks passed
@josemarluedke
josemarluedke deleted the chore/remark-hbs-0.5 branch August 21, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant