Document our API
- Dominant language
- JavaScript
- Stars
- 5.3k
- Forks
- 187
- PR merge metrics
- No merged PRs in 30d
Description
Someone commented on https://github.com/Khan/aphrodite/commit/21ef03b7c2a1448f07f48c241d3d205fea2b4c82, noting that it changes the class names that `css()` generates, and was wondering if that counted as a breaking change. I don't think it is, but I'd like to get some feedback about what we think our API really is, and what we think counts as a breaking change.
This is the way I've been thinking about it, and would propose that we formalize this and document it somewhere (e.g. I've seen [babylon](https://github.com/babel/babylon#semver) document how they follow semver).
The API which we maintain via semver is:
- The types of the inputs that `css()` and `StyleSheet.create` (and our other APIs) accept and produce should stay the same. Changing these to something incompatible would be a breaking change. Accepting new inputs would be a minor change.
- The semantics of the generated styles and how they interact with the class names that we generate should stay the same. This means that, if someone uses plain Aphrodite (e.g. with no extensions) and apply single class names to an element, the styles that are applied to that element should not change. Fixing bugs in which styles get applied (like when we reordered styles to make sure that unprefixed styles overruled prefixed styles) would be a bugfix (despite maybe breaking some styles).
- The types and semantics of the selector handler extension API should stay the same. Accepting new types of extensions would be a minor change.
- The `"aphrodite/no-important"` import.
The API that we do not maintain (i.e. that users should not depend on because it might break in the future) is:
- The text of the class names that are generated via `css()`
- The text of the CSS that is generated
- Support for "hacky" features such as the hack people use to generate descendant styles by putting spaces in their keys.
How do people feel about this? I think that the most contentious things would be that "fixing bugs in which styles get applied" isn't a breaking change, and that the text that we generate isn't covered.
@drKnoxy @lencioni @kentcdodds
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing the proposed maintained and unmaintained API lists in this issue, the referenced commit, and the linked Babylon semver guidance. Confirm the project’s position on generated class names, generated CSS, bug fixes, and selector extensions, then document the agreed semver policy in the project’s documentation after resolving the open feedback.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100