Feature and its Use Cases
Problem
The component currently relies on TypeScript for compile-time prop validation, which provides excellent type safety during development.
However, runtime validation is not available when type checking is bypassed or when the library is consumed in plain JavaScript. If an invalid prop value is passed (for example, an unsupported Theme value or an incorrectly structured object), the component may behave unexpectedly without providing developers with a clear indication of the issue.
Proposed Solution
Introduce a lightweight runtime prop validation utility that validates important public props during development.
The validation should:
- Validate important public props at runtime.
- Display clear and descriptive
console.warn() messages for invalid values.
- Never throw errors or interrupt rendering.
- Keep existing TypeScript type safety unchanged.
- Remain framework-agnostic without relying on bundler-specific APIs.
To keep the component clean and maintainable, the validation logic can be extracted into a dedicated utility file.
Suggested Project Structure
src/
├── utils/
│ └── validateProps.ts
Additional Context
This feature is intended only as a development-time enhancement and should not affect production behavior.
If this approach aligns with the project's direction, I would be happy to work on this feature.
If possible, could this issue be assigned to me?
Feature and its Use Cases
Problem
The component currently relies on TypeScript for compile-time prop validation, which provides excellent type safety during development.
However, runtime validation is not available when type checking is bypassed or when the library is consumed in plain JavaScript. If an invalid prop value is passed (for example, an unsupported
Themevalue or an incorrectly structured object), the component may behave unexpectedly without providing developers with a clear indication of the issue.Proposed Solution
Introduce a lightweight runtime prop validation utility that validates important public props during development.
The validation should:
console.warn()messages for invalid values.To keep the component clean and maintainable, the validation logic can be extracted into a dedicated utility file.
Suggested Project Structure
Additional Context
This feature is intended only as a development-time enhancement and should not affect production behavior.
If this approach aligns with the project's direction, I would be happy to work on this feature.
If possible, could this issue be assigned to me?