Commit Graph

4 Commits

Author SHA1 Message Date
David Taylor
9f9c82ea97
DEV: Only add ember-global deprecation for Ember 3 (#24667)
(otherwise, we're accidentally extending support into Ember 5!)

Followup to 106c1c317f
2023-12-01 14:50:15 +00:00
David Taylor
106c1c317f
DEV: Restore ember-global deprecation in production (#24664)
Even with our patch to the deprecate() macro, this is optimized out of the production build because it's wrapped in an `if(DEBUG)` statement. (https://github.com/davidtaylorhq/ember.js/blob/14c02f53b8/packages/%40ember/-internals/bootstrap/index.ts#L19-L19)
2023-12-01 13:07:57 +00:00
Jarek Radosz
5584fb1e3b
DEV: Clean up package.json files (#22349)
Motivation: aligning us with JS/Ember practices (runtime deps in `dependencies`, build/dev-time deps in `devDependencies`)

1. Move deps to devDeps where applicable (rule of thumb: it's a devDep unless it's required at runtime by the rails app or it's imported in the addon's code)
2. Remove unused dependencies and add missing ones (in addons)
3. Remove empty `repository` fields
4. Move `engines` and `ember` fields to the bottom
2023-06-30 13:01:45 +02:00
David Taylor
270e98e45f
DEV: Include ember deprecation messages in production builds (#20587)
By default, Ember uses a babel transformation to strip out calls to `deprecate()` in production builds. Given that Discourse is a development platform for third-party themes/plugins, having deprecation messages visible in production is essential - many themes/plugins do not have comprehensive test-suites, and rely on production feedback to prompt changes. This commit patches Ember to print its deprecation messages to the console in production. In future we intend to improve the visibility of these to hosting providers and/or site admins.

There are two main parts to this commit:

1. Use yarn's 'resolutions' feature to point `babel-plugin-debug-macros` to a discourse-owned fork. This fork prevents `deprecate()` calls from being stripped. Relevant change can be found at https://github.com/discourse/babel-plugin-debug-macros/commit/d179d613bf

2. Introduce a production shim for Ember's deprecation library, including the `registerDeprecationHandler` API. The default implementation is stripped out of production builds via an `if(DEBUG)` wrapper.

Long term we hope that this kind of functionality can be made available in Ember itself via a flag.
2023-03-10 10:37:28 +00:00