discourse/lib/tasks
David Taylor 16b6e86932 DEV: Introduce feature-flag for Ember 5 upgrade
This commit introduces the scaffolding for us to easily switch between Ember 3.28 and Ember 5 on the `main` branch of Discourse. Unfortunately, there is no built-in system to apply this kind of flagging within yarn / ember-cli. There are projects like `ember-try` which are designed for running against multiple version of a dependency, but they do not allow us to 'lock' dependency/sub-dependency versions, and are therefore unsuitable for our use in production.

Instead, we will be maintaining two root `package.json` files, and two `yarn.lock` files. For ember-3, they remain as-is. For ember5, we use a yarn 'resolution' to override the version for ember-source across the entire yarn workspace.

To allow for easy switching with minimal diff against the repository, `package.json` and `yarn.lock` are symlinks which point to `package-ember3.json` and `yarn-ember3.lock` by default. To switch to Ember 5, we can run `script/switch ember version 5` to update the symlinks to point to `package-ember5.json` and `package-ember3.json` respectively. In production, and when using `bin/ember-cli` for development, the ember version can also be upgraded using the `EMBER_VERSION=5` environment variable.

When making changes to dependencies, these should be made against the default `ember3` versions, and then `script/regen_ember_5_lockfile` should be used to regenerate `yarn-ember5.lock` accordingly. A new 'Ember Version Lockfiles' GitHub workflow will automate this process on Dependabot PRs.

When running a local environment against Ember 5, the two symlink changes will show up as git diffs. To avoid us accidentally committing/pushing that change, another GitHub workflow is introduced which checks the default Ember version and raises an error if it is greater than v3.

Supporting two ember versions simultaneously obviously carries significant overhead, so our aim will be to get themes/plugins updated as quickly as possible, and then drop this flag.
2023-11-27 16:40:22 +00:00
..
add_topic_to_quotes.rake
admin.rake
annotate.rake
api.rake
assets.rake DEV: Introduce feature-flag for Ember 5 upgrade 2023-11-27 16:40:22 +00:00
auto_annotate_models.rake
autospec.rake
avatars.rake
backfill.thor
categories.rake
cdn.rake
db.rake DEV: Respect `SKIP_TEST_DATABASE` when running `rake db:create` (#24407) 2023-11-16 20:01:12 +08:00
destroy.rake
dev.rake
docker.rake DEV: Support customizing `docker:test:setup` with envs (#24508) 2023-11-22 15:12:02 +08:00
documentation.rake
emails.rake
emoji.rake
export.rake
groups.rake
hashtags.rake
i18n.rake
images.rake
import.rake
incoming_emails.rake
integration.rake
javascript.rake DEV: Modernise highlightjs loading (#24197) 2023-11-10 20:39:48 +00:00
log.rake
maxminddb.rake
plugin.rake Revert "FIX: `plugin:install_all_gems` Rake task not installing plugin gem (#24522)" (#24524) 2023-11-23 13:01:54 +08:00
populate.rake
populate.thor
posts.rake
profile.rake
qunit.rake DEV: Run QUnit tests for official Discourse themes (#24405) 2023-11-17 07:17:32 +08:00
redis.rake
release_note.rake DEV: Add link to PR when generating release notes 2023-09-12 09:26:46 +02:00
revisions.rake
rspec.rake
s3.rake
scheduler.rake
search.rake
site.rake FEATURE: Add dark mode option for category backgrounds (#24003) 2023-10-20 12:48:06 +00:00
site_settings.rake
smoke_test.rake DEV: Drop `/theme-qunit` from smoke test (#23562) 2023-09-13 16:14:27 +01:00
svg_icons.rake
svg_sprites.rake
tags.rake
themes.rake DEV: Run QUnit tests for official Discourse themes (#24405) 2023-11-17 07:17:32 +08:00
topics.rake
turbo.rake
typepad.thor
uploads.rake FEATURE: Add dark mode option for category backgrounds (#24003) 2023-10-20 12:48:06 +00:00
users.rake DEV: Add task to anonymize user data (#20522) 2023-10-03 16:59:43 +08:00
version_bump.rake DEV: Do not squash commits in `version_bump:stage_security_fixes` (#23547) 2023-09-12 18:00:42 +01:00