You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which is fine until I have usage where the prop is left off when used (e.g. on docs/getting-started.webc)
<site-card@date="2023-01-01"></site-card><!-- sure, fine --><site-card></site-card><!-- not fine -->
This collides with any top level date set in Eleventy’s data cascade.
My proposal is to move internal components (e.g. src/_includes/components/* in my example) and not top level WebC template pages (e.g. *.webc files in the Eleventy input folder) to need to reference global data in this way as $data.date instead.
This will prevent undesirable collisions but may require component code to change (if it previously accessed global data). In this above example the component doesn’t use global data and expects date to not have a value, thus does not require code changes.
The text was updated successfully, but these errors were encountered:
On 11ty-website I have a
src/_includes/components/site-card.webc
component which uses adate
prop:which is fine until I have usage where the prop is left off when used (e.g. on
docs/getting-started.webc
)This collides with any top level
date
set in Eleventy’s data cascade.My proposal is to move internal components (e.g.
src/_includes/components/*
in my example) and not top level WebC template pages (e.g.*.webc
files in the Eleventy input folder) to need to reference global data in this way as$data.date
instead.This will prevent undesirable collisions but may require component code to change (if it previously accessed global data). In this above example the component doesn’t use global data and expects
date
to not have a value, thus does not require code changes.The text was updated successfully, but these errors were encountered: