swagger-api / swagger-api/swagger-ui
make component names case insensitive. ie: getComponent("fooBaR")
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
The plugin system exposes a way to get components via system.getComponent().
Up till now its been case sensitive. Unfortunately we never put in a style-guide on what case to use.
So we have lowercase, TitleCase components mixed throughout.
I propose we make them case-insensitive.
- When building the system, we store the downcased name of the component in our object.
- When fetching, we downcase the argument to getComponent in order to fetch it from our object.
eg:
//...
plugins = [ { components: { wONderBAR: () => <h1> Hi </h1> } } ]
// stored as { wonderbar: .... }
system.getComponent("wonderBAR") // the component keyed with "wonderbar"
This is to allow any case, and not break any existing code. That said, we should likely normalize the component names in this codebase to be consistent.
Guestimate of work effort: < Normal
@shockey your thoughts?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the plugin system's system.getComponent() entry point and trace how component names are stored while the system is built. Check the existing component lookup coverage, then verify that differently cased names resolve to the same component without changing existing lookups.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100