Open Web Components: guides, tools and libraries for developing web components.
MIT License
Bot releases are visible (Hide)
549c2efe: fix(testing-helpers): correct type declaration for oneEvent
preventDefault
parameter is not used
Published by github-actions[bot] 8 months ago
Published by github-actions[bot] 9 months ago
Published by github-actions[bot] 9 months ago
@open-wc/scoped-elements
as side-effect freePublished by github-actions[bot] 9 months ago
Published by github-actions[bot] 10 months ago
Published by github-actions[bot] 11 months ago
Published by github-actions[bot] 12 months ago
Published by github-actions[bot] 12 months ago
c69af75f: chore: update @open-wc/scoped-elements to v3
If you're using a fixture like so with scoped elements:
await fixture(html`...`, { scopedElements: ... });
You're gonna have to load the @webcomponents/scoped-custom-element-registry polyfill yourself first.
Published by github-actions[bot] 12 months ago
If you're using a fixture like so with scoped elements:
await fixture(html`...`, { scopedElements: ... });
You're gonna have to load the @webcomponents/scoped-custom-element-registry polyfill yourself first.
Published by github-actions[bot] 12 months ago
Published by github-actions[bot] 12 months ago
Published by github-actions[bot] 12 months ago
Published by github-actions[bot] 12 months ago
v3.x
89fb5601: Add type entrypoint which enables you to get more advanced type information like
import { ScopedElementsHost } from '@open-wc/scoped-elements/types.js';
__registry
actually exists on the current class, not a parent.ScopedElementsMixin
type info to include createScopedElement
3bb2f979: BREAKING CHANGE: Work without polyfill if possible (and do not auto load polyfill)
ScopedElementsMixin 2.x tried to be as convenient as possible by automatically loading the scoped custom elements registry polyfill.
This however led to a fatal error whenever you registered any component before ScopedElementsMixin was used.
The error especially happened when you would import a component applying ScopedElementsMixin into an existing application, fundamentally going against the "import and use" nature of web components.
Therefore, we decided to not load the polyfill inside the mixin, but let the developer (optionally) load it on top of his/her app.
This means that, depending on the app of the developer, the change can be breaking. After updating to this latest version, two scenarios will be possible:
Only the second case requires an action. The remaining error can be resolved via a small migration path, a breaking bugfix if you will, which should be treated as if it were a security breaking change: consumers do the breaking bug fix on their end, because releasing a new major version would not be beneficial, neither to us nor to our consumers.
Not loading the polyfill by default will also allow sites to opt out of it altogether. This means until the browser ships scoped registries, the developer can choose to fall back to the global registry, by not loading the polyfill. This will save bandwidth & complexity since it doesn't need to be loaded by the client in that case.
All previous 2.x versions will be deprecated and scoped element will behave as follows:
- const myButton = this.shadowRoot.createElement('my-button');
+ const myButton = this.createScopedElement('my-button');
This also removes @webcomponents/scoped-custom-element-registry
as a production dependency.
If you need scoping be sure to load the polyfill before any other web component gets registered.
It may look something like this in your HTML
<script src="/node_modules/@webcomponents/scoped-custom-element-registry/scoped-custom-element-registry.min.js"></script>
or if you have an SPA you can load it at the top of your app shell code
import '@webcomponents/scoped-custom-element-registry';
You need scoping if you want to
edca5a82: Adds compatibility for lit with lit-html v2
and lit-element v3
.
This version does NOT work with lit-element v2 - please use Scoped Elements v1 for it
Uses a CustomElementsRegistry
instance for each component class instead of for each component instance. In case you need to have a registry for each component instance, you must override the registry get
and set
methods to bind the registry to the component instance
/** @override */
get registry() {
return this.__registry;
}
/** @override */
set registry(registry) {
this.__registry = registry;
}
getScopedTagName
became deprecated - use the native el.tagName
instead
loadPolyfill.js
as a side effectloadPolyfill.js
as a side effectedca5a82: Adds compatibility for lit with lit-html v2
and lit-element v3
.
This version does NOT work with lit-element v2 - please use Scoped Elements v1 for it
Uses a CustomElementsRegistry
instance for each component class instead of for each component instance. In case you need to have a registry for each component instance, you must override the registry get
and set
methods to bind the registry to the component instance
/** @override */
get registry() {
return this.__registry;
}
/** @override */
set registry(registry) {
this.__registry = registry;
}
getScopedTagName
became deprecated - use the native el.tagName
instead
getScopedTagName
method to stop being a static method.All notable changes to this project will be documented in this file.
See Conventional Commits for commit guidelines.
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Note: Version bump only for package @open-wc/scoped-elements
Published by github-actions[bot] 12 months ago
Published by github-actions[bot] 12 months ago
Published by github-actions[bot] 12 months ago
Published by github-actions[bot] 12 months ago
Published by github-actions[bot] 12 months ago
Published by github-actions[bot] 12 months ago