From e9091714cf8fbee4209380f012dc712374f63276 Mon Sep 17 00:00:00 2001 From: Steven Orvell Date: Mon, 6 Jun 2022 17:51:49 -0700 Subject: [PATCH 1/4] [lit-html] Provide directive exports via async-directive Fixes #2790. This is being done for convenience. --- packages/lit-html/src/async-directive.ts | 2 +- packages/lit-html/src/directives/async-replace.ts | 7 +++++-- packages/lit-html/src/directives/until.ts | 3 +-- packages/lit-html/src/test/directive-helpers_test.ts | 3 +-- 4 files changed, 8 insertions(+), 7 deletions(-) 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 56871650aa..b4aafd1447 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.js'; -import {directive, Directive} from '../directive.js'; import {assert} from '@esm-bundle/chai'; import {stripExpressionComments} from './test-utils/strip-markers.js'; import { @@ -18,7 +17,7 @@ import { TemplateResultType, } from '../directive-helpers.js'; import {classMap} from '../directives/class-map.js'; -import {AsyncDirective} from '../async-directive.js'; +import {directive, Directive, AsyncDirective} from '../async-directive.js'; suite('directive-helpers', () => { let container: HTMLDivElement; From 1e94022ff08deff23d3f471effd01a80074e65fd Mon Sep 17 00:00:00 2001 From: Steven Orvell Date: Mon, 6 Jun 2022 17:53:12 -0700 Subject: [PATCH 2/4] Add changeset. --- .changeset/curly-cars-peel.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/curly-cars-peel.md diff --git a/.changeset/curly-cars-peel.md b/.changeset/curly-cars-peel.md new file mode 100644 index 0000000000..6857a64183 --- /dev/null +++ b/.changeset/curly-cars-peel.md @@ -0,0 +1,5 @@ +--- +'lit-html': patch +--- + +Lit's `async-directive` now re-exports everything from the `directive` module. From b44724ae1c747fd90bf08270accaba8c6ecf327d Mon Sep 17 00:00:00 2001 From: Justin Fagnani Date: Fri, 17 Jun 2022 14:29:39 -0700 Subject: [PATCH 3/4] Update .changeset/curly-cars-peel.md Co-authored-by: Augustine Kim --- .changeset/curly-cars-peel.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.changeset/curly-cars-peel.md b/.changeset/curly-cars-peel.md index 6857a64183..c0aa3fbe16 100644 --- a/.changeset/curly-cars-peel.md +++ b/.changeset/curly-cars-peel.md @@ -1,5 +1,6 @@ --- 'lit-html': patch +'lit': patch --- Lit's `async-directive` now re-exports everything from the `directive` module. From 3aa478b29bc92eb2bfa790b17334ce5a7c85a991 Mon Sep 17 00:00:00 2001 From: Steven Orvell Date: Mon, 25 Jul 2022 11:11:02 -0700 Subject: [PATCH 4/4] Rever unintended import change. --- packages/lit-html/src/test/directive-helpers_test.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/lit-html/src/test/directive-helpers_test.ts b/packages/lit-html/src/test/directive-helpers_test.ts index b4aafd1447..3c83bc1431 100644 --- a/packages/lit-html/src/test/directive-helpers_test.ts +++ b/packages/lit-html/src/test/directive-helpers_test.ts @@ -3,7 +3,7 @@ * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -import {html, ChildPart, render, svg} from '../lit-html.js'; +import {html, ChildPart, render, svg} from 'lit-html'; import {assert} from '@esm-bundle/chai'; import {stripExpressionComments} from './test-utils/strip-markers.js'; import { @@ -15,9 +15,13 @@ import { removePart, setChildPartValue, TemplateResultType, -} from '../directive-helpers.js'; -import {classMap} from '../directives/class-map.js'; -import {directive, Directive, AsyncDirective} from '../async-directive.js'; +} from 'lit-html/directive-helpers.js'; +import {classMap} from 'lit-html/directives/class-map.js'; +import { + directive, + Directive, + AsyncDirective, +} from 'lit-html/async-directive.js'; suite('directive-helpers', () => { let container: HTMLDivElement;