-
Improvement
-
Resolution: Fixed
-
Minor
-
4.3
-
MOODLE_403_STABLE
-
MOODLE_403_STABLE
-
MDL-79064-master -
Whilst working on MDL-78324 I found myself reusing the same import time and time again and felt that we should finally just update core/str to have a getString and getStrings which return a native promise.
To get this to wokr, I needed to add support to core/modal::asyncSet for native promises.
Essentially this change involves:
- creating a new getString and getStrings method to replace the current onces
- call these from get_string and get_strings and wrap the return values in jQuery Promises
- update core/modal to support the native promise
- find out if anything else needs updating
- encourage people to use the native
Why should we use the native Promise instead of the jQuery Promise? Because the jQuery behaviour pre-dates the Promise standard and behaves differently in some weird but important cases. We should also seek to move away from unnecessary use of jQuery to reduce our reliance upon the framework.