cssinjs/jss

Global SheetsRegistry leaks memory?

开放

#1,340 创建于 2020年5月3日

 (0 条评论) (1 个反应) (0 位负责人)JavaScript (434 个派生)batch import
help wantedperf

仓库指标

星标
 (7,000 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Expected behavior: Created StyleSheet instances should not be retained indefinitely.

Describe the bug: StyleSheet instances are being retained inside the global SheetsRegistry.

Codesandbox link: Run the react-jss example code https://github.com/cssinjs/react-todomvc-jss.git

  1. Take memory snapshot.
  2. Add a few items.
  3. Delete those items.
  4. Repeat step 2 and 3 a few more times.
  5. Take another memory snapshot.
  6. Filter both snapshots by constructor named StyleSheet and you'll find the number only grows.

Versions (please complete the following information):

  • jss: The example is using 6.5.0, but I believe the issue is present in all versions.
  • Browser [e.g. chrome, safari]: Chrome
  • OS [e.g. Windows, macOS]: MacOS Feel free to add any additional versions which you may think are relevant to the bug.

贡献者指南