This repository has been archived by the owner on Jan 13, 2025. It is now read-only.
Closed
Description
This is an epic bug to track the tasks related to Foundation Delegation refactor.
Summary
This project aims to increase development speed of wrapping components based on MDC Web foundation in any web framework including Wiz, Angular, React, LitElement etc.
- By providing guidelines when implementing MDC Foundation class.
- By refactoring some of the existing code base in MDC Web to follow proposed guidelines.
- Update documentation on MDC Web based on this pattern.
Goals
Make component wrapping layer thin.
- Establish foundation pattern where component delegates all its APIs and event callbacks to foundation which in turn calls adapter APIs to perform framework-specific DOM manipulations or state changes.
Indirectly takes care of pending tech debts in MDC Web:
- Remove existing [de]registerEventHandler methods from adapters. Issue Remove [de]registerEventHandler methods from adapters #2813
- Remove directly referencing native input elements in foundation and in component implementation. Issue Remove Text Field getNativeInput adapter method #4054
-
Establish a pattern for event handling callbacks in foundation.
-
Individual component class per variant where applicable.
Prototype
Here is the initial prototype of MDC Checkbox with this pattern.