![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
eleventy-plugin-wcc
Advanced tools
Eleventy plugin for rendering native Web Components using Web Components Compiler (WCC).
A starter kit for 11ty + WCC is also available.
Install from NPM.
$ npm install eleventy-plugin-wcc --save-dev
Add the plugin to your eleventy.js config and provide a URL
for all top level custom element definitions you use.
const path = require('path');
const { pathToFileURL } = require('url');
const wccPlugin = require('./src/index');
module.exports = function(eleventyConfig) {
eleventyConfig.addPlugin(wccPlugin, {
definitions: [
pathToFileURL(path.join(__dirname, './src/js/my-element.js'))
]
});
};
Write a custom element like below. In this case, we are using Declarative Shadow DOM.
// src/js/greeting.js
const template = document.createElement('template');
template.innerHTML = `
<p>Hello from the greeting component!</p>
`;
class GreetingComponent extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: 'open' });
}
async connectedCallback() {
this.shadowRoot.appendChild(template.content.cloneNode(true));
}
}
module.exports = GreetingComponent; // using module.exports!
customElements.define('x-greeting', GreetingComponent);
Note: Since Eleventy does not support ESM yet, you will need to use
module.exports = XXX
instead ofexport default XXX
for your definitions.
Add your custom element paths to your .eleventy.js config
const path = require('path');
const { pathToFileURL } = require('url');
const wccPlugin = require('eleventy-plugin-wcc');
module.exports = function(eleventyConfig) {
eleventyConfig.addPlugin(wccPlugin, {
definitions: [
pathToFileURL(path.join(__dirname, './src/js/greeting.js'))
]
});
};
Now in your content or layouts, use the custom element.
<!-- src/index.md -->
# Hello From 11ty + WCC! 👋
<x-greeting></x-greeting>
Now if you run eleventy
, you should get an index.html in your site/ directory with the custom element content pre-rendered! 🎈
<h2>Hello From 11ty + WCC!</h2>
<p>
<x-greeting>
<template shadowroot="open">
<p>Hello from the greeting component!</p>
</template>
</x-greeting>
</p>
Coming soon!
Please follow along in our issue tracker or make a suggestion!
FAQs
An Eleventy plugin for rendering Web Components with WCC.
The npm package eleventy-plugin-wcc receives a total of 0 weekly downloads. As such, eleventy-plugin-wcc popularity was classified as not popular.
We found that eleventy-plugin-wcc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.