discourse/lib/tasks
David Taylor 22a7905f2d
DEV: Allow Ember CLI assets to be used by development Rails app (#16511)
Previously, accessing the Rails app directly in development mode would give you assets from our 'legacy' Ember asset pipeline. The only way to run with Ember CLI assets was to run ember-cli as a proxy. This was quite limiting when working on things which are bypassed when using the ember-cli proxy (e.g. changes to `application.html.erb`). Also, since `ember-auto-import` introduced chunking, visiting `/theme-qunit` under Ember CLI was failing to include all necessary chunks.

This commit teaches Sprockets about our Ember CLI assets so that they can be used in development mode, and are automatically collected up under `/public/assets` during `assets:precompile`. As a bonus, this allows us to remove all the custom manifest modification from `assets:precompile`.

The key changes are:
- Introduce a shared `EmberCli.enabled?` helper
- When ember-cli is enabled, add ember-cli `/dist/assets` as the top-priority Rails asset directory
- Have ember-cli output a `chunks.json` manifest, and teach `preload_script` to read it and append the correct chunks to their associated `afterFile`
- Remove most custom ember-cli logic from the `assets:precompile` step. Instead, rely on Rails to take care of pulling the 'precompiled' assets into the `public/assets` directory. Move the 'renaming' logic to runtime, so it can be used in development mode as well.
- Remove fingerprinting from `ember-cli-build`, and allow Rails to take care of things

Long-term, we may want to replace Sprockets with the lighter-weight Propshaft. The changes made in this commit have been made with that long-term goal in mind.

tldr: when you visit the rails app directly, you'll now be served the current ember-cli assets. To keep these up-to-date make sure either `ember serve`, or `ember build --watch` is running. If you really want to load the old non-ember-cli assets, then you should start the server with `EMBER_CLI_PROD_ASSETS=0`. (the legacy asset pipeline will be removed very soon)
2022-04-21 16:26:34 +01:00
..
add_topic_to_quotes.rake
admin.rake DEV: Use strings for :user_email job type argument 2022-02-04 18:28:18 +00:00
annotate.rake DEV: Add annotate rake tasks, and enforce via GitHub actions 2021-07-06 10:11:06 +01:00
api.rake
assets.rake DEV: Allow Ember CLI assets to be used by development Rails app (#16511) 2022-04-21 16:26:34 +01:00
auto_annotate_models.rake DEV: Allow annotations to work in symlinked plugins, add binstub (#13635) 2021-07-05 15:43:10 +01:00
autospec.rake DEV: Add API docs for uploads and API doc watcher (#15387) 2021-12-23 08:40:15 +10:00
avatars.rake
backfill.thor
categories.rake FIX: rake categories:move_topics shouldn't move category description topic (#14797) 2021-11-03 11:27:51 +08:00
cdn.rake DEV: Fix rubocop issues (#14715) 2021-10-27 11:39:28 +03:00
db.rake Revert "DEV: increase lock timeout for multisite migration (#14831)" (#14883) 2021-11-11 16:16:53 +03:00
destroy.rake
dev.rake DEV: move discourse_dev gem to the core. (#13360) 2021-06-14 20:34:44 +05:30
docker.rake DEV: Add SKIP_DB_CREATE option to docker:test (#16225) 2022-03-21 13:21:06 +01:00
emails.rake DEV: Correctly tag heredocs (#16061) 2022-02-28 20:50:55 +01:00
emoji.rake FEATURE: Add missing emojis (#15582) 2022-01-14 17:51:13 -03:00
export.rake
groups.rake
i18n.rake DEV: Update i18n:check rake task to detect invalid Markdown links (#13728) 2021-07-14 13:26:12 +02:00
images.rake
import.rake FEATURE: Add last visit indication to topic view page. (#13471) 2021-07-05 14:17:31 +08:00
incoming_emails.rake
integration.rake DEV: Remove hints of jshint (#14828) 2021-11-08 09:12:37 +08:00
javascript.rake DEV: Drop lodash (#16110) 2022-03-06 18:15:25 +01:00
log.rake
maxminddb.rake
plugin.rake DEV: Improve plugin:versions task (#16391) 2022-04-06 18:29:39 +02:00
populate.rake FEATURE: Add post edits count to user activity (#13495) 2021-08-02 10:15:53 -04:00
populate.thor DEV: Correctly tag heredocs (#16061) 2022-02-28 20:50:55 +01:00
posts.rake FIX: LocalJumpError in rake tasks (#14874) 2021-11-10 16:53:55 +01:00
qunit.rake DEV: Allow Ember CLI assets to be used by development Rails app (#16511) 2022-04-21 16:26:34 +01:00
redis.rake FIX: LocalJumpError in rake tasks (#14874) 2021-11-10 16:53:55 +01:00
release_note.rake DEV: Fix methods removed in Ruby 3.2 (#15459) 2022-01-05 18:45:08 +01:00
rspec.rake
s3.rake DEV: Ensure Ember CLI sourcemaps are uploaded to S3 (#15893) 2022-02-10 19:00:47 +00:00
scheduler.rake
search.rake
site_settings.rake
site.rake DEV: Fix methods removed in Ruby 3.2 (#15459) 2022-01-05 18:45:08 +01:00
smoke_test.rake DEV: Minor linting fixes (#16359) 2022-04-02 21:15:38 +02:00
svg_icons.rake
tags.rake
themes.rake DEV: Only raise rake themes:update errors when flag provided (#16254) 2022-03-22 17:02:14 +00:00
topics.rake FIX: LocalJumpError in rake tasks (#14874) 2021-11-10 16:53:55 +01:00
turbo.rake
typepad.thor
uploads.rake DEV: Correctly tag heredocs (#16061) 2022-02-28 20:50:55 +01:00
users.rake