Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow app property to pass through addon proxy to addon instance #9936

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 1 addition & 15 deletions lib/models/per-bundle-addon-cache/addon-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ function validateCacheKey(realAddonInstance, treeType, newCacheKey) {

/**
* Returns a proxy to a target with specific handling for the
* `parent` property, as well has to handle the `app` property;
* that is, the proxy should maintain correct local state in
* closure scope for the `app` property if it happens to be set
* by `ember-cli`. Other than `parent` & `app`, this function also
* `parent` property. Other than `parent`, this function also
* proxies _almost_ everything to `target[TARGET_INSTANCE] with a few
* exceptions: we trap & return `[]` for `addons`, and we don't return
* the original `included` (it's already called on the "real" addon
Expand All @@ -62,8 +59,6 @@ function validateCacheKey(realAddonInstance, treeType, newCacheKey) {
* @return Proxy
*/
function getAddonProxy(targetCacheEntry, parent) {
let _app;

// handle `preprocessJs` separately for Embroider
//
// some context here:
Expand All @@ -82,10 +77,6 @@ function getAddonProxy(targetCacheEntry, parent) {
return parent;
}

if (property === 'app') {
return _app;
}

// only return `_preprocessJs` here if it was previously set to a patched version
if (property === 'preprocessJs' && _preprocessJs) {
return _preprocessJs;
Expand Down Expand Up @@ -136,11 +127,6 @@ function getAddonProxy(targetCacheEntry, parent) {
return Reflect.get(targetCacheEntry, property);
},
set(targetCacheEntry, property, value) {
if (property === 'app') {
_app = value;
return true;
}

if (property === 'preprocessJs') {
_preprocessJs = value;
return true;
Expand Down