Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
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.
wc-compiler
Advanced tools
Experimental Web Components compiler. It's Web Components all the way down! 🐢
const template = document.createElement('template');
template.innerHTML = `
<style>
.footer {
color: white;
background-color: #192a27;
}
</style>
<footer class="footer">
<h4>My Blog © ${new Date().getFullYear()}</h4>
</footer>
`;
class Footer extends HTMLElement {
connectedCallback() {
if (!this.shadowRoot) {
this.attachShadow({ mode: 'open' });
this.shadowRoot.appendChild(template.content.cloneNode(true));
}
}
}
export default Footer;
customElements.define('wcc-footer', Footer);
import { renderToString } from 'wc-compiler';
const { html } = await renderToString(new URL('./path/to/component.js', import.meta.url));
<wcc-footer>
<template shadowroot="open">
<style>
.footer {
color: white;
background-color: #192a27;
}
</style>
<footer class="footer">
<h4>My Blog © 2022</h4>
</footer>
</template>
</wcc-footer>
WCC runs on NodeJS and can be installed from npm.
$ npm install wc-compiler --save-dev
If you need CommonJS support, a separate pre-bundled (with Rollup) distribution of WCC is available at dist/wcc.dist.js. Example:
const { renderToString } = require('wc-compiler/dist/wcc.dist');
See our website for API docs and examples.
WCC is not a static site generator, framework or bundler. It is focused on producing raw HTML from Web Components with the intent of being easily integrated into a site generator or framework, like Greenwood, the original motivation for creating this project.
In addition, WCC hopes to provide a surface area to explore patterns around streaming and serverless rendering, as well as acting as a test bed for the Web Components Community Groups discussions around community protocols, like hydration.
FAQs
Experimental native Web Components compiler.
The npm package wc-compiler receives a total of 8 weekly downloads. As such, wc-compiler popularity was classified as not popular.
We found that wc-compiler demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
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.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.