Last Updated: 2018-01-23
Status: Draft
import {ApolloClient, NormalizedCacheObject} from '@apollo/client/core'; | |
/** | |
* Fired when an Apollo controller is connected to the document tree via its | |
* host. Listeners should supply an Apollo client by setting the `client` | |
* property on the event. | |
*/ | |
export class ApolloControllerConnectedEvent extends Event { | |
static readonly eventName = 'apollo-controller-connected'; |
class ExampleElement extends ObservableLitElement { | |
@property() | |
src: string; | |
@observe('src') | |
protected async _onSrcChange() { | |
// fetch the new URL... | |
} | |
} |
Last Updated: 2018-01-23
Status: Draft
Domenic's blöcks proposal outlines a way to conveniently define functions that run in another worker/worklet as an inline, non-capturing scope, function body.
Blöcks as proposed have a few open questions and lack a few features that could generalize them to more use cases and with more practical ergonomics.
import type {ReactiveController, ReactiveControllerHost} from 'lit'; | |
/** | |
* A reactive controller that updates a host when slotted content changes and | |
* provides helper methods for checking and getting assigned slot content. | |
*/ | |
export class SlotController implements ReactiveController { | |
private _host: ReactiveControllerHost & Element; | |
private _slotNames?: ReadonlyArray<string>; |
Outdated - current proposal is at https://github.com/justinfagnani/scoped-custom-elements
Scoped Custom Element definitions is an oft-requested feature of Web Components. The global registry is a possible source of name collisions that may arise from coincidence, or from an app trying to define multiple versions of the same element, or from more advanced scenarios like registering mocks during tests, or a component explicitly replacing an element definition for its scope.
Since the key DOM creation APIs are global, scoping definitions is tricky because we'd need a machanis to determind which scope to use. But if we offer scoped versions of these APIs the problem is tractable. This requires that DOM creation code is upgraded to use the new scoped APIs, something that hopefully could be done in template libraries and frameworks.