Releases: ProjectEvergreen/wcc
0.19.0
Overview
This release improves WCC's JSX transformations for inferredObservability to be fine grained.
Changelog
https://github.com/ProjectEvergreen/wcc/issues?q=label%3A0.19.0
Breaking Changes
N / A
Known Issues
N / A
Diff
0.18.1
Overview
This release fixes a couples bugs with WCC types and JSX transformations.
Changelog
https://github.com/ProjectEvergreen/wcc/issues?q=label%3A0.18.1
- fix: #219 preserve JSX literal attribute expressions
- fix: #193 add missing source property on the
Metadatatype - chore: fix grammar in README
Breaking Changes
N / A
Known Issues
N / A
Diff
0.18.0
Overview
This release adds TSX parsing support (including type safe HTML!) to the JSX capabilities of WCC.
Changelog
https://github.com/ProjectEvergreen/wcc/issues?q=label%3A0.18.0
Breaking Changes
N / A
Known Issues
N / A
Diff
0.17.1
Overview
This release adds some typings for WCC and makes some breaking changes around the API supporting Node's custom loaders (including TypeScript support), sets a new minimum NodeJS version, and drops the CommonJS distribution. The shape for Metadata was also changed.
Changelog
https://github.com/ProjectEvergreen/wcc/issues?q=label%3A0.17.0
Breaking Changes
N / A
Known Issues
N / A
Diff
v0.17.0
Overview
This release introduces native support for TypeScript (type stripping) WCC, adopt's Node's new loaders API, and bump the minimum Node version >= 18.
Changelog
https://github.com/ProjectEvergreen/wcc/issues?q=label%3A0.17.1
- Add typings for WCC
- Leverage native NodeJS TypeScript support
- Set minimum NodeJS version to >= 18
- Adopt new NodeJS loaders API for custom imports
- drop support for CommonJS distribution
Breaking Changes
Minimum NodeJS Version
The minimum NodeJS version for WCC is now >= 18.x
Custom Loaders (JSX / TS)
TypeScript
Support is now built-in, you no longer need to use the custom loader anymore. Follow these steps / guidelines:
- You will need to use Node
>= 22.6.0and set the--experimental-strip-typesflag (or>= 23.xwithout the flag) - (Optional) Install TypeScript into your project, e.g.
npm i typescript --save-dev - (Optional) Create a tsconfig.json file at the root of your project with these minimum configuration settings
JSX
For the JSX custom loader, you'll now need to use the new --import API and WCC's register function instead
# before
$ node --loader ./node_modules/wc-compiler/src/jsx-loader.js your-script.js# after
$ node --import ./node_modules/wc-compiler/src/register.js your-script.js
# or
$ NODE_OPTIONS="--import wc-compiler/register" node your-script.jsMetadata
When calling renderToString or renderFromHTML, WCC optionally returns a metadata object with all the custom elements registered / detected, and any relevant details. The original shape of this object as documented was a bit broken, and so it has been "fixed" now to make sense
// before (some sort of array like object)
{
metadata: [
'wcc-footer': { instanceName: 'Footer', moduleURL: [URL], isEntry: true },
'wcc-header': { instanceName: 'Header', moduleURL: [URL], isEntry: true },
'wcc-navigation': { instanceName: 'Navigation', moduleURL: [URL], isEntry: false }
]
}// after (an object)
{
metadata: {
'wcc-footer': { instanceName: 'Footer', moduleURL: [URL], isEntry: true },
'wcc-header': { instanceName: 'Header', moduleURL: [URL], isEntry: true },
'wcc-navigation': { instanceName: 'Navigation', moduleURL: [URL], isEntry: false }
}
}CommonJS Bundle
We have removed support for the CommonJS bundle / distribution.
Known Issues
N / A
Diff
v0.16.0
Overview
This release refactors some WCC's DOM shim internals as well as address issues with setting element properties and honoring the mode option for attachShadow. There was also a breaking change to remove the deprecated getInnerHTML call with getHTML on the Node class in the DOM shim.
Changelog
https://github.com/ProjectEvergreen/wcc/issues?q=label%3A0.16.0
- Replace deprecated method
getInnerHTMLwithgetHTML(thank you @DannyMoerkerke 🙌 ) - refactor DOM shim internals (thank you very much @briangrider 🙌 )
- Issue Setting Element Properties (thank you @briangrider 🙌 )
- support configurable
shadowrootmodeattribute for<template>tags (thank you @briangrider 🙌 ) - verify / ensure proper serialization of shadow roots excluding closed shadow roots from
getInnerHTMLgetHTML(thank you @briangrider 🙌 ) - Upgrade parse5 to v7
Breaking Changes
DOM Shim
On the Node class, the getInnerHTML method has been deprecated and replaced with getHTML to align with the spec
// before
import 'wc-compiler/src/dom-shim.js';
import Greeting from './components/greeting.js';
const greeting = new Greeting();
const html = greeting.getInnerHTML({ includeShadowRoots: true });// after
import 'wc-compiler/src/dom-shim.js';
import Greeting from './components/greeting.js';
const greeting = new Greeting();
const html = greeting.getHTML({ serializableShadowRoots: true });Shadow Root Templates
Setting innerHTML on a Shadow Root will now automatically insert a <template> tag when using renderToString / renderFromHTML, e.g.
class MyComponent extends HTMLElement {
connectedCallback() {
if (!this.shadowRoot) {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
:root {
--accent: #367588;
}
</style>
<main>
<h1>My Website</h1>
</main>
`;
}
}
}
export default Home;Known Issues
N / A
Diff
v0.15.1
Overview
This release fixes issues with standard JavaScript failing parsing and removes needs for a specific dependency for parsing Import Attributes.
Changelog
https://github.com/ProjectEvergreen/wcc/issues?q=label%3A0.15.1
Breaking Changes
N / A
Known Issues
N / A
Diff
v0.15.0
Overview
This release introduces formal support for HTML (Light DOM) Web Components and fixing a bug for "top level" attributes not serializing and showing up as undefined.
Changelog
https://github.com/ProjectEvergreen/wcc/issues?q=label%3A0.15.0
Breaking Changes
N / A
Known Issues
N / A
Diff
v0.14.0
Overview
This release introduces parsing support for TypeScript authored custom elements.
Changelog
https://github.com/ProjectEvergreen/wcc/issues?q=label%3A0.14.0
Breaking Changes
N / A
Known Issues
N / A
Diff
v0.13.0
Overview
This release introduces support for parsing Import Attributes syntax and and a basic no-op DOM shim for CSSStyleSheet (Constructable Stylesheets).
Changelog
https://github.com/ProjectEvergreen/wcc/issues?q=label%3A0.13.0
- Import Attributes syntax parsing
- Support Constructable Stylesheets (CSS Modules) in DOM Shim
- WCC dropping query params when loading module URLs
Breaking Changes
N / A
Known Issues
N / A
Diff
$ git diff 0.12.1 0.13.0 --stat
.eslintrc.cjs | 10 +
.nvmrc | 2 +-
docs/pages/docs.md | 6 +-
docs/pages/index.md | 1 +
package-lock.json | 1398 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
package.json | 13 +-
src/dom-shim.js | 12 +-
src/jsx-loader.js | 6 +-
src/wcc.js | 17 +-
test/cases/constructable-stylesheet/constructabe-stylesheet.spec.js | 38 ++
test/cases/constructable-stylesheet/src/components/header/header.js | 23 +
test/cases/constructable-stylesheet/src/pages/index.js | 10 +
test/cases/import-attributes/import-attributes.spec.js | 48 ++
test/cases/import-attributes/src/components/header/data.json | 3 +
test/cases/import-attributes/src/components/header/header.js | 17 +
test/cases/import-attributes/src/pages/index.js | 10 +
16 files changed, 1576 insertions(+), 38 deletions(-)