This repository contains libraries to help implement:
- attribute reflection in custom elements in a way that's as close as possible to how built-in elements work
- type coercion for property values and method arguments, following the rules of WebIDL (with small exceptions for edge-cases, to keep the library lightweight)
See this blog post for details.
- @platformer/webidl implements the WebIDL type coercion rules
- @platformer/reflect implements the HTML attribute reflection rules
- @platform/vanilla implements decorators for use with vanilla (i.e. without any library/framework) custom elements
- @platformer/lit implements decorators for use with Lit elements, replacing Lit's
@property()
decorators
Internal/subsidiary packages:
-
@platformer/types contains TypeScript types for decorators (to be implemented in framework-specific libraries) that could theoretically encapsulate the @platform/reflect package to cut verbosity by at least 50%
-
@platformer/microsyntaxes implements the HTML common microsyntaxes
-
The test harness