squirrellyjs / squirrelly

Semi-embedded JS template engine that supports helpers, filters, partials, and template inheritance. 4KB minzipped, written in TypeScript ⛺
https://squirrelly.js.org
MIT License
592 stars 82 forks source link

Roadmap #132

Closed nebrelbug closed 3 years ago

nebrelbug commented 4 years ago

After a lot of thought, I have decided that one more major version is in order before the complete rewrite.

Probable Changes

Better tooling (easier / more powerful caching, etc.) - Caching, loading templates as files, etc. all need updates
Layouts, template inheritance It's trivial to write a helper or native helper that allows you to do this (see [this demo](https://stackblitz.com/edit/squirrelly-layouts?file=index.js)) but the syntax is kinda clunky
Non-precompiled partials Right now, partials are put into the template at runtime.
Rename `options` to `it` More concise and doT-like
Method standardization Right now, `Render` and `renderFile` have different capitalization
JS-styled comments (`/* ... */` instead of `!-- ... --`) Easier to read & write

Possible Changes

Explicit helper references (see #120) - This would mean no more helper scoping, which would simplify creating templates - Remove use of `@` entirely?
Multiple blocks of the same type This would allow for blocks like `elif`, `scopedown`, etc.
Block, filter parameters
Distinguish between helpers, references using `~` This may require more work. I'll look into this

Essentially, the next version (version 8) would use the same strategy of using Regular Expressions to parse, while removing many of the limitations of the current implementation. It wouldn't have nice features like JavaScript syntax validation, but that shouldn't be much of an issue.

The new, rewritten parser that's currently in development would be published at squirrelly-next, and eventually become Squirrelly version 9.

jasonfutch commented 4 years ago

@nebrelbug Point me to squirrelly-next and I'll start contributing when I have time.

nebrelbug commented 4 years ago

@jasonfutch sorry for the late response! I'm on vacation with limited access to internet. Contributions will be awesome! I don't have squirrelly-next up quite yet, but I should publish my work within the next 15 days, and I'll let you know when I do :)

hustcer commented 4 years ago

Awesome !

nebrelbug commented 4 years ago

@jasonfutch @hustcer hey, just realized I never replied!

I actually just recently merged squirrelly-next with this repo and published v8 as a beta on the master branch! I don't have documentation written for it yet, but I'd love any contributions.

You should be able to look in the tests/ folder and the source code to get an idea of the API.