{"id":13806821,"url":"https://github.com/ProjectEvergreen/wcc","last_synced_at":"2025-05-13T22:30:50.575Z","repository":{"id":37442808,"uuid":"477486973","full_name":"ProjectEvergreen/wcc","owner":"ProjectEvergreen","description":"Experimental native Web Components compiler.","archived":false,"fork":false,"pushed_at":"2025-04-05T16:41:40.000Z","size":811,"stargazers_count":106,"open_issues_count":25,"forks_count":10,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-25T00:45:53.289Z","etag":null,"topics":["greenwood","ssr","webcomponents"],"latest_commit_sha":null,"homepage":"https://merry-caramel-524e61.netlify.app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ProjectEvergreen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-03T23:00:27.000Z","updated_at":"2025-04-05T16:41:43.000Z","dependencies_parsed_at":"2024-05-03T11:14:26.314Z","dependency_job_id":"8ff9766c-f2ea-4a45-968e-18af691982b0","html_url":"https://github.com/ProjectEvergreen/wcc","commit_stats":{"total_commits":101,"total_committers":2,"mean_commits":50.5,"dds":0.01980198019801982,"last_synced_commit":"316ff4c029e4c16f7b834cb94c12b7c3e55fbb05"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProjectEvergreen%2Fwcc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProjectEvergreen%2Fwcc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProjectEvergreen%2Fwcc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProjectEvergreen%2Fwcc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ProjectEvergreen","download_url":"https://codeload.github.com/ProjectEvergreen/wcc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254036812,"owners_count":22003655,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["greenwood","ssr","webcomponents"],"created_at":"2024-08-04T01:01:16.666Z","updated_at":"2025-05-13T22:30:50.568Z","avatar_url":"https://github.com/ProjectEvergreen.png","language":"JavaScript","funding_links":[],"categories":["Meta Frameworks"],"sub_categories":["Svelte"],"readme":"\u003cimg src=\"https://merry-caramel-524e61.netlify.app/assets/wcc-logo.png\" width=\"30%\"/\u003e\n\n# Web Components Compiler (WCC)\n\n[![Netlify Status](https://api.netlify.com/api/v1/badges/e718eac2-b3bc-4986-8569-49706a430beb/deploy-status)](https://app.netlify.com/sites/merry-caramel-524e61/deploys)\n[![GitHub release](https://img.shields.io/github/tag/ProjectEvergreen/wcc.svg)](https://github.com/ProjectEvergreen/wcc/tags)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/ProjectEvergreen/wcc/master/LICENSE.md)\n[![NodeJS compatibility](https://img.shields.io/node/v/wc-compiler.svg)](https://nodejs.org/en/about/previous-releases\")\n[![Discord Chat](https://img.shields.io/badge/chat-discord-blue?style=flat\u0026logo=discord)](https://www.greenwoodjs.dev/discord/)\n\n\u003e _Experimental Web Components compiler.  It's Web Components all the way down!_  🐢\n\n## How It Works\n\n1. Write a Web Component\n    ```js\n    const template = document.createElement('template');\n\n    template.innerHTML = `\n      \u003cstyle\u003e\n        .footer {\n          color: white;\n          background-color: #192a27;\n        }\n      \u003c/style\u003e\n\n      \u003cfooter class=\"footer\"\u003e\n        \u003ch4\u003eMy Blog \u0026copy; ${new Date().getFullYear()}\u003c/h4\u003e\n      \u003c/footer\u003e\n    `;\n\n    class Footer extends HTMLElement {\n      connectedCallback() {\n        if (!this.shadowRoot) {\n          this.attachShadow({ mode: 'open' });\n          this.shadowRoot.appendChild(template.content.cloneNode(true));\n        }\n      }\n    }\n\n    export default Footer;\n\n    customElements.define('wcc-footer', Footer);\n    ```\n1. Run it through the compiler\n    ```js\n    import { renderToString } from 'wc-compiler';\n\n    const { html } = await renderToString(new URL('./path/to/component.js', import.meta.url));\n    ```\n1. Get HTML!\n    ```html\n    \u003cwcc-footer\u003e\n      \u003ctemplate shadowrootmode=\"open\"\u003e\n        \u003cstyle\u003e\n          .footer {\n            color: white;\n            background-color: #192a27;\n          }\n        \u003c/style\u003e\n\n        \u003cfooter class=\"footer\"\u003e\n          \u003ch4\u003eMy Blog \u0026copy; 2022\u003c/h4\u003e\n        \u003c/footer\u003e\n      \u003c/template\u003e\n    \u003c/wcc-footer\u003e\n    ```\n\n## Installation\n\n**WCC** runs on NodeJS and can be installed from npm.\n\n```shell\n$ npm install wc-compiler --save-dev\n```\n\n## Documentation\n\nSee our [website](https://merry-caramel-524e61.netlify.app/) for API docs and examples.\n\n## Motivation\n\n**WCC** is not a static site generator, framework or bundler.  It is designed with the intent of being able to produce raw HTML from standards compliant Web Components and easily integrated _into_ a site generator or framework, like [**Greenwood**](https://www.greenwoodjs.dev).  The Project Evergreen team also maintains similar integrations for [**Eleventy**](https://github.com/ProjectEvergreen/eleventy-plugin-wcc/) and [Astro](https://github.com/ProjectEvergreen/astro-wcc).\n\nIn addition, **WCC** hopes to provide a surface area to explore patterns around [streaming](https://github.com/ProjectEvergreen/wcc/issues/5), [serverless and edge rendering](https://github.com/thescientist13/web-components-at-the-edge), and as acting as a test bed for the [Web Components Community Groups](https://github.com/webcomponents-cg)'s discussions around community protocols, like [hydration](https://github.com/ProjectEvergreen/wcc/issues/3).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FProjectEvergreen%2Fwcc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FProjectEvergreen%2Fwcc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FProjectEvergreen%2Fwcc/lists"}