alphagov / tech-docs-gem

Gem to distribute the tech docs project
https://tdt-documentation.london.cloudapps.digital/
MIT License
15 stars 38 forks source link

v2.0.12 breaks compatibility with therubyracer, node v4 #182

Closed 36degrees closed 2 years ago

36degrees commented 4 years ago

v2.0.12 bumped a load of dependencies, including bumping middleman-autoprefixer from 2.7 to 2.10.

middleman-autoprefixer 2.10 updates autoprefixer-rails from 8.0 to 9.1, and autoprefixer-rails 9.0 dropped support for therubyracer.

govuk_tech_docs doesn’t include therubyracer as a dependency, so I never spotted it, but several of the techs docs repos appear to include it as an additional dependency:

Dependabot PRs to update these repos to use v2.0.12 (like this one) are generally failing with:

ExecJS::RubyRacerRuntime is not supported. Please replace therubyracer with mini_racer in your Gemfile or use Node.js as ExecJS runtime.

It's also broken when trying to build using Node v4, as seen in alphagov/gds-way (https://github.com/alphagov/gds-way/pull/417):

Autoprefixer doesn’t support Node v4.8.2. Update it.

36degrees commented 4 years ago

Other than hmrc/vat-roadmap, most of the instances of govuk_tech_docs and therubyracer being used together in public repos seem to be internal (in an alphagov-owned repository)

Possible options:

1) Release a new version of govuk_tech_docs that reverts middleman-autoprefixer to 8.x (we could opt to update it again in a future major version, with appropriate release notes) 2) Advise those using therubyracer to switch to using miniracer as recommended by autoprefixer-rails

36degrees commented 4 years ago

@heathd has suggested that therubyracer was added to support the search functionality, but this has since (?) been re-done.

The frontend tech docs builds fine on Travis without any additional JS runtime, so assuming it also builds in other CI environments, it might be that therubyracer can now be removed from other projects entirely?

tijmenb commented 4 years ago

It's a bit of a mystery why those projects have added rubyracer. It seems like it was part of the middleman-search at some point:

https://github.com/alphagov/tdt-documentation/commit/1bebd05578637652d84cdf074d2485e3b6e2daa0?diff=unified#diff-e79a60dc6b85309ae70a6ea8261eaf95R122

But I can't figure out why the projects have it in their initial commit, it was never part of the template's Gemfile:

https://github.com/alphagov/tech-docs-template/commits/master/template/Gemfile

In any case, if the tests pass and site builds it should be safe to remove from Gemfiles.

m-green commented 3 years ago

@36degrees Do you know if this issue can be closed now? We've gone beyond v2.0.12 now so I'm wondering if we can assume everyone's solved their dependency issues?

lfdebrux commented 2 years ago

@m-green I'm inclined to close this issue - I searched GitHub for projects using tech docs template and therubyracer, and there are only a handful, and most of those are unmaintained anyway.

m-green commented 2 years ago

Makes sense to me @lfdebrux - closing.