Add a base class for Spina-based components.

Review Request #13588 — Created Feb. 28, 2024 and submitted — Latest diff uploaded

Information

Ink
master

Reviewers

This introduces BaseComponentView, which is a Spina base class that
makes it easy to write components. It subclasses BaseView and provides
formal support for:

  1. Capturing initial construction state (options, whether a component
    was instantiated via crafting, and storage of children and
    subcomponents).

  2. Rendering management that tears down the initial state post-render.

  3. Utilities for storing subcomponent children when crafting (though
    this is subject to change in the future).

All Ink components will derive from this class.

Unit tests pass.

Made use of this in the development of new components.

Diff Revision 1

This is not the most recent revision of the diff. The latest diff is revision 2. See what's changed.

orig
1
2

Commits

First Last Summary ID Author
Add a base class for Spina-based components.
This introduces `BaseComponentView`, which is a Spina base class that makes it easy to write components. It subclasses `BaseView` and provides formal support for: 1. Capturing initial construction state (options, whether a component was instantiated via crafting, and storage of children and subcomponents). 2. Rendering management that tears down the initial state post-render. 3. Utilities for storing subcomponent children when crafting (though this is subject to change in the future). All Ink components will derive from this class.
71902cfaeaf6b9c0c2ee6a6ec4b1adc4a1488ac1 Christian Hammond
src/ink/js/components/views/baseComponentView.ts
src/ink/js/components/views/index.ts
src/ink/js/components/views/tests/baseComponentViewTests.ts
Loading...