Skip to content

serverside translation of web component templates#12

Open
ufundo wants to merge 2 commits intofield-options-web-componentfrom
elements-templating
Open

serverside translation of web component templates#12
ufundo wants to merge 2 commits intofield-options-web-componentfrom
elements-templating

Conversation

@ufundo
Copy link
Owner

@ufundo ufundo commented Jan 29, 2026

No description provided.

@ufundo ufundo force-pushed the elements-templating branch from 4678345 to 9f55e38 Compare January 29, 2026 12:36
@colemanw
Copy link

@ufundo so the idea here is that web component templates are passed through smarty first? That seems like a good way to solve the ts problem.

@ufundo
Copy link
Owner Author

ufundo commented Jan 29, 2026

Yep @colemanw thats the core idea, and it seems to work quite well.

I think the tricky comsiderations are:

performance - smarty requests fire up PHP, we'd lik to avoid that as much as possible. how do we make sure the template partials are very cacheable (by reverse proxy, at browser level between requests etc)

access control - it's possible to pass data into the template. there may be good reasons to do so (for example rendering the nav menu, this is basically how sidebar works). But we dont want to leak user data to any old user.

@colemanw
Copy link

Yea, we get into trouble when we introduce something that looks wide-open but really isn't. If the templates are being cached globally (best for performance) then they can't contain any user-specific or time-sensitive variables. But actually, I don't think we are making it wide-open because in order to assign Smarty variables the template must be called from a CRM Page/Form and this one won't be. So devs will have no way to assign any variables to the template, and for extra caution we could lock down tags like {php} and also as a best practice we should enable auto-escaping on these new templates.

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.

2 participants