Skip to content

Releases: 11ty/webc

WebC v0.12.0-beta.2

28 Aug 18:58
Compare
Choose a tag to compare
WebC v0.12.0-beta.2 Pre-release
Pre-release
  • 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

22 Aug 15:11
Compare
Choose a tag to compare
WebC v0.12.0-beta.1 Pre-release
Pre-release
  • Breaking: Node minimum 18+
  • Breaking: export default is now required when using webc:type="js" and webc:type="render" and drops support for CommonJS module.exports. See more examples at #229 (notably, this change also aliases webc:type="render" to webc:type="js" and they have the same code path now)
  • Breaking: ESM export keyword is now required in webc: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 to page is no longer available in webc:setup
  • Adds ESM support (including import, though require is also still available) to webc:setup, webc:type="js", and webc:type="render". Swapped to use import-module-string instead of node-retrieve-globals in #229 #226 #225
  • Fix to @attributes and webc.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 with Set and Map (or anything that is Array.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

06 Apr 20:48
Compare
Choose a tag to compare
  • 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.
  • 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

04 Apr 16:52
Compare
Choose a tag to compare
  • 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

31 Mar 17:29
Compare
Choose a tag to compare

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

31 Mar 14:51
Compare
Choose a tag to compare

Milestone: https://github.com/11ty/webc/milestone/18?closed=1
Full Changelog: v0.10.1...v0.11.0

⚠️ BREAKING ⚠️ This will affect your component code if you relied on global data from inside of component definitions.

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).

Sorry to have to make this breaking change, but it’s an important one.

Other fixes in this release:

  • Fix for webc:scoped with @keyframes and percentages. #145
  • Fix bug with webc:setup feeding Arrays into webc:for #150

v0.10.1: New built-in `webc.*` helpers

29 Mar 20:19
Compare
Choose a tag to compare
  • 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

24 Mar 22:24
Compare
Choose a tag to compare

Integrations

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

15 Mar 21:43
Compare
Choose a tag to compare

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

07 Mar 17:26
Compare
Choose a tag to compare
  • Fixes bug with webc:bucket hoisting (adding to a non-default bucket and then the default 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