mirror of https://github.com/zulip/zulip.git
babel: Enable loose mode.
Due to try-catch deoptimization, Babel strict mode for…of loops run about 5× slower in Firefox than Babel loose mode for…of, native for…of, or forEach (which are all about the same speed). Chrome doesn’t seem to care. For some reason we need to explicitly add the core-js Symbol polyfill near the beginning of the common bundle. Otherwise it gets loaded at the wrong time and the Casper tests fail. Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
parent
de3146c137
commit
ea9212a92d
|
@ -4,6 +4,7 @@ module.exports = {
|
||||||
"@babel/preset-env",
|
"@babel/preset-env",
|
||||||
{
|
{
|
||||||
corejs: 3,
|
corejs: 3,
|
||||||
|
loose: true, // Loose mode for…of loops are 5× faster in Firefox
|
||||||
useBuiltIns: "usage",
|
useBuiltIns: "usage",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import "core-js/features/promise";
|
import "core-js/features/promise";
|
||||||
|
import "core-js/features/symbol";
|
||||||
import "jquery/dist/jquery.js";
|
import "jquery/dist/jquery.js";
|
||||||
import "underscore/underscore.js";
|
import "underscore/underscore.js";
|
||||||
import "../page_params.js";
|
import "../page_params.js";
|
||||||
|
|
|
@ -297,7 +297,7 @@ exports.unread_topic_counter = (function () {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
pretty_name: topic_name,
|
pretty_name: topic_name,
|
||||||
message_id: Math.max(...msgs),
|
message_id: Math.max(...Array.from(msgs)),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue