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

Alphabetize prop names in documentation #1891

Closed
1 task
theetrain opened this issue Jan 14, 2024 · 5 comments
Closed
1 task

Alphabetize prop names in documentation #1891

theetrain opened this issue Jan 14, 2024 · 5 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers refactor

Comments

@theetrain
Copy link
Collaborator

theetrain commented Jan 14, 2024

This is blocked by #1629

In the component docs, the API section will render prop names in the order they're defined.

  • Let's alphabetize props, either in code or via Sveld
@theetrain theetrain added documentation Improvements or additions to documentation good first issue Good for newcomers refactor labels Jan 14, 2024
@SimpleProgrammingAU
Copy link
Contributor

I alphabetised them in code to make the editing experience easier. This is something I'm gonna want to do before doing the tasks for #1629. Is there a way we can make this an initial step for #1629 without it becoming too painful?

@metonym
Copy link
Collaborator

metonym commented Jan 14, 2024

I'm opposed to this. Props are purposefully listed with the most relevant/important. In the docs, reactive vars are listed first.

Generally, props should be sorted by importance, relevance, then grouped by similarity.

@metonym
Copy link
Collaborator

metonym commented Jan 14, 2024

For example - yes, it's easier to initially find a prop in an alphabetized list, but it's inefficient beyond that.

A prop like hideLabel naturally follows labelText. If alphabetized, hideLabel would appear before labelText.

Props like invalidText and warnText should also be close in proximity.

@theetrain
Copy link
Collaborator Author

@metonym fair enough, the rationale is sound. Seeing most-used props first does provide good quality of life to users, myself included. I don't see a way to ensure this ordering via linting or docs generation, but that's ok.

@theetrain
Copy link
Collaborator Author

I added a "Prop ordering" rule in #1621 so that this is captured somewhere. We can continue to discuss ordering in that proposal.

@theetrain theetrain closed this as not planned Won't fix, can't repro, duplicate, stale Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers refactor
Projects
None yet
Development

No branches or pull requests

3 participants