cssinjs / jss

JSS is an authoring tool for CSS which uses JavaScript as a host language.
https://cssinjs.org
MIT License
7.08k stars 399 forks source link

fix memory leak in dynamic nested rule #1563

Closed seiyab closed 3 years ago

seiyab commented 3 years ago

Corresponding Issue(s):

1360

What Would You Like to Add/Fix?

Fix memory leak in nested rule in function rule

Todo

Expectations on Changes

Resolve memory leak nested rule in function rule

// e.g.
{
  a: ({ color }) => {
    '& button': {
      color
    }
  }
}

Changelog

Fix memory leak with dynamic nested style.

Note

kof commented 3 years ago

Wow this looks great!

I am going to investigate every change to see if everything is correct. The only thing that I don't like so far is the increase in bundle size. I have to think if we can achieve the same thing without adding that much logic.

seiyab commented 3 years ago

Thank you for your comment. I reduced bundle size a bit in 50b7b9b . I removed upsertRule and current replaceRule works like upsert.

seiyab commented 3 years ago

Thank you for your careful review 👍 I'll reply or fix each comment.

seiyab commented 3 years ago

For each comment, I fixed or replied.

kof commented 3 years ago

merged, thanks a lot, this is a huge help!

kof commented 3 years ago

released in https://github.com/cssinjs/jss/releases/tag/v10.8.1