discourse/config
David Taylor e7450cc6da
DEV: Migrate from sprockets to propshaft for assets (#32475)
We are no longer using any of the transpilation/bundling features of
Sprockets. We only use it to serve assets in development, and then
collect & fingerprint them in production. This commit switches us to use
the more modern "Propshaft" gem for that functionality.

Propshaft is much simpler than Sprockets. Instead of taking a
combination of paths + "precompile" list, Propshaft simply assumes all
files in the configured directory are required in production. Previously
we had some base paths configured quite high in the directory structure,
and then only precompiled selected assets within the directory. That's
no longer possible, so this commit refactors those places (mostly
plugin-related) to use dedicated directories under
`app/assets/generated/`.

Another difference is that Propshaft applies asset digests in
development as well as production. This is great for caching & dev/prod
consistency, but does mean some small changes were required in tests.

We previously had some freedom-patches applied to Sprockets. Some of
those had to be ported across to Propshaft. We now have three patches:

1. Skip adding digest hashes to webpack-generated chunks (which are
already digested, and referred to from other js files)

2. Avoid raising errors for missing assets in test mode. We don't always
compile assets before running basic RSpec tests.

3. Maintain relative paths for sourcemap URLs, so that files don't need
to be recompiled depending on their CDN path

Significant refactors are made to the `assets.rake` and `s3.rake` tasks,
which rely on implementation details of Sprockets/Propshaft.
2025-04-30 08:59:32 +01:00
..
environments DEV: Migrate from sprockets to propshaft for assets (#32475) 2025-04-30 08:59:32 +01:00
initializers DEV: Migrate from sprockets to propshaft for assets (#32475) 2025-04-30 08:59:32 +01:00
locales Update translations (#32510) 2025-04-30 07:59:22 +10:00
application.rb DEV: Migrate from sprockets to propshaft for assets (#32475) 2025-04-30 08:59:32 +01:00
boot.rb PERF: Stop running bootsnap in development mode on all environments (#25737) 2024-02-19 11:33:52 +08:00
cdn.yml.sample
database.yml DEV: Increase pool connections to 2 in test environment 2024-11-28 12:23:25 +01:00
deploy.rb.sample
dev_defaults.yml DEV: Convert admin-incoming-email modal to component-based API (#22701) 2023-07-20 16:31:20 -05:00
discourse.config.sample
discourse.pill.sample
discourse_defaults.conf DEV: Support connecting to Redis with a username. (#31710) 2025-03-13 10:39:50 +08:00
environment.rb DEV: Apply syntax_tree formatting to config/* 2023-01-09 11:13:29 +00:00
logrotate.conf
multisite.yml.production-sample
nginx.sample.conf PERF: Enable brotli in NGINX (#32333) 2025-04-24 15:45:13 +01:00
projections.json
puma.rb DEV: Apply syntax_tree formatting to config/* 2023-01-09 11:13:29 +00:00
routes.rb DEV: Migrate from sprockets to propshaft for assets (#32475) 2025-04-30 08:59:32 +01:00
sidekiq.yml
site_settings.yml DEV: Remove full_page_login setting (#32189) 2025-04-29 10:40:40 +02:00
spring.rb DEV: Apply syntax_tree formatting to config/* 2023-01-09 11:13:29 +00:00
thin.yml.sample
unicorn.conf.rb DEV: Fix undefined method check_email_sync_heartbeat in unicorn conf (#30360) 2024-12-19 10:10:11 +08:00
unicorn_launcher
unicorn_upstart.conf