Skip to content

feat(runtime): export a render method from the runtime#6245

Merged
christian-bromann merged 3 commits intomainfrom
cb/render-function
Apr 24, 2025
Merged

feat(runtime): export a render method from the runtime#6245
christian-bromann merged 3 commits intomainfrom
cb/render-function

Conversation

@christian-bromann
Copy link
Copy Markdown
Member

What is the current behavior?

It is currently rather difficult to render a Stencil VDOM to a container node. While this is technically not needed by users as you can just use WebAPIs to inject a Stencil element to a page, it helps when integrating Stencil within other environments, e.g. Storybook where you get a VDOM value to render somewhere. Stencil has its own VDOM implementation and we can't just take the one from Preact or other frameworks.

Given that the function is lightweight enough it won't have an impact on the bundle size, as it will be embedded into users bundles.

What is the new behavior?

@stencil/core now exports a render method to conveniently render a Stencil VDOM into a DOM node.

Documentation

stenciljs/site#1518

Does this introduce a breaking change?

  • Yes
  • No

Testing

Added WDIO tests for this.

Other information

I need this for the Storybook integration.

@christian-bromann christian-bromann requested a review from a team as a code owner April 22, 2025 18:53
@christian-bromann christian-bromann merged commit e6c0593 into main Apr 24, 2025
147 of 148 checks passed
@christian-bromann christian-bromann deleted the cb/render-function branch April 24, 2025 16:32
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.

1 participant