Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Reproduction for Proxy behavior moving from non-locker component to locker component
<aura:component controller="DummyController">
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<div class="slds-card">
API version 39:
<c:apiProxyTest aura:id="proxyTest" />
</div>
</aura:component>
<?xml version="1.0" encoding="UTF-8"?>
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>39.0</apiVersion>
<description>Service consumer on API version 39</description>
</AuraDefinitionBundle>
({
doInit : function(component, event, helper) {
component.find('proxyTest').invoke({
action: component.get('c.getFalse')
});
}
})
<aura:component controller="DummyController">
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<div class="slds-card">
API version 41:
<c:apiProxyTest aura:id="proxyTest" />
</div>
</aura:component>
<?xml version="1.0" encoding="UTF-8"?>
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>41.0</apiVersion>
<description>Service consumer on API version 41</description>
</AuraDefinitionBundle>
({
doInit : function(component, event, helper) {
component.find('proxyTest').invoke({
action: component.get('c.getFalse')
});
}
})
<aura:component access="PUBLIC">
<aura:attribute name="filtered" type="Boolean" default="false" access="PRIVATE" description="True if the config parameter has been filtered (proxied)." />
<aura:method name="invoke" action="{!c.invoke}">
<aura:attribute name="config" type="Object" />
</aura:method>
<span>
{!v.filtered}
</span>
</aura:component>
<?xml version="1.0" encoding="UTF-8"?>
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>41.0</apiVersion>
<description>Service level component to retrieve </description>
</AuraDefinitionBundle>
({
invoke : function(component, event, helper) {
var args = event.getParam('arguments');
console.log(args);
var action = args.config.action;
component.set('v.filtered', typeof action.setParams !== 'function');
}
})
<aura:component implements="force:appHostable">
<!-- note that on API version 39, the action parameter will be filtered -->
<c:apiProxyConsumer39 />
<c:apiProxyConsumer41 />
</aura:component>
<?xml version="1.0" encoding="UTF-8"?>
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>41.0</apiVersion>
<description>Tab container for reproduction.</description>
</AuraDefinitionBundle>
public class DummyController {
@auraEnabled
public static Boolean getFalse() {
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.