On Wed, Aug 25, 2010 at 8:09 AM, DBA <diogo.borg...@gmail.com> wrote:
> Hello guys,
>
> I would like to ask everyone their thoughts on Liquid, more
> accurately: should there be a liquid 3, what would you change / add?
>
> Getting the party started, here's my personal favorites:
Good idea
>
> * Make Liquid thread safe (currently it relies quite a bit in Class
> Variables)
Liquid is thread save as long as you don't use a template between
threads. Originally I designed it fully thread safe but some
requirements came up with went against this, for example the need to
share assigned variables between layout and inner templates. I'm not
sure if this is worth addressing. Perhaps we can implement a proper
.dup method on the template so threads can quickly dup templates
before using them instead on relying on re-parsing.
> * Introduce a configuration class that holds the default behavior of a
> given Liquid instance, further enhanced with runtime overridable
> values
I dislike configurability of this kind. It serves no purpose other
then confuse users.
> * Add the notion of plug n' play TemplateParser and PreProcessor
We need a stronger parser but pluggable anything is almost always a bad idea.
> * Internationalization
Absolutely. All strings used by liquid should be overrideable on a per
render run.
> * In line with the architecture used for tags, make filters more
> modular and plug n' play friendly
again I dislike pluggable but I think we should look to radius and
change the way filters and tags are defined to use a nice DSL rather
then the current system.
> * Clear and non ambiguous namespaces and class hierarchy. For example,
> the current implementation of Document (the object returned by
> Template.parse) extends Block, which in turn extends Tag. Semantically
> this means that the whole Document is a tag, which is (in my opinion)
> inaccurate. Furthermore, tags, filters, filesystems, etc, should have
> their very own namespace
Hmm thanks for bringing this to my attention. I definitely agree that
a Document isn't a Tag. I think this can be addressed by renaming the
tag class to Fragment or something like this.
> * Drop liquid as an ActiveView::TemplateHandler
Yes.
> * Migrate the tests to RSpec 2 (currently in beta)
I massively dislike RSpec, It's a dumb idea.
> These are my personal favorites for a 3rd major release of Liquid.
> Where do you stand? What's your personal favorites?
A new parser. I wrote one in ragel recently but now determined that
Ragel is a poor fit for something like Liquid. I think a parser based
on string scanner would be the right thing to do. Mustache had a lot
of success with this. A new parser would allow us to:
* Report errors much more accurately
* Report line & character numbers of errors
* Remove preprocessor again.
* Improve render performance by an order of magnitude by resolving
variable lookups at compile time.
>
> Best regards,
> DBA
>
> --
> You received this message because you are subscribed to the Google Groups "Liquid Templates" group.
> To post to this group, send email to liquid-t...@googlegroups.com.
> To unsubscribe from this group, send email to liquid-templat...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/liquid-templates?hl=en.
>
>
Sorry for the late response.
1) Inheritance: Cool stuff. Need to take a deepr look into it.
2) As previously discussed, due to its origins and purpose of existence, I'm not entirely sure in if Liquid should ever have a role as a first class Rails templating engine. For such scenarios, where sandboxing is not the issue, ERB and HAML seem more adequate. Did I miss interpret your point?
3) Regarding RSpec, even though I fancy RSpec, tobi is not in favor of such migration. For that reason, and in favor of a unified Liquid Mainline, for now I think we should focus in a new parser, rather than RSPEC.
4) Liquid 3: Liquid needs a new parser, kinda in line with mustache as tobi pointed. That's something we need to tackle ASAP if we want liquid 3 to ever exist
Best regards,
DBA