Releases: 11ty/webc
WebC v0.11.3: WebC inside Declarative Shadow DOM
- Allows WebC content inside Declarative Shadow DOM templates #117
- Adds
webc:nobundle
feature to opt-out nodes (and children) from bundling. webc:nobundle
is implied on Declarative Shadow DOM templates.
- Adds
- Bug fix for custom transforms as slottable content #118
- Adds a few more tests to the suite for
webc:for
from @sombriks in #161
Milestone: https://github.com/11ty/webc/milestone/21?closed=1
Full Changelog: v0.11.2...v0.11.3
WebC v0.11.2: Fixes for slottable content
- Fixed: Slottable content was accessing the wrong component definition for global data access and
webc:setup
scripts #152 #154
Milestone: https://github.com/11ty/webc/milestone/20?closed=1
Full Changelog: v0.11.1...v0.11.2
WebC v0.11.1: Quick fix for data access on slotted content
Regression quick fix:
- Slotted content (in a top level component) should have access to global data without using
$data
, fixes #152
Full Changelog: v0.11.0...v0.11.1
Milestone: https://github.com/11ty/webc/milestone/19?closed=1
WebC v0.11.0: Child Components accessing Global Data
Milestone: https://github.com/11ty/webc/milestone/18?closed=1
Full Changelog: v0.10.1...v0.11.0
Child components will now need to access global data through a top level $data
variable instead of as top level variables. This is important to prevent global data leaking into component data and affecting component logic.
This will not affect pages or top-level WebC components (in Eleventy world, these are *.webc
files as Eleventy layouts or in as pages in your input folder). This only affects child components (in Eleventy world, this means files in your components folder, e.g. _components/**/*.webc
).
- Read more at #151.
- Here’s the commit that was required to upgrade 11ty.dev to WebC v0.11.0.
Sorry to have to make this breaking change, but it’s an important one.
Other fixes in this release:
v0.10.1: New built-in `webc.*` helpers
- Adds
webc.escapeText
function - Adds
webc.escapeAttribute
function - Adds
webc.filterPublicAttributes
function
Docs for the above: https://www.11ty.dev/docs/languages/webc/#extra-data-for-javascript-render-functions
Milestone: https://github.com/11ty/webc/milestone/17?closed=1
Full Changelog: v0.10.0...v0.10.1
WebC v0.10.0: Declarative Loops and Flow Control
webc:for
for looping https://www.11ty.dev/docs/languages/webc/#webcfor-loops #28webc:elseif
andwebc:else
https://www.11ty.dev/docs/languages/webc/#webcelseif-and-webcelse #136- Server-only HTML comments
<!--- One more dash at the start and end --->
https://www.11ty.dev/docs/languages/webc/#server-only-comments #126 <script webc:type="js">
(via `webc:is="template") will be treated as HTML-only components and not use the host component tags. #135- Relax circular dependency errors: instead of throwing an error, we now treat this as a plain HTML tag instead of a WebC component. This makes it easier to override HTML tags (e.g.
img.webc
returning an<img>
without needing usingwebc:root="override"
). #138 ⚠️ BREAKING (but low-impact): void elements used as components will be ignored in output when the component has child content. (e.g.img.webc
returning an<img>
without needing usingwebc:root="override"
) #107.
Integrations
- New
koa
WebC integration example added by @sombriks in #134 - Eleventy WebC v0.10.0: https://github.com/11ty/eleventy-plugin-webc/releases/tag/v0.10.0
Milestone: https://github.com/11ty/webc/issues?q=is%3Aclosed+milestone%3A%22WebC+v0.10.0%22
Full Changelog: v0.9.3...v0.10.0
WebC v0.9.3: 65% Faster
What's Changed
- Added a WebC component cache
- Shamefully large performance wins via changes to Node
vm.createContext
A special thanks to @marvinhagemeister’s Node profiling recommendation!
How fast is it?
From a large sample WebC project:
Before, using WebC v0.9.2:
> Wrote 2621 files in 21.17 seconds (8.1ms each, v2.0.0)
After, using WebC v0.9.3:
> Wrote 2621 files in 7.24 seconds (2.8ms each, v2.0.0)
From 8.1ms per template to 2.8ms per template!
Integrations
Full Changelog: v0.9.2...v0.9.3
WebC v0.9.2
- Fixes bug with
webc:bucket
hoisting (adding to a non-default
bucket and then thedefault
bucket should remove code from the non-default
bucket) - Fixes bug with CSS/JS bundle ordering based on component graph. Code should render in order from leaf components to page, where page CSS/JS is rendered last (e.g. this test case 57f0f11)
Full Changelog: v0.9.1...v0.9.2
WebC v0.9.1
- Adds support for
webc:bucket
on any tag and it will cascade to all child content (with automatic hoisting when necessary) #122 - Adds support for
webc:bucket
to be dynamic (e.g.:webc:bucket="myJavaScriptData"
) #120 - Adds support for globs when passing an Array to
WebC.getComponentsMap()
#123 - Adds
npm:
aliasing support toWebC.getComponentsMap()
#123
Full Changelog: v0.9.0...v0.9.1
Milestone: https://github.com/11ty/webc/milestone/14?closed=1
WebC v0.9.0
⚠️ ⚠️ ⚠️ Breaking (risk: 3/5, likely requires changes): You must usewebc:root="override"
instead ofwebc:root webc:keep
to override the host component tag #112⚠️ ⚠️ Breaking (risk: 2/5):webc:raw
is no longer implied on<template>
and<noscript>
#105- ✅ Breaking (risk: 1/5): Using
webc:type="js"
now has an impliedwebc:is="template" webc:nokeep
to render child content as WebC HTML by default (override with your ownwebc:is
and/orwebc:keep
). Related Docs #91 - Breaking (risk: 0/5): Removes internal WebC
getComponentList
method to simplify code base, no longer needed for incremental WebC builds in Eleventy #113
Features
- New
<script webc:setup>
feature to use arbitrary JavaScript to export data for use in the component #109 - Support new
shadowrootmode
attribute to opt-out of asset bundling in Declarative Shadow DOM #108 - New
@attributes
feature to render an attributes object #114 - New
:@
prefix for dynamic properties (e.g.:@dynamic-property
) #94 #98 webc:ignore
will completely ignore a node (no processing or output) #110- Support :host() and :host-context() pseudo classes in
webc:scoped
by @Gyanreyer in #96
Fixes
- More Node.js
global
support inwebc:type="js"
#116, #99, #100 - Fix bug with component rendering mode with leading whitespace on page #115
- Fix for missing helpers in JavaScript Render Functions (
webc:type="js"
andwebc:type="render"
)
Full Milestone: https://github.com/11ty/webc/milestone/13?closed=1
Full Changelog: v0.8.0...v0.9.0