Khan / Khan/aphrodite

Garbage collection/stale styles

Open
#387 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.3k
Forks
187
PR merge metrics
No merged PRs in 30d

Description

I was wondering if there is any notion of garbage collection in Aphrodite. When a component unmounts, and it's styles are no longer being used, is it possible to clean up _**just**_ that components styles? I ask because I have a specific component that can end up generating a lot of different styles over it's lifetime.

I also noticed there is a `resetInjectedStyle` method, but it looks like it just resets the internal keys of which classnames have already been injected into the style tag. Maybe there could be another function that does a little more? When I saw this function I expected it to completely remove all styles for the passed in className. Is there any way to do that?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the resetInjectedStyle method and the style injection lifecycle described in the issue, especially what happens when a component unmounts. Determine whether removing styles for one className is compatible with Aphrodite's shared style handling. Done means the expected cleanup behavior and resetInjectedStyle semantics are defined and covered by appropriate tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.