Skip to content

Conversation

@mmenanno
Copy link
Contributor

@mmenanno mmenanno commented Dec 19, 2025

Important

Holding this PR in draft for now as Ruby should be about to release 4.0 and I'll update this PR to use that once it is out

Summary

Upgrades Ruby and dependencies to address upcoming EOL and resolve build issues with modern Ruby versions.

Changes

Ruby & Bundler

Gem Updates

  • Haml: Upgraded to 7.1 (the monkey patch issue that previously blocked this has been resolved)
  • General: Updated all gems to latest compatible versions

Build Fixes

Sass Deprecation

  • Replaced deprecated sass gem with sassc
  • Ruby Sass has reached end-of-life and should no longer be used
SCR-20251219-jncx

Markdown Renderer

Replaced Redcarpet with Kramdown to fix undefined method 'link_to' for nil error. This is a known Middleman issue with Ruby 3.x where the Redcarpet renderer context is nil.

Config changes:

# Before (Redcarpet)
set :markdown_engine, :redcarpet
set :markdown,
    fenced_code_blocks: true,
    smartypants: true,
    disable_indented_code_blocks: true,
    prettify: true,
    strikethrough: true,
    tables: true,
    with_toc_data: true,
    no_intra_emphasis: true,
    renderer: UniqueHeadCounter

# After (Kramdown)
set :markdown_engine, :kramdown
set :markdown,
    input: 'GFM',
    auto_ids: true,
    hard_wrap: false,
    smart_quotes: ['lsquo', 'rsquo', 'ldquo', 'rdquo'],
    syntax_highlighter: :rouge,
    syntax_highlighter_opts: { guess_lang: true }
Redcarpet Feature Kramdown Equivalent
fenced_code_blocks, tables, strikethrough, no_intra_emphasis input: 'GFM' (GitHub Flavored Markdown)
smartypants smart_quotes
with_toc_data auto_ids: true
UniqueHeadCounter renderer Built-in (Kramdown auto-generates unique header IDs)
disable_indented_code_blocks Not needed (all code uses fenced blocks)
prettify Not needed (using Rouge syntax highlighter)

Removed unused files:

  • lib/unique_head.rb - Custom Redcarpet renderer for unique header IDs (Kramdown handles this natively)
  • lib/multilang.rb - Redcarpet extension that wasn't being used

JavaScript Minification

  • Enabled Uglifier harmony mode to support ES6 syntax (const, let, arrow functions)

Not Updated

  • middleman-sprockets: Remains pinned to 4.1.0 - verified that #2302 still affects 4.1.1 (autoprefixer sees SCSS // comments before compilation)

@mmenanno mmenanno changed the title Dependancy Upgrades Upgrade Ruby to 3.4 and fix build compatibility issues Dec 19, 2025
@mmenanno mmenanno force-pushed the dependancy-upgrade branch 2 times, most recently from 9184911 to 4d7b65d Compare December 19, 2025 16:50
- Upgrade Ruby from 3.2 to 3.4 (3.2 EOL in ~3 months)
- Update Bundler and gems to latest versions
- Upgrade Haml to 7.1 (blocking issue now resolved)
- Replace deprecated sass gem with sassc
- Replace Redcarpet with Kramdown to fix link_to nil error on Ruby 3.x
- Enable Uglifier harmony mode for ES6 syntax support
- Remove unused lib/unique_head.rb and lib/multilang.rb

Closes middleman/middleman#2818 workaround via Kramdown migration
@jpjpjp
Copy link
Collaborator

jpjpjp commented Dec 24, 2025

Hi @mmenanno. Thank you for doing this! This PR is listed as a draft. Is it ready to be merged?

@mmenanno
Copy link
Contributor Author

@jpjpjp I kept it in draft since the next major Ruby version comes out tomorrow on Christmas, so I figured once that is out I'll update this PR to use that so that we will maximize how much time we have till approaching EOL of a version again.

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