To improve developer experience and catch invalid values for a code component instance, Canvas now validates the properties passed to code components at render time. This mirrors the behavior of Drupal Core’s Single Directory Components (SDC).
Previously, if a code component (e.g., a JS-based component) was passed invalid props or was missing required props defined in its metadata, it might fail silently or produce unexpected output.
Following the pattern in \Drupal\Core\Template\ComponentNodeVisitor, Canvas now performs an assertion within the rendering pipeline. When the site is in a state where assertions are active (typically local development or testing environments, not prod), Canvas will validate the provided props against the component's defined schema.
If the validation fails, an exception will be thrown, highlighting exactly which properties are missing or invalid.