discourse/lib/tasks
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
..
add_topic_to_quotes.rake
admin.rake FEATURE: Add option to hide full name input at signup (#30471) 2024-12-30 22:26:20 +03:00
annotate.rake DEV: add rake task to annotate plugins in clean DB (#29378) 2024-10-24 15:15:59 -03:00
api.rake
assets.rake DEV: Migrate from sprockets to propshaft for assets (#32475) 2025-04-30 08:59:32 +01:00
auto_annotate_models.rake
autospec.rake
avatars.rake DEV: Update to lastest rubocop-discourse 2024-05-27 18:06:14 +02:00
backfill.thor
categories.rake
cdn.rake
compatibility.rake DEV: Introduce rake task to validate discourse-compatibility file (#26158) 2024-03-13 13:57:41 +00:00
db.rake DEV: Fixup db:reset (#31242) 2025-02-20 12:32:45 +00:00
destroy.rake DEV: Add rake task to bulk delete posts (#31642) 2025-03-05 09:31:23 +08:00
dev.rake
docker.rake DEV: Remove extraneous rubocop arguments (#31596) 2025-03-04 01:28:26 +01:00
documentation.rake DEV: Remove unmaintained tidy-jsdoc dependency (#25110) 2024-01-03 10:30:54 +00:00
emails.rake DEV: Update to lastest rubocop-discourse 2024-05-27 18:06:14 +02:00
export.rake
groups.rake
hashtags.rake
i18n.rake
images.rake
import.rake FIX: correct topics and posts count in import:ensure_consistency rake task (#30104) 2024-12-30 15:15:18 +01:00
incoming_emails.rake
javascript.rake DEV: Refactor moment.js loading (#32337) 2025-04-26 13:52:07 +01:00
list_email_templates_strings.rake FIX: Add new/missing email templates to the email templates editor (#28075) 2024-07-30 00:27:41 +03:00
log.rake
maxminddb.rake DEV: Bump rubocop_discourse (#29608) 2024-11-06 06:27:49 +08:00
plugin.rake DEV: Fix Lint/ShadowingOuterLocalVariable (#32036) 2025-03-27 13:50:24 +01:00
populate.rake DEV: Add reviewables:populate rake task (#30540) 2025-01-03 10:05:04 +08:00
populate.thor
posts.rake UX: Add a rake task to monitor progress for long rebakes (#27517) 2024-07-03 07:52:47 +10:00
profile.rake DEV: Fix benchmark script 2024-11-20 14:36:44 +01:00
qunit.rake DEV: Run theme tests in random order (#28841) 2024-09-11 10:45:12 +02:00
redis.rake
release_note.rake DEV: Bump rubocop_discourse (#29608) 2024-11-06 06:27:49 +08:00
reviewables.rake DEV: Add reviewables:mass-handle rake task (#30658) 2025-01-10 19:22:43 +03:00
revisions.rake
rspec.rake
s3.rake DEV: Migrate from sprockets to propshaft for assets (#32475) 2025-04-30 08:59:32 +01:00
scheduler.rake FEATURE: call hub API to update Discourse discover enrollment. (#25634) 2024-02-23 11:42:28 +05:30
search.rake
site.rake FEATURE: Add dark mode option for category backgrounds (#24003) 2023-10-20 12:48:06 +00:00
site_settings.rake DEV: Revert the addition of keywords for all site settings. (#30755) 2025-01-14 13:34:04 +11:00
smoke_test.rake DEV: Switch to pnpm for JS dependencies (#28671) 2024-09-03 10:51:07 +01:00
svg_icons.rake DEV: Switch to pnpm for JS dependencies (#28671) 2024-09-03 10:51:07 +01:00
svg_sprites.rake
tags.rake
themes.rake PERF: Optimize themes:update task (#29290) 2024-10-21 12:36:40 +01:00
topics.rake
turbo.rake
typepad.thor
uploads.rake FIX: Correct errors in uploads:sync_s3_acls rake task (#31411) 2025-02-20 16:16:27 +08:00
users.rake DEV: update rake task to disable 2FA for a user (#29052) 2024-10-16 09:11:29 +11:00
version_bump.rake DEV: Update to lastest rubocop-discourse 2024-05-27 18:06:14 +02:00