Consider adding a component API
See original GitHub issueInitially discussed in https://github.com/sourcelair/xterm.js/issues/807#issuecomment-316803292
This would involve adding some interface like this that would make implementing addons much easier:
interface IComponent {
onRefresh(rows: CircularList, startIndex: number, endIndex: number): void
onDraw(group: RenderGroup, element: HTMLElement): void
onMousedown(evt: MouseEvent): void
onMouseup(evt: MouseEvent): void
onInput(evt: KeyboardEvent): void
onFocus(): void
onBlur(): void
onScroll(): void
onOpen(term: ITerminal): void
onResize(rows: number, cols: number)
// ...
}
Candidates for turning into components:
- CompositionHelper
- SelectionManager
- Search
- Linkifier
/cc @mofux
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Introducing The Component-Based API - Smashing Magazine
A component is simply a set of pieces of HTML, JavaScript and CSS code put all together to create an autonomous entity. This...
Read more >Consider upgrading to a component-based API #2368 - GitHub
I think this library would greatly benefit from taking an approach similar to Headless UI, which is based around components. With smart use...
Read more >React.Component
This page contains a detailed API reference for the React component class definition. It assumes you're familiar with fundamental React concepts, ...
Read more >javascript - ReactJs app crashes with error "Consider adding ...
Error occured in App Component. Consider adding an error boundary to your tree to customize error handling behavior.
Read more >How to use API with React? ReactJS API Call Example ...
Grabbing the examples above, let's add the methods we are talking about to the components. Class component: import React from 'react'.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The internal
IRenderLayer
interface is pretty close to what I imagine the component API to look like:Plus exposing the convenience methods on
BaseRenderLayer
to allow the easy creation of custom canvasesRIght now they’re the same thing, need to re-render is only fired on an animation frame. If we enabled third party addons we may need to reconsider.