-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Component rendering since svelte 4 #9377
Comments
|
@dummdidumm thanks for your reply. My use case is :
I would like get the html content of my components to put it on an email body. But, you talk about render method, how call this method ? Do you have a link in documentation about that please ? |
Judging from your code you're not actually calling const ssrComponent = component as any as { render: (props: Props) => { html: string, css: { code: string }, head: string } } In Svelte 5 you will do something like this: import { render } from 'svelte/server';
...
const { html: body, css, head } = render(component, { props }); Closing this because there's an actionable workaround present. |
@dummdidumm out of curiosity, with the removal of returning I can inline the styles into the component but I'd end up paying the performance cost of that if I also wanted to render the component client side as a "preview". I'm not sure this strategy would work for the MJML use case though. |
If i can help. Since svelte 5, this my code to manage mjml and css :
This return is to use with this code :
|
Describe the problem
Since svelte 4 (if I'm not mistaken), the create_ssr_component method (in svelte/internal) is no longer available.
In my opinion, it was extremely useful. It allowed you to build components and obtain html rendering as well as css, which was ideal for dynamically building the html structure for an email, for example.
Is there a clean way of achieving the same result with the namespaces available?
Describe the proposed solution
Is it possible to make this method (create_ssr_component) available again, or an equivalent?
Alternatives considered
The only alternative I've found at the moment is to use svelte version 3 just for this email template project.
Importance
nice to have
The text was updated successfully, but these errors were encountered: