Skip to content
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

client-side templating #20

Open
nelsonpecora opened this issue Jul 11, 2015 · 1 comment
Open

client-side templating #20

nelsonpecora opened this issue Jul 11, 2015 · 1 comment

Comments

@nelsonpecora
Copy link
Contributor

This is sort of the holy grail, and it's not currently possible with multiplex-templates. Here's the problem:

  • While most templating languages render synchronously, some don't. Which means consolidate.js made the decision to only have an async render function. This makes sense, and allows it to support all popular js templating languages.
  • That being said, almost all templating languages only allow synchronous functions inside the templates themselves. Most of the exceptions are unstable, experimental versions.
  • The way multiplex-templates gets around this is by using the deasync library, which uses C-bindings to make async functions synchronous. This is crazy wizard magic, but works great on the server.
  • To get the holy grail of offline-first, client-only templating in any language, we'd have to figure out a way to either make all the templating languages allow async functions, or port deasync to the client-side, or...something.
  • In this ticket, I want to come up with possible solutions.
@nelsonpecora
Copy link
Contributor Author

Ideas:

  • port deasync to the client-side (asm.js, WebAssembly, crazy wizard magic)
  • only use a subset of languages that support asyncronicity
  • only use a subset of languages that support syncronicity
  • port consolidate.js and make it fully synchronous (not really into this option)
  • update languages to fully support asynchronicity (e.g. then-jade)

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

No branches or pull requests

1 participant