Giter VIP home page Giter VIP logo

Comments (9)

defunkt avatar defunkt commented on May 21, 2024

I could go either way on this. One of my least favorite parts of Rails is all the autoloading.

But if you take that out, what does Tilt offer for Mustache users?

from tilt.

defunkt avatar defunkt commented on May 21, 2024

Between path, template_extension, template_file, and the :namespace option the autoloading is very configurable and simple. Maybe Tilt could provide it and the framework (Sinatra, Rails, whatev) could set up things the way it wants?

from tilt.

rtomayko avatar rtomayko commented on May 21, 2024

Yeah. Mustache is different from most template systems because the template file locating is handled so well by the view class. It seems like Tilt and Mustache make sense in the following scenarios:

  1. Cases where you'd use Mustache.render or a template without a specific view subclass. e.g., here's a .html template file and a Hash of values, render that shit. In this way, Mustache works like most other template languages.
  2. Cases where the view and template are always side by side in the same directory or where the view is very easily locatable given the template filename.

The case where Tilt probably isn't useful/applicable is when you're writing code directly against a view subclass before rendering. If you already have the view class, tilt doesn't really help anything. I can't think of any reason to use Tilt in that case.

So, if you use Mustache in a template oriented way, Tilt makes sense. If you use Mustache in a view class oriented way (which seems to be more in the spirit of the stache), then Tilt has little to offer.

from tilt.

rtomayko avatar rtomayko commented on May 21, 2024

Or something.

from tilt.

defunkt avatar defunkt commented on May 21, 2024

Maybe the autoloading should be in Mustache itself. It does load template files, after all.

from tilt.

rtomayko avatar rtomayko commented on May 21, 2024

I think that makes a lot of sense. We're already doing the autoloading in sinatra and now tilt so it's safe to assume more environments will need to deal with it. Implementing in mustache would make things a bit more consistent across environments.

from tilt.

defunkt avatar defunkt commented on May 21, 2024

Try this on for size: http://github.com/defunkt/tilt/commit/39d137a23e19163dcbdb2783b303e4f85080260b

from tilt.

defunkt avatar defunkt commented on May 21, 2024

Added some cleanup, too: http://github.com/defunkt/tilt/commits/simpler_mustache_loading

from tilt.

rtomayko avatar rtomayko commented on May 21, 2024

Great patch.

from tilt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.