Releases: 11ty/webc
WebC v0.12.0-beta.2
- Fixes
webc:scoped
issue with@supports selector(*)
parsing #232 - Fixes issue with
slots.text.default
scoping (3/3) #165
Full Changelog: v0.12.0-beta.1...v0.12.0-beta.2
WebC v0.12.0-beta.1
- Breaking: Node minimum 18+
- Breaking:
export default
is now required when usingwebc:type="js"
andwebc:type="render"
and drops support for CommonJSmodule.exports
. See more examples at #229 (notably, this change also aliaseswebc:type="render"
towebc:type="js"
and they have the same code path now) - Breaking: ESM
export
keyword is now required inwebc:setup
for anything you want to use inside the component (no more implicit globals). Implicit globals from the data cascade are not available here (use$data.*
instead)- Fix for leaking page context across multiple instances of components using
webc:setup
nodes #174 This means stale access topage
is no longer available inwebc:setup
- Fix for leaking page context across multiple instances of components using
- Adds ESM support (including
import
, thoughrequire
is also still available) towebc:setup
,webc:type="js", and
webc:type="render". Swapped to useimport-module-string
instead ofnode-retrieve-globals
in #229 #226 #225 - Fix to
@attributes
andwebc.renderAttributes
to preserve original attribute names (fixes dashes being stripped) #163 #202, #178, #216 - Fix to
webc:for
to preserve variable context on nested loops #175 - Fix to
webc:for
to work withSet
andMap
(or anything that isArray.from
-friendly) #179 - Fix double-escaping bug with HTML entities inside
<style>
content assigned via@raw
and@html
#208 - Tests added for
webc:if
short-circuit to skip dynamic attribute evaluation #191 - Fix bug with
webc:if
on multiple subsquent void sibling elements #217 - Adds links in npm config by @nichoth in #223
- Use
node:
protocol in imports by @Zearin in #168 - Fix npm audit in
nanoid
dependency #218 - Fix
slots.text
still referencing the wrong component #165
Major version dependency upgrades:
Name | Version | Changelog | Notable |
---|---|---|---|
css-tree | ^2.3.1 → ^3.1.0 | Changelog | CSS support changes |
dependency-graph | ^0.11.0 → ^1.0.0 | Changelog | Internals only |
entities | ^4.5.0 → ^6.0.1 | Changelog and Changelog | Deep import file locations moved |
nanoid | ^4.0.2 → ^5.1.5 | Changelog | Node 18+ |
parse5 | ^7.3.0 → ^8.0.0 | Changelog | ESM-only |
Milestone: https://github.com/11ty/webc/milestone/23?closed=1
Full Changelog: v0.11.4...v0.12.0-beta.1
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