Hi. I am working on Can, currently a pre-1.0 server-side HTML component system for Crystal.
The basic idea is to write components as HTML in “cans” (.can files) and compile those templates to Crystal before the app runs. It is not a JavaScript framework, and there is no runtime template parser.
Can currently supports:
- component defs
- slots
- scoped CSS
- literal quoted attributes
- expression attributes
- template-level
<.use>, loading can in can. can-render, a small CLI for rendering a single.canfile in static tests/experiments
Should work well for Crystal SSR projects, Kemal, Grip or HTTP::Server apps, and exploring an HTML-first component model in Crystal.
The important caveats: pre-1.0, I am not yet presenting it as production-ready infrastructure.
and can-render tool is not a full static site generator; it renders one .can file. A broader static-site workflow is a natural direction, but not something I haven’t dug into yet. In the mean time works for served site which is it main use case.
Links:
- Repo: GitHub - trans/can: Crystal Web Component Framework · GitHub
- Landing page/Docs: Can - Server-Side HTML Components for Crystal
I would especially like feedback on:
- whether the README explains the value quickly enough
- whether the component model feels natural for Crystal
- what example would make this easiest to evaluate
- would a full static site generation be good addition
- any and all other suggestions, issues, etc.
And, yes, I vibe code these days. But I do make an effort to keep the project focus small, and manually review the source as I have time. Plus, super helpful is Crystal itself – it lends itself to cleaner code in general.
Thanks.