Skip to content

Commit

Permalink
Remove default proxies if there's no controller
Browse files Browse the repository at this point in the history
The default proxies are not needed because the value of proxies[name]
is passed to a helper map() function which checks if it's undefined.

They also prevent the view from being used directly, without a
controller.

Also, they were only defined for root proxies, not for nested ones
(nested ones were actually included as root and never used).
  • Loading branch information
awahlig committed May 23, 2022
1 parent c024860 commit 5a07486
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/writers/view-writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,7 @@ class ViewWriter extends Writer {
}
render() {
const proxies = ${this.className}.Controller !== ${this.className} ? transformProxies(this.props.children) : {
==>${this[_].composeProxiesDefault()}<==
}
const proxies = transformProxies(this.props.children)
return (
<span>
Expand Down Expand Up @@ -422,12 +420,6 @@ class ViewWriter extends Writer {
return escape(css.trim())
}

_composeProxiesDefault() {
return this[_].sockets.map((socket) => {
return `'${socket}': [],`
}).join('\n')
}

_composeChildImports() {
const imports = this[_].children.map((child) => {
return `import ${child.className} from './${child.className}'`
Expand Down

0 comments on commit 5a07486

Please sign in to comment.