-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Custom renderers support #15470
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
Comments
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. |
Here is the Vue custom renderer API: https://vuejs.org/api/custom-renderer.html 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) |
This comment has been minimized.
This comment has been minimized.
+1 to this, I would love to see this work with Lynx! |
+1 |
+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 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! 😁 |
Describe the problem
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
Describe the proposed solution
Add a custom renderer API to support things like:
Importance
nice to have
The text was updated successfully, but these errors were encountered: