Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for webc:bucket on any tag, cascade to all child content #122

Closed
zachleat opened this issue Mar 2, 2023 · 0 comments
Closed
Labels
enhancement New feature or request
Milestone

Comments

@zachleat
Copy link
Member

zachleat commented Mar 2, 2023

This is related to the Asset Bucketing feature, webc:bucket: https://www.11ty.dev/docs/languages/webc/#asset-bucketing

Currently this attribute only works on style, link rel="stylesheet", or script. This would allow authors to add this attribute to any element and would apply the bucket value to any child content in the tree under the node.

Furthermore, also add a hoisting feature to de-duplicate content that is added to multiple distinct buckets.

For example:

<div webc:bucket="inherited-bucket">
    <component></component>
    <component webc:bucket="my-bucket-override"></component>
</div>
  • <component></component> has an inherited bucket value of inherited-bucket
  • <component webc:bucket="my-bucket-override"></component> has a bucket value of 'my-bucket-override' but this is ignored.
  • The closest bucket value that works for both <component> instances is used, in this case inherited-bucket.

Another example:

<component></component>
<component webc:bucket="my-bucket-override"></component>
  • <component></component> has an implied bucket value of default
  • <component webc:bucket="my-bucket-override"></component> has a bucket value of 'my-bucket-override' but this is ignored.
  • The closest bucket value that works for both <component> instances is used, in this case default.

Another example:

<component webc:bucket="my-bucket-override"></component>
<component webc:bucket="my-bucket-override"></component>
  • <component webc:bucket="my-bucket-override"></component> both have a bucket value of 'my-bucket-override' and it is used.

Marginally related to 11ty/eleventy-plugin-bundle#5

@zachleat zachleat added the enhancement New feature or request label Mar 2, 2023
@zachleat zachleat added this to the Next version milestone Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant