redhat-developer / redhat-developer/vscode-openshift-tools
Refactor webviews to avoid code duplication
Open
Nobody has claimed this yet.
debt
- Dominant language
- TypeScript
- Stars
- 123
- Forks
- 63
- Avg merge
- 6h 16m
- Merged PRs (30d)
- 74
Description
Here are a few ideas:
- Create an abstract base class for the view loaders. This enables a few things:
- We can add a base message handler that is used for all the webviews. This allows us to reuse implementations of message handlers that should be used in all the views, such as sending telemetry and initializing the color scheme when the webview becomes available
- We can come up with a cleaner way to add and reuse message handlers. For example, many of the message handlers for create component and devfile registry overlap, so it would be nice to reuse them
- We can create as base wrapper component for each of the webviews that contains:
- The
ThemeProvidercomponent and the message passing code in order to manage the theme (light vs dark mode) - An error boundary component in order to handle when a webview crashes due to a fault in our React code
- The
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
No files, tests, or entry points are named. Start by locating the webview loaders, message handlers, and existing ThemeProvider usage, then compare the create component and devfile registry views. Done means shared loader or wrapper behavior covers common message handling, telemetry, theme initialization, and React error boundaries without duplicating those implementations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript, vscode
- Domain
- frontend, tooling
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100