eleventy-plugin-webc

Adds support for WebC *.webc files to Eleventy

Stars
116
Committers
4

Bot releases are hidden (Show)

eleventy-plugin-webc - Eleventy WebC v0.11.1 Latest Release

Published by zachleat 10 months ago

Milestone: https://github.com/11ty/eleventy-plugin-webc/milestone/11?closed=1
Full Changelog: https://github.com/11ty/eleventy-plugin-webc/compare/v0.11.0...v0.11.1

eleventy-plugin-webc - Eleventy WebC v0.11.2

Published by zachleat 10 months ago

Milestone: https://github.com/11ty/eleventy-plugin-webc/milestone/12?closed=1
Full Changelog: https://github.com/11ty/eleventy-plugin-webc/compare/v0.11.1...v0.11.2

  • Fix for Eleventy import to allow this plugin to be compatible with both ESM and CJS projects in Eleventy v3.0. #91
eleventy-plugin-webc - Eleventy WebC v0.11.0

Published by zachleat over 1 year ago

Milestone: https://github.com/11ty/eleventy-plugin-webc/milestone/10?closed=1
Full Changelog: https://github.com/11ty/eleventy-plugin-webc/compare/v0.10.1...v0.11.0

  • Upgrades to WebC v0.11.0, release notes or read more below.
  • Scopes top-level css, js, and html helpers (via https://github.com/11ty/eleventy-plugin-bundle) to webc.helpers.* This technically is a breaking change but these helpers were undocumented with WebC so it’s unlikely folks were using them directly. #65 #66

WebC 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:

eleventy-plugin-webc - Eleventy WebC v0.10.0: Declarative Loops and Flow Control

Published by zachleat over 1 year ago

Upgrades to WebC v0.10.0: more context on the full WebC Release Notes

  • webc:for for looping https://www.11ty.dev/docs/languages/webc/#webcfor-loops
  • webc:elseif and webc:else https://www.11ty.dev/docs/languages/webc/#webcelseif-and-webcelse
  • Server-only HTML comments <!--- One more dash at the start and end ---> https://www.11ty.dev/docs/languages/webc/#server-only-comments
  • <script webc:type="js"> (via implied webc:is="template") will be treated as HTML-only components and not use the host component tags (via implied webc:nokeep).
  • 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 using webc:root="override").
  • ⚠️ BREAKING (but low-impact): void elements (self-closing elements without a closing tag) used as components will be ignored in output when the component has child content. (e.g. img.webc returning an <img> without needing to use webc:root="override")

Full Changelog: https://github.com/11ty/eleventy-plugin-webc/compare/v0.9.4...v0.10.0

eleventy-plugin-webc - Eleventy WebC v0.9.4: 65% Faster

Published by zachleat over 1 year ago

What's Changed

  • Using WebC v0.9.3 Release Notes
    • 65% faster!!
    • 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!

Full Changelog: https://github.com/11ty/eleventy-plugin-webc/compare/v0.9.3...v0.9.4

eleventy-plugin-webc - Eleventy WebC v0.9.3: Bundle plugin options

Published by zachleat over 1 year ago

Full Changelog: https://github.com/11ty/eleventy-plugin-webc/compare/v0.9.2...v0.9.3

eleventy-plugin-webc - Eleventy WebC v0.9.2: Asset Bucketing, Anywhere

Published by zachleat over 1 year ago

  • Adds support for an Array (of files or globs) to be passed in via the components option.
  • Adds support for npm: prefixes in components option.

For example:

eleventyConfig.addPlugin(pluginWebc, {
	components: [
		"./_components/**/*.webc",
		"npm:@11ty/is-land/*.webc",
		"npm:@11ty/eleventy-plugin-syntaxhighlight/*.webc",
	],
});

Full Changelog: https://github.com/11ty/eleventy-plugin-webc/compare/v0.9.1...v0.9.2

Using WebC v0.9.1

WebC v0.9.1 release notes:

eleventy-plugin-webc - Eleventy WebC v0.9.1: Asset bucketing fix

Published by zachleat over 1 year ago

eleventy-plugin-webc - Eleventy WebC v0.8.0: Little Bundler of Joy

Published by zachleat almost 2 years ago

Breaking Changes

  • Enables Bundler mode consistently for all WebC files (notably, this was not enabled for Eleventy Layout files previously). Read more at #33 and #11.
    • ACTION NEEDED 🚨 You will need to add webc:keep to any <style> or <script> tags in Eleventy Layout WebC files to prevent them from being re-bundled out of existence! (You can check out an example of a WebC file as an Eleventy Layout on the WebC docs)
    • This was important as it allows the use of WebC components in Eleventy Layout files and will bundle their assets as expected. Read more about WebC Bundler Mode
  • From WebC v0.8.0: attribute-name properties and attributes are now available in data as camel-case: attribute-name in JS data is attributeName. Read more at @11ty/webc#71

WebC release notes:

Milestone: https://github.com/11ty/eleventy-plugin-webc/milestone/6?closed=1
Full Changelog: https://github.com/11ty/eleventy-plugin-webc/compare/v0.7.0...v0.8.0

eleventy-plugin-webc - Eleventy WebC v0.7.0

Published by zachleat almost 2 years ago

Breaking Changes

Fixes

WebC version updates:

Milestone: https://github.com/11ty/eleventy-plugin-webc/milestone/5?closed=1
Full Changelog: https://github.com/11ty/eleventy-plugin-webc/compare/v0.6.0...v0.7.0

eleventy-plugin-webc - Eleventy WebC v0.5.1

Published by zachleat about 2 years ago

  • Fixes bug with removing a component file during --watch or --serve #13
  • Documentation improvement to note project-root relative components directory option #12

Milestone: https://github.com/11ty/eleventy-plugin-webc/milestone/2?closed=1
Full Changelog: https://github.com/11ty/eleventy-plugin-webc/compare/v0.5.0...v0.5.1

eleventy-plugin-webc - Eleventy WebC v0.5.0

Published by zachleat about 2 years ago