Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Make it easy to integrate server components and templating libraries like Mustache for data #14

Open
pimterry opened this issue May 11, 2016 · 1 comment

Comments

@pimterry
Copy link
Owner

pimterry commented May 11, 2016

No description provided.

@pimterry
Copy link
Owner Author

pimterry commented Jun 6, 2016

Could create a component that extends server components and adds a <data-placeholder name=""> component? Would only work with inline content, not attributes, which is very limiting indeed.

Attributes are dangerous generally though with Mustache etc; lots of potential to encourage XSS vectors by rendering to unstructured string data and then interpreting that directly (as server components input).

Want a HTML-understanding templating language really, but that doesn't seem to exist (arguably, Server Components is it). Could add one? Allow mustache constructs in the HTML, and interpret them out before component rendering? Feels a bit crazy here, risk of creep, but very useful, and in line with what larger frameworks do (e.g. {{ }} in Angular and Ember). Should this be a manual standalone step (components.template(html, { name: Tim }).render().then...) to keep steps simple, or part of a normal render() call, like everywhere else?

This is a clear strong need for the majority of use cases, needs to have a good out-of-the-box story in Server Components.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant