You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Svelte 4 had foreign namespace to support Svelte Native. This was removed in Svelte 5 as the approach was not compatible with the new compiler implementation: #12709
Reacted by Ivan Georgiev, Paolo Ricciuti, ComputerGuy, qk8, Juan de Dios Martínez Vallejo, Nathan Walker, Enrico Sacchetti, Unoqwy, Cliff Njoroge, Sayan J. Das and 121 more
Reacted by MrPeu, ComputerGuy, Paolo Ricciuti, qk8, Gustavo Zimbrón, Juan de Dios Martínez Vallejo, Cliff Njoroge, Sayan J. Das, linuxisgood, Max G. and 63 more
I'm not too knowledgeable in this topic, but perhaps there could be a map of method names and/or a map of handlers for different features? Example:
export const custom_renderer = {
replacements: {
state: 'ref' //$.state -> $.ref
},
handlers: {
bind(prop, node, binding) {
return x$.bind(${node}, '${prop}', ${binding}); //for bindings
}
}
}
This could also include things like the boilerplate for each component.
I think rather than a replacement for state (I think the reactivity should still be handled by svelte otherwise it's just a matter of syntax) we should have replacements for dom operations. That said we should probably also have a more general hook to transform the compiled code because there might be the need to setup stuff before the component code for example.
They are pretty similar. Do you think it would be good to make the Svelte API resemble something like that? (Would make porting existing solutions to Svelte easier)
Reacted by ComputerGuy, Simon H, enisdev, Jonathon Reese Perry, linuxisgood, Alexander Lichter, Fabian Carrasco, brunnerh, Henrik Nygren, ashray and 32 more
+1 to this, I would love to see this work with Lynx!
Reacted by polyface, Anton Begehr, SirWhite10, Jason Kwok, Matt Heslington, abdelfattahradwan, Bernardo Andrade and Mikita Himpel
Reacted by Karim Jordan, Mert Aslan, Mert Akman, Gabriel Francisco, Ahhh_Saturn, Mark Malstrom, Fedor Nezhivoi, Houssam Elbadissi, david, Martin Braun and 4 more
Reacted by Dmitrii Vasilev, Mert Akman, dagassa, Gustavo Morinaga and Jason Kwok
+1 for this . any update please . This would be helpful for nativescript and lynx (potentially)
I'm actively working on this (well technically not now since I'm on vacation but you get the gist) since mainmatter (the company I work for) is sponsoring my work full time on this.
There's already a PR open #15538 to have a new templating mode that doesn't involve the template elementi which was obviously a blocker.
We are currently deciding on the best API for this, I kinda have a POC for one API and I'm building another POC for a different (imho slightly better API). It's coming! 😁
Reacted by ouhndelof, Sayan J. Das, Rafał Majewski, Gwenn Le Bihan, Fedor Nezhivoi, Federico Varano, toni, Mark Malstrom, Chris Soul, Jay and 31 more
Is shaping up, I was able to actually render a svelte component in Lynx...however there's still a lot of work to do 😊
Reacted by alike03, Nathanael Anderson, Gwenn Le Bihan, Anton Begehr, Timm Ortloff, ComputerGuy, Tyler Petrov, Pits, Ahhh_Saturn, Tobias Netskar and 26 more
I believe that Mainmatter is waiting for a customer to sponsor finishing the work on this. From the blog post:
as you can see, there's still a lot to do, and even more to make this production-ready. So if you or your company are interested in building truly native apps with Svelte and want to support us getting this ready to use, please reach out!
Some of the foundational work in Svelte was merged. However, the custom renderer API itself has not been merged. As mentioned in the blog post, some feedback was received from the Threlte team, so Paolo felt the API should be reworked a bit.
@benmccann at what point is this not what the open collective is for? There are many individuals in the community that feasibly can't say hey big company let me pay you for this feature but have been donating to the open collective in hopes that the money will be put towards furthering the framework. Whether that may be sponsoring people to work or other things. There is likely not a big player that has been using svelte for native because the case has never been made prior to something like this coming along so I doubt it'll ever move along if you're looking for something like that. That's just my opinion.
That's a valid point but i have been following paolo and he's been very busy with things like mcp for svelte, sveltelabs, hosting the svelte podcast and weekly youtube videos, patching bugs in svelte. So I think he's out of time to work on the custom renderer and might pick it up once all these major changes in svelte/sveltekit ecosystem becomes somewhat stable(remote functions, async svelte) assuming he gets to work on it. I just checked upon if he was parallelly in anyway working on custom render (which he isn't currently). I agree with you on the Open collective point. They should put this somewhere in the docs rephrasing it to indicate donations would speed up getting svelte native apps sooner than expected.
@Prajwalg19 I'm in no way criticizing Paolo, he's a goat and definitely appreciate all the things he's doing! But the phrasing has become sponsor his work via mainmatter to get this done so why not do that with the funds the community has been giving. Maybe there should be a voting system or something on what the funds should be spent towards if the maintainers see a need for specific goals to be sponsored
Reacted by Ahhh_Saturn, Pits, Dmitrii Vasilev, Ethan Annane, Nitish Malluru, Florian Krauthan, neerone, ross doran, Tiago Ribeiro, Emmanuel Ogbonna and 4 more
Hi!
Writing here just to chime in on the conversation, I've seen @paoloricciuti talk more about this topic recently, and the challenges needing to be faced for this feature.
I'm curious about the approach taken, in particular i'm thinking how Svelte can support custom renderers without locking itself out of possible optimizations (for example the template one that Paolo mentioned on the Syntax.fm podcast).
Apart from other JS frameworks' prior art, like Vue and SolidJS, there is the Leptos implementation that I think has a great design, and allows for these kind of optimizations, while keeping a pluggable renderer architecture: Tachys.
For example, the RenderHtml trait specifically supports that use case, and even defines the hydration method.
Greg talks about the core of this idea and how it enabled custom renderers for Leptos in this issue.
Activity
Ocean-OS commentedon Mar 7, 2025
I'm not too knowledgeable in this topic, but perhaps there could be a map of method names and/or a map of handlers for different features? Example:
This could also include things like the boilerplate for each component.
paoloricciuti commentedon Mar 7, 2025
I think rather than a replacement for state (I think the reactivity should still be handled by svelte otherwise it's just a matter of syntax) we should have replacements for dom operations. That said we should probably also have a more general hook to transform the compiled code because there might be the need to setup stuff before the component code for example.
Pronian commentedon Mar 7, 2025
Here is the Vue custom renderer API: https://vuejs.org/api/custom-renderer.html
And the SolidJS one: https://github.com/solidjs/solid/tree/main/packages/solid/universal
They are pretty similar. Do you think it would be good to make the Svelte API resemble something like that? (Would make porting existing solutions to Svelte easier)
caracal7 commentedon Mar 13, 2025
ethanannane commentedon Mar 20, 2025
+1 to this, I would love to see this work with Lynx!
RoxDevvv commentedon Apr 1, 2025
+1
joshua1 commentedon Apr 9, 2025
+1 for this . any update please . This would be helpful for nativescript and lynx (potentially)
paoloricciuti commentedon Apr 9, 2025
I'm actively working on this (well technically not now since I'm on vacation but you get the gist) since mainmatter (the company I work for) is sponsoring my work full time on this.
There's already a PR open #15538 to have a new templating mode that doesn't involve the
templateelementi which was obviously a blocker.We are currently deciding on the best API for this, I kinda have a POC for one API and I'm building another POC for a different (imho slightly better API). It's coming! 😁
gornostay25 commentedon Apr 30, 2025
any updates?
paoloricciuti commentedon Apr 30, 2025
https://bsky.app/profile/paolo.ricciuti.me/post/3lnxnejj6mc2k
Is shaping up, I was able to actually render a svelte component in Lynx...however there's still a lot of work to do 😊
3xau1o commentedon Jul 13, 2025
Latest post by @paoloricciuti https://mainmatter.com/blog/2025/05/22/native-apps-with-svelte/
Prajwalg19 commentedon Oct 5, 2025
benmccann commentedon Oct 5, 2025
I believe that Mainmatter is waiting for a customer to sponsor finishing the work on this. From the blog post:
Some of the foundational work in Svelte was merged. However, the custom renderer API itself has not been merged. As mentioned in the blog post, some feedback was received from the Threlte team, so Paolo felt the API should be reworked a bit.
Lately, Paolo has been working on the Svelte MCP server instead. If you have an interest in using Svelte with Lynx, please reach out to Mainmatter about sponsoring Paolo to cleanup his branch for the custom renderer and get it merged to Svelte.
Antonio-Bennett commentedon Oct 13, 2025
@benmccann at what point is this not what the open collective is for? There are many individuals in the community that feasibly can't say hey big company let me pay you for this feature but have been donating to the open collective in hopes that the money will be put towards furthering the framework. Whether that may be sponsoring people to work or other things. There is likely not a big player that has been using svelte for native because the case has never been made prior to something like this coming along so I doubt it'll ever move along if you're looking for something like that. That's just my opinion.
Prajwalg19 commentedon Oct 13, 2025
That's a valid point but i have been following paolo and he's been very busy with things like mcp for svelte, sveltelabs, hosting the svelte podcast and weekly youtube videos, patching bugs in svelte. So I think he's out of time to work on the custom renderer and might pick it up once all these major changes in svelte/sveltekit ecosystem becomes somewhat stable(remote functions, async svelte) assuming he gets to work on it. I just checked upon if he was parallelly in anyway working on custom render (which he isn't currently). I agree with you on the Open collective point. They should put this somewhere in the docs rephrasing it to indicate donations would speed up getting svelte native apps sooner than expected.
Antonio-Bennett commentedon Oct 13, 2025
@Prajwalg19 I'm in no way criticizing Paolo, he's a goat and definitely appreciate all the things he's doing! But the phrasing has become sponsor his work via mainmatter to get this done so why not do that with the funds the community has been giving. Maybe there should be a voting system or something on what the funds should be spent towards if the maintainers see a need for specific goals to be sponsored
delordemm1 commentedon Jan 9, 2026
vexkiddy commentedon Jan 27, 2026
fvarano commentedon Mar 5, 2026
Hi!
Writing here just to chime in on the conversation, I've seen @paoloricciuti talk more about this topic recently, and the challenges needing to be faced for this feature.
I'm curious about the approach taken, in particular i'm thinking how Svelte can support custom renderers without locking itself out of possible optimizations (for example the
templateone that Paolo mentioned on the Syntax.fm podcast).Apart from other JS frameworks' prior art, like Vue and SolidJS, there is the Leptos implementation that I think has a great design, and allows for these kind of optimizations, while keeping a pluggable renderer architecture: Tachys.
For example, the RenderHtml trait specifically supports that use case, and even defines the hydration method.
Greg talks about the core of this idea and how it enabled custom renderers for Leptos in this issue.
Hope it helps!
benmccann commentedon Apr 2, 2026
@farfromrefug I wanted to make sure you saw there is a PR to add custom renderer support to Svelte 5: #18042
It should let you update https://github.com/nativescript-community/svelte-native to Svelte 5. It would be nice to open up a tracking issue in that repository