Giter Site home page Giter Site logo

Comments (20)

ruslan-kurchenko avatar ruslan-kurchenko commented on June 3, 2024 3

I’ll investigate that deeper. Maybe there is a chance to use polyfill. Stay tuned.

from sfdc-lax.

ruslan-kurchenko avatar ruslan-kurchenko commented on June 3, 2024 1

@rsoesemann ok, there is available implementation for situation like we have.
https://www.npmjs.com/package/promise.prototype.finally
I’ll try to use that lib, I think.

from sfdc-lax.

rsoesemann avatar rsoesemann commented on June 3, 2024 1

Otherwise I have to remove lax from the product 😰

from sfdc-lax.

ruslan-kurchenko avatar ruslan-kurchenko commented on June 3, 2024 1

I'll try to fix that. In another case, you could avoid of .finally usage. Or use LaxActionBuilder which doesn't rely on Promise API

from sfdc-lax.

rsoesemann avatar rsoesemann commented on June 3, 2024 1

It worked. You are AWESOME.

from sfdc-lax.

ruslan-kurchenko avatar ruslan-kurchenko commented on June 3, 2024

@rsoesemann is it working in Chrome/Safari?

from sfdc-lax.

rsoesemann avatar rsoesemann commented on June 3, 2024

Yes!

from sfdc-lax.

ruslan-kurchenko avatar ruslan-kurchenko commented on June 3, 2024

Got it. I will watch on that asap. Thank you!

from sfdc-lax.

ruslan-kurchenko avatar ruslan-kurchenko commented on June 3, 2024

@rsoesemann
I would guess that Firefox is not compatible with Promise.prototype.finally function:
See answer - https://stackoverflow.com/questions/22516959/how-to-determine-if-a-promise-is-supported-by-the-browser
Also, the link to the Firefox releases - https://wiki.mozilla.org/RapidRelease/Calendar
Release date: 2016-01-25
As soon as in the answer on StackOverflow:
Update Nov 14 - 2016: Chrome, Firefox, Safari and IE all now have experimental support for promises in their dev channels. The specification has settled. I would still not rely on the implementation just yet and would use a library but this might change in a few months.

Do you have client that still work on this old version?

from sfdc-lax.

ruslan-kurchenko avatar ruslan-kurchenko commented on June 3, 2024

Promise.prototype.finally is part of ES2016+. And unfortunatelly it is not compatible with Firefox 47.
screen shot 2018-02-09 at 7 05 26 pm

from sfdc-lax.

rsoesemann avatar rsoesemann commented on June 3, 2024

Thanks for digging in so deep. Yes we have a customer using this browser but this is enough material to convince him to upgrade. I hope...

from sfdc-lax.

rsoesemann avatar rsoesemann commented on June 3, 2024

Anychance for us to work around this on customers who stay on a shitty ff version? We use your lib everywhere 😬

from sfdc-lax.

rsoesemann avatar rsoesemann commented on June 3, 2024

Is this also a problem with standard salesforce promises? If so it should be excluded from salesforce supported browsers. Is it?

from sfdc-lax.

rsoesemann avatar rsoesemann commented on June 3, 2024

That would be a workaround for the FF 47 issue? Good luck.

from sfdc-lax.

ruslan-kurchenko avatar ruslan-kurchenko commented on June 3, 2024

Yep, that would be a workaround for all browsers that do not support Promise.prototype.finally
I hope to simplify that, cuz this lib has a lot of logic. It may be an overhead for the component

from sfdc-lax.

rsoesemann avatar rsoesemann commented on June 3, 2024

When you say I can use LaxActionBuilder does this mean I can use its newly released "finally" as well?

from sfdc-lax.

ruslan-kurchenko avatar ruslan-kurchenko commented on June 3, 2024

@rsoesemann exactly!
See .finallyCallback. The is the simple function without any Promise API logic.

/**
* Creates a unified function to be assign as a callback on the aura action.
* @param resolve {Function} the function called if the action is success
* @param reject {Function} the function called if the action is failed
* @returns {Function}
*/
function actionRouter(resolve, reject, finallyCallback) {
return function (response) {
var state = response.getState();
if (state === 'SUCCESS') {
resolve(response.getReturnValue());
} else {
var message = 'Unknown error';
var responseErrors = response.getError();
if (responseErrors && Array.isArray(responseErrors) && responseErrors.length > 0) {
message = responseErrors[0].message;
}
var errorConstructor = state === 'INCOMPLETE' ? errors.IncompleteActionError : errors.ApexActionError;
reject(new errorConstructor(message, responseErrors, response));
}
if (finallyCallback) {
finallyCallback();
}
};
}

from sfdc-lax.

ruslan-kurchenko avatar ruslan-kurchenko commented on June 3, 2024

@rsoesemann just released v1.2.2 with Promise.prototype.finally polyfill for non-compatible browsers.
I've tested on the FF47 and that is working fine.
See examples branch with tests: https://github.com/ruslan-kurchenko/sfdc-lax/blob/examples/src/aura/PromiseFinallyComponent/PromiseFinallyComponentController.js

from sfdc-lax.

ruslan-kurchenko avatar ruslan-kurchenko commented on June 3, 2024

@rsoesemann let me know if something went wrong with this update.

from sfdc-lax.

rsoesemann avatar rsoesemann commented on June 3, 2024

Thanks a lot. I will test tommorow.

from sfdc-lax.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.