alakajam-team / alakajam

Website powering the Alakajam! game making community
https://alakajam.com/
Other
29 stars 13 forks source link

JSX templating system #540

Closed mkalam-alami closed 4 years ago

mkalam-alami commented 4 years ago

Migration taking place on branch jsx.
It's not supposed to be a priority, but I'm enjoying working on it - and actually making some progress - so might as well track it.

Advancement [last updated 26/07]

JSX-enabled templates

Thin wrappers to replace with full migrations: base.html, most macros

Fully migrated templates

Initial HTML template count: 78

Notes

Hot reload support? Yes!

How could we support writing templates without having to restart the server every time?

Decouple the templating system by making the controllers still reference the templates as a string. Meanwhile a webpack(?) build registers all templates and makes them available as JS. The template connector on the server has a "no cache" mode where the JS file is required() (tip)on every change. ===> For full typing support, the TS interfaces for template contexts would have to be stored on the controllers instead of the templates. (NB. Currently we can't do that because that would mean circular dependencies)

This is increasingly starting to look like a library idea for using JSX as an old-school web template engine...

28/06 EDIT: Done 🎆 🥳 https://github.com/mkalam-alami/jsx-pistols

Useful links

mkalam-alami commented 4 years ago

New templating system is now live.

Live bugs

Dev bugs

mkalam-alami commented 4 years ago

Nunjucks is out, JSX is in.