This Pull Request introduces changes that replace the use of .sortBy
with .sort combined with compare from @ember/utils. This update aims to
modernize and standardize sorting operations throughout the codebase.
**Main Changes:**
* Replaced .sortBy with .sort and compare in various components,
controllers, and services to improve sorting practices.
* Updated sorting logic to handle optional chaining (?.) for increased
robustness.
* Adjusted sorting logic, including reversing, in some cases for more
clarity and correctness.
* Added a new deprecation workflow entry to handle sortBy deprecation
logs (discourse.native-array-extensions.sortBy).
Replaces usages of `mapBy` across the codebase with JavaScript's native
`.map`. This resolves deprecation warnings related to Ember's array
extensions and ensures compatibility with future Ember versions.
---------
Co-authored-by: Jarek Radosz <jradosz@gmail.com>
1. We are adding more pages that do not need a Welcome banner to be
shown on:
- a sign up journey
2. Hides Header search on a `/search` page (avoids duplicate inputs)
Currently, the server session can only store strings. As we want to move
more things into it (like with a proper session object), we need to be
able to store arbitrary data.
This PR serializes data using Message Pack, as it’s almost as flexible
as Marshal but without the potential security issues.
Instead of desaturating the new-user notice to indicate it's no longer
relevant, we simply no longer render it.
---------
Co-authored-by: Martin Brennan <martin@discourse.org>
Refactor all instances of `reject` and `rejectBy` across the codebase to
use the native `filter` method paired with appropriate logic. Updates
include changes in models, components, and services.
This ensures compatibility with modern JavaScript standards and reduces
reliance on deprecated array extension methods.
Refine `shouldThrow` behavior by replacing `includeUnhandled` parameter
with `includeUnsilenced` to improve clarity and semantics. Adjust logic
to integrate unsilenced deprecations handling, ensuring more precise
deprecation workflows.
By default, RSpec's bisect uses the `:fork` strategy. This is not safe
to use in Discourse, because miniracer is not fork safe. So if any
contexts have been booted in the parent process, they'll be broken in
the forked process. Using `:shell` solves this.
Also, since we introduced core themes, the database 'seed' step became
much more expensive because it re-installs and compiles
Horizon/Foundation every time. I don't think there's any need to do this
every time we boot a spec. Instead, we can trust that it ran as part of
`bin/rake db:migrate`, just like it does in production.
On my machine, this cuts the runtime of a single (empty) spec from 3.5s
to 1.1s 🚀
- Adds a transformer to allow subtitle addition to the user notes form
- Adds plugin outlet to allow customization of each note in the modal
form
- Rename a handler placement to place the avatar under the correct
outlet
Recently we replaced the `pry-byebug` gem by the `debug` one. It broke
the auto-reload mechanism we have in the development environment for
Unicorn.
Indeed, the `debug` gem by default will add an `at_exit` hook that will
wait for all its children to exit. It clashes with our own mechanism.
The workaround is to require `debug/prelude` instead of `debug`: the
`debugger` command and breakpoints will still work but without the hook
being set.
For historical reasons, Discourse has a customized Ember resolver. This
had a much more fuzzy implementation of 'normalize' and 'findTemplate'
functions. This leniency meant that our file naming hasn't always
matched Ember conventions.
Standardizing our naming will make things easier to understand for
developers, and will make adoption of newer ecosystem tooling easier
(e.g. route-based bundle splitting in Embroider/vite)
This commit adds deprecations to the resolver when this leniency is
used, and uses a fully bespoke codemod to rename all of the affected
routes/controllers/templates in the Discourse core repository.
Backwards-compatibility is maintained for anyone looking up the old
names in the resolver.
This change adds `ReviewableActionBuilder::build_post_actions_bundle`, which defines all of the post actions that a reviewable should need. An important difference here is in `ReviewableQueuedPost`, which (despite the name) doesn't actually deal with posts, the post data is stored on the `Reviewable` object, so it needs to continue handling its own actions.
I've added relevant `perform_` methods to `ReviewableActionBuilder` to handle all of the actions defined in `build_post_actions_bundle`. Much like `target_user`, there's also now a `target_post` method to find the `Post` object.
Refactor `recentSearches` logic in `search.js` to replace the deprecated
`without` with a `filter` function. Update deprecation workflow to log
usages of the `discourse.native-array-extensions.without` method.
The bookmark modal should not be using `btn-danger`, as these classes
are reserved for buttons following a standard format ("normal buttons").
This can cause issues when a theme styles these classes, which then
conflicts with the display in a list.
This commit removes the class and replaces it with a `--danger` modifier
that can be used in any dropdown.
| BC | AC |
|--------|--------|
| <img width="734" height="326" alt="CleanShot 2025-09-23 at 20 59
03@2x"
src="https://github.com/user-attachments/assets/bd771908-8de2-4cfd-a648-fa880d330a09"
/> | <img width="598" height="316" alt="CleanShot 2025-09-23 at 21 05
35@2x"
src="https://github.com/user-attachments/assets/aba3877c-1aba-4fb3-935d-a31ec99e5fb6"
/> |