Closed zefir-git closed 1 week ago
The pull request introduces several significant changes across multiple files related to the component architecture. The Component
class in src/Component.ts
has been updated to extend ElementComponent
instead of BaseComponent
, altering its foundational behaviour. Modifications include using this.node
for DOM manipulations, with adjustments to the select
, selectAll
, and css
methods to reflect this change. The on
method has been enhanced with additional overloads for improved event listener flexibility.
In src/ElementComponent.ts
, the BaseComponent
class has been renamed to ElementComponent
and now extends NodeComponent
. The constructor and various methods have been updated to reference this.node
instead of this.element
. A new abstract class, NodeComponent
, has been introduced in src/NodeComponent.ts
, providing a base for components associated with DOM nodes. Additionally, the SvgComponent
class now extends ElementComponent
, and a new TextComponent
class has been created to represent text nodes. The src/index.ts
file has been updated to export the new and modified components.
ElementComponent
class, which is directly related to the modifications made in the main PR that updates the Component
class to inherit from ElementComponent
.bug
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Adds a new component abstract class based on a lower level DOM API than
Element
, namelyNode
. All component classes now extendNodeComponent
.Also adds a
TextComponent
class for creating text node components.BaseComponent is renamed to ElementComponent for consistency.