@tarojs/runtime 4.0.0-alpha.37 → 4.0.0-alpha.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bom/raf.js +2 -2
- package/dist/bom/raf.js.map +1 -1
- package/dist/dom-external/index.js +1 -3
- package/dist/dom-external/index.js.map +1 -1
- package/dist/index.cjs.js +3 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/runtime.esm.js +3 -5
- package/dist/runtime.esm.js.map +1 -1
- package/package.json +2 -2
package/dist/runtime.esm.js
CHANGED
|
@@ -991,12 +991,12 @@ let now;
|
|
|
991
991
|
let lastTime = 0;
|
|
992
992
|
// https://gist.github.com/paulirish/1579671
|
|
993
993
|
// https://gist.github.com/jalbam/5fe05443270fa6d8136238ec72accbc0
|
|
994
|
-
const _raf =
|
|
994
|
+
const _raf = process.env.TARO_PLATFORM === 'web' ? requestAnimationFrame : function (callback) {
|
|
995
995
|
const _now = now();
|
|
996
996
|
const nextTime = Math.max(lastTime + 16, _now); // First time will execute it immediately but barely noticeable and performance is gained.
|
|
997
997
|
return setTimeout(function () { callback(lastTime = nextTime); }, nextTime - _now);
|
|
998
998
|
};
|
|
999
|
-
const _caf =
|
|
999
|
+
const _caf = process.env.TARO_PLATFORM === 'web'
|
|
1000
1000
|
? cancelAnimationFrame
|
|
1001
1001
|
: function (seed) {
|
|
1002
1002
|
// fix https://github.com/NervJS/taro/issues/7749
|
|
@@ -3317,9 +3317,7 @@ function contains(node) {
|
|
|
3317
3317
|
return isContains;
|
|
3318
3318
|
}
|
|
3319
3319
|
|
|
3320
|
-
|
|
3321
|
-
const isHarmony = process.env.TARO_PLATFORM === 'harmony' || process.env.TARO_ENV === 'harmony';
|
|
3322
|
-
if (!isWeb && !isHarmony) {
|
|
3320
|
+
if (process.env.TARO_PLATFORM !== 'web' && !(process.env.TARO_PLATFORM === 'harmony' || process.env.TARO_ENV === 'harmony')) {
|
|
3323
3321
|
if (ENABLE_INNER_HTML) {
|
|
3324
3322
|
TaroNode.extend('innerHTML', {
|
|
3325
3323
|
set(html) {
|