discourse/app/assets/javascripts/patches/@ember+legacy-built-in-components+0.4.2.patch
Godfrey Chan e1373c3e84
DEV: introduce Embroider behind a flag, and start testing in CI (#23005)
Discourse core now builds and runs with Embroider! This commit adds
the Embroider-based build pipeline (`USE_EMBROIDER=1`) and start
testing it on CI.

The new pipeline uses Embroider's compat mode + webpack bundler to
build discourse code, and leave everything else (admin, wizard,
markdown-it, plugins, etc) exactly the same using the existing
Broccoli-based build as external bundles (<script> tags), passed
to the build as `extraPublicTress` (which just means they get
placed in the `/public` folder).

At runtime, these "external" bundles are glued back together with
`loader.js`. Specifically, the external bundles are compiled as
AMD modules (just as they were before) and registered with the
global `loader.js` instance. They expect their `import`s (outside
of whatever is included in the bundle) to be already available in
the `loader.js` runtime registry.

In the classic build, _every_ module gets compiled into AMD and
gets added to the `loader.js` runtime registry. In Embroider,
the goal is to do this as little as possible, to give the bundler
more flexibility to optimize modules, or omit them entirely if it
is confident that the module is unused (i.e. tree-shaking).

Even in the most compatible mode, there are cases where Embroider
is confident enough to omit modules in the runtime `loader.js`
registry (notably, "auto-imported" non-addon NPM packages). So we
have to be mindful of that an manage those dependencies ourselves,
as seen in #22703.

In the longer term, we will look into using modern features (such
as `import()`) to express these inter-dependencies.

This will only be behind a flag for a short period of time while we
perform some final testing. Within the next few weeks, we intend
to enable by default and remove the flag.

---------

Co-authored-by: David Taylor <david@taylorhq.com>
2023-09-07 13:15:43 +01:00

29 lines
1.1 KiB
Diff

diff --git a/node_modules/@ember/legacy-built-in-components/addon/mixins/_target_action_support.js b/node_modules/@ember/legacy-built-in-components/addon/mixins/_target_action_support.js
index d95b013..60f4ddf 100644
--- a/node_modules/@ember/legacy-built-in-components/addon/mixins/_target_action_support.js
+++ b/node_modules/@ember/legacy-built-in-components/addon/mixins/_target_action_support.js
@@ -3,8 +3,8 @@
/**
@module ember
*/
-
-import { context } from '../components/_internals';
+// This change has been merged upstream, but not yet released
+// see https://github.com/emberjs/ember-legacy-built-in-components/commit/61b1a048
import { get, computed } from '@ember/object';
import Mixin from '@ember/object/mixin';
import { assert } from '@ember/debug';
@@ -29,11 +29,7 @@ export default Mixin.create({
let actionContext = get(this, 'actionContext');
if (typeof actionContext === 'string') {
- let value = get(this, actionContext);
- if (value === undefined) {
- value = get(context.lookup, actionContext);
- }
- return value;
+ return get(this, actionContext);
} else {
return actionContext;
}