Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swiper 组件造成浏览器产生大量警告并拖慢运行速度 #9962

Closed
kong-dev opened this issue Aug 3, 2021 · 3 comments
Closed
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x

Comments

@kong-dev
Copy link
Contributor

kong-dev commented Aug 3, 2021

相关平台

H5

复现仓库

https://github.com/kong-dev/taro-bug
浏览器版本: Chrome 92
使用框架: React

复现步骤

Taro 3.3.1 H5 环境 Swiper 组件。

修改 Taro-component 库 Swiper 组件中创建 SwiperJS 的 options:在 observerUpdate 回调中添加一条日志,运行代码后会发现快速的不断打印该日志。(提供的仓库中偷懒没有依赖本地 Taro-component 库,可以手动修改一下 node_modules/@tarojs/components/dist/esm-es5/taro-swiper-core_2.entry.js 中的代码来添加日志)

这个问题导致了我的实际项目中浏览器报大量的 Added non-passive event listener to a scroll-blocking event 警告,并且拖慢运行速度,几分钟后页面就会卡死无响应。

期望结果

不要在这个回调中重建 swiper loop

实际结果

环境信息

👽 Taro v3.3.1


  Taro CLI 3.3.1 environment info:
    System:
      OS: macOS 11.5.1
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 12.22.1 - ~/.nvm/versions/node/v12.22.1/bin/node
      Yarn: 1.22.10 - /usr/local/bin/yarn
      npm: 6.14.12 - ~/.nvm/versions/node/v12.22.1/bin/npm
    npmPackages:
      @tarojs/cli: 3.3.1 => 3.3.1 
      @tarojs/components: 3.3.1 => 3.3.1 
      @tarojs/mini-runner: 3.3.1 => 3.3.1 
      @tarojs/react: 3.3.1 => 3.3.1 
      @tarojs/runtime: 3.3.1 => 3.3.1 
      @tarojs/taro: 3.3.1 => 3.3.1 
      @tarojs/webpack-runner: 3.3.1 => 3.3.1 
      babel-preset-taro: 3.3.1 => 3.3.1 
      eslint-config-taro: 3.3.1 => 3.3.1 
      react: ^17.0.0 => 17.0.2 


@taro-bot2 taro-bot2 bot added F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x labels Aug 3, 2021
@Chen-jj
Copy link
Contributor

Chen-jj commented Aug 3, 2021

@kong-dev 已有 PR 且合并了,下个版本发布。着急的话可以修改本地依赖先试试:#9907

@kong-dev
Copy link
Contributor Author

kong-dev commented Aug 3, 2021

@kong-dev 已有 PR 且合并了,下个版本发布。着急的话可以修改本地依赖先试试:#9907

好的,谢谢。那我先关闭了。

@kong-dev kong-dev closed this as completed Aug 3, 2021
@m430
Copy link

m430 commented Aug 14, 2021

@Chen-jj 已经升级到最新的3.3.3还有这个问题。已经合并了吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x
Projects
Archived in project
Development

No branches or pull requests

3 participants