What features did we miss in Salesforce Spring ’17 release?

Previous releases of Salesforce were really cool. Take, for example, Lightning Experience for service or Commerce Insights. But there were other valuable features geared to developers that received too little attention even in release notes. Some features got lost among updates to Wave, Einstein and new admin features. Our senior Salesforce expert shares his insights on these awesome functionalities.

Apex Stub API – generally available since Spring ’17

Stub API makes testing easier by implementing mocking framework. Mocks are a powerful tool for Unit Testing.  For example, Mockito and other libs for Java enable true Unit Testing. Now, when building a mocking framework with the stub API, the stub objects are generated dynamically, so there is no need to package and deploy test classes.  As a result, you can either build your own mocking framework or make use of the one built by someone else.

Insights

Imagine you are testing some functionality that intersects with others, thus starting quite complex and intricate processes. With mocking framework, this functionality does not trigger long-term running processes, and the developer can test a specific feature without interfering with all the others involved.

The concept is great, but Apex Stub API has its drawbacks.  For example, mocks have been available for apex development since the lib delivered by FinancialForce (https://github.com/financialforcedev/fflib-apex-mocks), but due to difficulties in implementation and limitations of usage, Stub API seemed like a better solution.  What we received instead is something very similar to the lib in FinancialForce, and is even more limited at times, e.g., static, private, get/set, methods from triggers, inner classes, batchable, system types and singletons are not allowed. Unfortunately, these limitations diminish the value of Stub API because most of the big logic components are stored that way.

Impression

  • Idea – A, Implementation – F
  • Limits need to be improved  

Lightning:container – developer preview since Spring ’17

Content is hosted in an iFrame by the lightning:container component. It enables communication to and from the framed application and thus interacts with the Lightning component.

Insights

Finally, you can store apps directly in Salesforce without using external hosting!

It extends Lightning framework which is limited by default with the help of other frameworks. For example, it provides the ability to host JavaScript frameworks, such as modern React and apps inside Lightning components.  Without limitations that are present in VisualForce, it allows the use of  various directories.

The idea looks promising, although you still can experience some limitations in iFrame. There could be some minor issues with scrolling, caching, etc. It seems like a canvas app, but now it is hosted inside SFDC, which is a great plus.

Impression

  • Idea – A, implementation – B
  • Fingers crossed for this to be released as it is in Developer Preview
  • Limits need to be improved
  • N.B. Content Security Policy can be less strict than in Lightning Framework, which allows us to use lots of javascript libs that had been banned due to security policy for Lightning, e.g., inline javascript and eval are banned due to this.

 

George Arshakian

Senior Salesforce Engineer, CoreValue

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *