diff --git a/.changeset/curly-cars-peel.md b/.changeset/curly-cars-peel.md new file mode 100644 index 0000000000..c0aa3fbe16 --- /dev/null +++ b/.changeset/curly-cars-peel.md @@ -0,0 +1,6 @@ +--- +'lit-html': patch +'lit': patch +--- + +Lit's `async-directive` now re-exports everything from the `directive` module. diff --git a/packages/labs/cli/src/lib/generate/generate.ts b/packages/labs/cli/src/lib/generate/generate.ts index f9c004cbb2..11ea9a0372 100644 --- a/packages/labs/cli/src/lib/generate/generate.ts +++ b/packages/labs/cli/src/lib/generate/generate.ts @@ -35,7 +35,7 @@ interface GenerateCommand extends Omit { const frameworkCommands = { react: reactCommand, - vue: vueCommand + vue: vueCommand, }; type FrameworkName = keyof typeof frameworkCommands; diff --git a/packages/labs/context/src/lib/controllers/context-provider.ts b/packages/labs/context/src/lib/controllers/context-provider.ts index d96df643b1..e1c3a8262e 100644 --- a/packages/labs/context/src/lib/controllers/context-provider.ts +++ b/packages/labs/context/src/lib/controllers/context-provider.ts @@ -56,11 +56,11 @@ export class ContextProvider> public onContextRequest = ( ev: ContextRequestEvent> ): void => { - // Only call the callback if the context matches. - // Also, in case an element is a consumer AND a provider + // Only call the callback if the context matches. + // Also, in case an element is a consumer AND a provider // of the same context, we want to avoid the element to self-register. // The check on composedPath (as opposed to ev.target) is to cover cases - // where the consumer is in the shadowDom of the provider (in which case, + // where the consumer is in the shadowDom of the provider (in which case, // event.target === this.host because of event retargeting). if (ev.context !== this.context || ev.composedPath()[0] === this.host) { return; diff --git a/packages/lit-html/src/async-directive.ts b/packages/lit-html/src/async-directive.ts index 247278c0bb..6aed65e318 100644 --- a/packages/lit-html/src/async-directive.ts +++ b/packages/lit-html/src/async-directive.ts @@ -121,7 +121,7 @@ import {AttributePart, ChildPart, Disconnectable, Part} from './lit-html.js'; import {isSingleExpression} from './directive-helpers.js'; import {Directive, PartInfo, PartType} from './directive.js'; -export {directive} from './directive.js'; +export * from './directive.js'; const DEV_MODE = true; diff --git a/packages/lit-html/src/directives/async-replace.ts b/packages/lit-html/src/directives/async-replace.ts index bc319df1ea..16d82ad0a5 100644 --- a/packages/lit-html/src/directives/async-replace.ts +++ b/packages/lit-html/src/directives/async-replace.ts @@ -5,8 +5,11 @@ */ import {ChildPart, noChange} from '../lit-html.js'; -import {directive, DirectiveParameters} from '../directive.js'; -import {AsyncDirective} from '../async-directive.js'; +import { + AsyncDirective, + directive, + DirectiveParameters, +} from '../async-directive.js'; import {Pauser, PseudoWeakRef, forAwaitOf} from './private-async-helpers.js'; type Mapper = (v: T, index?: number) => unknown; diff --git a/packages/lit-html/src/directives/until.ts b/packages/lit-html/src/directives/until.ts index 94f4bcfe39..0caa559e31 100644 --- a/packages/lit-html/src/directives/until.ts +++ b/packages/lit-html/src/directives/until.ts @@ -5,9 +5,8 @@ */ import {Part, noChange} from '../lit-html.js'; -import {directive} from '../directive.js'; import {isPrimitive} from '../directive-helpers.js'; -import {AsyncDirective} from '../async-directive.js'; +import {directive, AsyncDirective} from '../async-directive.js'; import {Pauser, PseudoWeakRef} from './private-async-helpers.js'; const isPromise = (x: unknown) => { diff --git a/packages/lit-html/src/test/directive-helpers_test.ts b/packages/lit-html/src/test/directive-helpers_test.ts index 6e16d75aea..3c83bc1431 100644 --- a/packages/lit-html/src/test/directive-helpers_test.ts +++ b/packages/lit-html/src/test/directive-helpers_test.ts @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-3-Clause */ import {html, ChildPart, render, svg} from 'lit-html'; -import {directive, Directive} from 'lit-html/directive.js'; import {assert} from '@esm-bundle/chai'; import {stripExpressionComments} from './test-utils/strip-markers.js'; import { @@ -18,7 +17,11 @@ import { TemplateResultType, } from 'lit-html/directive-helpers.js'; import {classMap} from 'lit-html/directives/class-map.js'; -import {AsyncDirective} from 'lit-html/async-directive.js'; +import { + directive, + Directive, + AsyncDirective, +} from 'lit-html/async-directive.js'; suite('directive-helpers', () => { let container: HTMLDivElement;