Project

General

Profile

Actions

Feature #39111

closed

Enable Asset Pipeline Integration using Propshaft

Added by Takashi Kato 8 months ago. Updated 22 days ago.

Status:
Closed
Priority:
Normal
Category:
Code cleanup/refactoring
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

Description

This patch enables the Asset Pipeline in Redmine, assuming you have upgraded to Rails 7(#36320).

Until Rails 6.1, Sprockets was a prerequisite for using the Asset Pipeline. However, starting from Rails 7, Propshaft has been introduced as an alternative option.
While Propshaft offers fewer features compared to Sprockets, it boasts a smaller codebase and greater clarity in its operations (eliminating the need for a JavaScript runtime). Additionally, manifest files are no longer necessary during development.

Key benefits of using Propshaft include:

  • The ability to append file digests to file names instead of Rails3 stytle cache-busting approach involving query strings at the end of assets (expected to enhance cache hit rates).
  • Support for tasks like copying plugin assets to the public directory each time Redmine starts.
  • Compatibility with Turbo, which is almost mandatory in Rails 7 and later. (Note that Rails 7 and later deprecate rails-ujs, the current Redmine dependency.)

To address potential challenges associated with introducing Propshaft, we have extended its functionality in the following ways:

  • We've made it possible for Propshaft to handle Redmine plugin and theme assets without requiring modification(If we use propshaft in default, we will need to modify the links to other assets in stylesheets.).
  • We've ensured that introducing Asset Pipeline does not necessitate rewriting existing stylesheets, thus avoiding major incompatibilities with Redmine themes.
  • In a production environment, rather than manually running the rails asset:precompile command before starting Rails, we now automatically check for asset updates and run precompilation as needed. (You can disable this automatic execution by setting config.assets.redmine_detect_update to false in config/environments/production.rb).

Files


Related issues

Related to Redmine - Patch #40137: Jstoolbar help files should import images from the asset pipelineClosedMarius BĂLTEANU

Actions
Related to Redmine - Defect #40204: `rake redmine:plugins` fails with the error "Don't know how to build task 'redmine:plugins:assets'"ClosedMarius BĂLTEANU

Actions
Related to Redmine - Patch #40221: Update wiki content related to how to create a custom themeNew

Actions
Related to Redmine - Patch #40559: Fix incorrect icon image paths for Wiki help pagesClosedMarius BĂLTEANU

Actions
Actions

Also available in: Atom PDF