Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 24, 2025

Conversation

christian-bromann
Copy link
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