Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@brysonbw
Copy link
Contributor

@brysonbw brysonbw commented Aug 24, 2025

Changes

  • Create exportable union type RenderRootNode to replace HTMLElement | DocumentFragment for reusability
  • Add type SVGElement to render root element union type
    • This resolves type error when passing an SVGElement as the container argument to render(...), allowing SVG elements to be used as valid render roots

Linked Issues Being Addressed

@brysonbw brysonbw requested a review from kevinpschaaf as a code owner August 24, 2025 07:41
@changeset-bot
Copy link

changeset-bot bot commented Aug 24, 2025

🦋 Changeset detected

Latest commit: dac5670

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
lit-html Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@brysonbw
Copy link
Contributor Author

brysonbw commented Aug 24, 2025

In order to import code from other packages we have to add package to package’s package.json dependencies? I'm asking because I'm importing RenderRootNode type into reactive-element.ts. I’ve seen this approach used in other packages, but my context here is still new, so I might be missing a preferred alternative.

@brysonbw brysonbw force-pushed the add-svgelement-to-render-root-union branch from 2f017ce to 65699d0 Compare August 24, 2025 20:14
@brysonbw brysonbw changed the title [lit-html][reactive-element] Include SVGElement in render root union … [lit-html][reactive-element][labs/ssr-client] Include SVGElement in render root union … Aug 24, 2025
@brysonbw brysonbw requested a review from justinfagnani August 26, 2025 00:07
@brysonbw brysonbw force-pushed the add-svgelement-to-render-root-union branch from 65699d0 to fe685d1 Compare August 26, 2025 01:20
@brysonbw
Copy link
Contributor Author

brysonbw commented Aug 26, 2025

In order to import code from other packages we have to add package to package’s package.json dependencies? I'm asking because I'm importing RenderRootNode type into reactive-element.ts. I’ve seen this approach used in other packages, but my context here is still new, so I might be missing a preferred alternative.

Note To Self: Try to build packages locally before pushing with npm run test:dev. Also, I think when adding and/or referencing a lit package within monorepo you have to (1) add it as a dependency in package.json and (2) include it's build script in the Wireit dependencies list

@brysonbw brysonbw force-pushed the add-svgelement-to-render-root-union branch from fe685d1 to 5fdb4d7 Compare August 29, 2025 17:31
@brysonbw brysonbw changed the title [lit-html][reactive-element][labs/ssr-client] Include SVGElement in render root union … [lit-html] Include SVGElement in render root union type Aug 29, 2025
@brysonbw brysonbw requested a review from justinfagnani August 29, 2025 17:32
@justinfagnani justinfagnani merged commit bc2926e into lit:main Aug 31, 2025
7 checks passed
@justinfagnani
Copy link
Collaborator

Thanks @brysonbw!!

@lit-robot lit-robot mentioned this pull request Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants