-
-
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
Can Svelte provide the ability to plug-and-play renderers? #5496
Comments
Describe the solution you'd likePlayed around with the code a little bit. Currently, looks like if the compiler allowed to take the renderer itself as a parameter, svelte's compiler would get separated from the renderer. This means anyone who calls svelte - currently rollup-plugin-svelte and svelte-loader would pass renderers when compiling svelte code. |
Probably worth to check on svelte-native-preprocessor. |
@DrSensor Yes, so I'm also thinking of writing a preprocessor. The one thing I'm trying to wrap my head around is once the renderer does its job, in the code-generation step, I need to generate custom code rather than svelte's default DOM related code, that would require extra changes. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Duplicate of #5496 |
This is #5496. |
Oh I'm sorry, I meant duplicate of #1678 |
ahaa |
I'm currently trying to use Svelte to create applications for targets other than web. My specific use-case it that I want to use Svelte to create native applications - with libraries like Nodegui. Looking at the current implementation of the compiler, the option locks it down to use either the dom or ssr renderer. opening it up would mean allowing for custom renderers.
Is your feature request related to a problem? Please describe.
Svelte's rendering system is locked. It allows for rendering to dom and SSR. Can the compiler somehow be extracted to allow for custom renderers? This would mean custom SvelteComponent generators as the output might not be for web, as well #4168
Describe the solution you'd like
Create base classes for renderer class so that custom implementations can be passed. This allows for projects like Svelte Native and Nodegui to pass in their renderers and use the compiler.
Describe alternatives you've considered
Still at the thinking phase so open to ideas.
How important is this feature to you?
This would allow Svelte to be used in many other sorts of application than just the web. So I'd say pretty important.
Additional context
Here's the changes I'm working on currently: https://github.com/mrsauravsahu/svelte/compare/master...mrsauravsahu:feat/inject-render-function?expand=1
The text was updated successfully, but these errors were encountered: