2

Lately I've found myself pretty deep in the weeds with a lightning application and have a series of questions I'm hoping someone here with some inside knowledge might be able to assist with. Or at least get a conversation started with people in the same boat.

First a high level outline of some observations/issues I've experienced as of Spring 17'

  • All properties (and more frustratingly getters/setters) must be present on an POJsO before disappearing into the framework b/c you're going to get back a SecureObject and anything you add to it will be ignored.

  • Functions on your objects will also be 'filtered' and it seems there is some type of memoizing that takes place causing multiple calls to return the same value. Example:

    var MyThing = function(){ 
       var array = [1,2,3];
       this.getMyArray = function(){ return array;};
    
       this.doSomething = function(){
           ....
           array.push(4);
           .....
       }
       return this;
    
    };
    var thing = new MyThing();
    thing.getMyArray(); // [1,2,3]
    thing.doSomething();
    thing.getMyArray(); // [1,2,3] !!!!WTF!!! expected [1,2,3,4]
    
  • General performance issues in aura:iteration. Even in collections as small as 50-100 items. This is especially an bad if you've setup bindings with "v.data[10]" style expressions and want to reorder/insert/remove items in the array. Seems the framework keeps each component tied to it's position in the array by index rather than the object in the array - which makes sense. But it leaves no performant way to move items or shuffle/sort/filter the list on view. (I've made some good progress and attained decent performance by doing all the component creation and v.body management dynamically, but the code feels real janky)

So some questions:

  1. How does the source code on github compare to what is in salesforce/will be in salesforce? I see exciting commits like "Removal of unfilterEverything()!" and while i didn't go through the full diff, I'm wondering how much of what I see in github I can rely on making its way to Salesforce? and when?

  2. Is there a better place to look to than Salesforce Known Issues and the github source for tracked issues/enhancements? The reason I ask; I have a lot of 'creative workarounds' and less than ideal practices (JSON.parse(JSON.serialize(obj)) in place, but my delivery schedule is flexible enough that I could hold off on band-aids if i knew a fix was imminent.

  • Do you happen to have a pre-release sandbox org you could test these scenarios on? There have been significant improvements related to LockerService coming in Summer '17 major release. I'll try to address most of the points in an answer below but Summer '17 will likely resolve a significant number of issues. – TrevorBliss Apr 13 '17 at 17:50
  • Thanks for the response - I'm in a developer org right now and am eager for a preview instance, but those aren't available until may 5 right? That's a big part of my questions, do I create workarounds now, or wait to see if Summer '17 resolves my problems anyway. – wellmstein Apr 13 '17 at 20:40
  • I'd wait for Summer '17 for the LockerService + object and array issues. There probably won't be significant improvements to aura:iteration though so I'd continue with your workarounds there. – TrevorBliss Apr 13 '17 at 21:01
1

To answer the specific questions...

  1. Everything you see in github will eventually make it in to Salesforce for you to consume, but the timing is a bit tricky. The open-source repository only shows the "master" branch which typically maps to the next major release. There are also a good number of bug fixes that go out in patches but those changes won't be publicly visible. Though almost always the fixes that go out in patch are also made in the master branch.
  2. Unfortunately, there's no single source for all upcoming changes/fixes and exactly when they'll be released. I suggest filing a customer case for things that are urgent.

And regarding your first 2 bullets...

(Safe Harbor) I've verified locally that the array scenario is fixed in Summer '17, and I suspect the POJO getter/setter issue will be fixed as well. Can't be 100% sure without a specific repro though.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.