Coder Social home page Coder Social logo

Comments (13)

laktek avatar laktek commented on September 21, 2024

In which OS you are trying? Normally, partials changes should cause to reload the page.

from punch.

renaudleo avatar renaudleo commented on September 21, 2024

I'm on OS X 10.7.

from punch.

laktek avatar laktek commented on September 21, 2024

Hmm. weird. I'm also using the same and it seems to work perfectly.

Can you paste the log of a session where you change a partial and then reload a page?

from punch.

renaudleo avatar renaudleo commented on September 21, 2024

Here it is:

~  punch setup punch_test
Created a new site in punch_test
To get started, run: cd punch_test; punch s
~  cd punch_test; punch s
Started Punch server on port 9009
127.0.0.1 - GET / HTTP/1.1 200 - - 12 ms
127.0.0.1 - GET /css/main.css HTTP/1.1 200 - - 11 ms
127.0.0.1 - GET /css/normalize.css HTTP/1.1 200 - - 14 ms
127.0.0.1 - GET /css/site.css HTTP/1.1 200 - - 13 ms
127.0.0.1 - GET /favicon.ico HTTP/1.1 200 - - 4 ms
127.0.0.1 - GET / HTTP/1.1 200 - - 7 ms
127.0.0.1 - GET /css/normalize.css HTTP/1.1 304 - - 3 ms
127.0.0.1 - GET /css/main.css HTTP/1.1 304 - - 2 ms
127.0.0.1 - GET /css/site.css HTTP/1.1 304 - - 3 ms
127.0.0.1 - GET /favicon.ico HTTP/1.1 200 - - 1 ms
127.0.0.1 - GET / HTTP/1.1 200 - - 6 ms
127.0.0.1 - GET /css/normalize.css HTTP/1.1 304 - - 2 ms
127.0.0.1 - GET /css/main.css HTTP/1.1 304 - - 2 ms
127.0.0.1 - GET /css/site.css HTTP/1.1 304 - - 3 ms
127.0.0.1 - GET /favicon.ico HTTP/1.1 200 - - 2 ms

The first HTTP/1.1 200 is where I just opened localhost:9009 in my browser.

I then removed {{{first-run}}} in _footer.mustache and reloaded the page, where nothing changed.

I then added some text content in _layout.mustache and reloaded the page. My new content was there, but the first run was still there too.

from punch.

laktek avatar laktek commented on September 21, 2024

Can you try adding some other content in to _footer.mustache and see whether those get picked up?

I'm still unable to recreate the issue at this end.

from punch.

jbourassa avatar jbourassa commented on September 21, 2024

That's weird - I got the same problem here. I'll try to debug and I'll report back.

from punch.

laktek avatar laktek commented on September 21, 2024

@jbourassa Please let me know if you were able to regenerate the issue.

from punch.

jbourassa avatar jbourassa commented on September 21, 2024

@laktek If by "regenerate" you mean reproduce, yes I can. For what it's worth, I work with @renaudleo so our environments are very similar.

from punch.

jbourassa avatar jbourassa commented on September 21, 2024

@laktek Also, we're using CLI tools instead of XCode. Shrug.

from punch.

prathe avatar prathe commented on September 21, 2024

Is it expected that on a request, the server will regenerate the partials if they have changed with the following options?

  "server": { 
    "cache" : {
      "directives": ["public"]
    }
  }

Or do we need to have something like the following options if we want that behavior?

  "server": { 
    "cache" : {
      "directives": ["no-cache", "no-store"]
    }
  }

In both case, I have to kill the server then restart it and then only save the mustache file in order to see my change. If I want to make another change, I have to kill and restart to server again, and then save the file in order that a request to the server will regenerate the index.html file.

from punch.

laktek avatar laktek commented on September 21, 2024

@jbourassa It should work fine in CLI (actually, that's how it was intended to use).

@prathe Cache directive should have no effect, because the max-age is set to 0 by default. So even when the caching is enabled, it should reflect the changes on a reload.

The partials are detected as changed by their last modified time attribute. Can you check whether the OS/editor, sets the modified time correctly when you save the file?

from punch.

jbourassa avatar jbourassa commented on September 21, 2024

@laktek Ok, I figured it out. The cache in Mustache 0.7 is not being updated in properly, and it's fixed in HEAD. The issue is #257.

I see two ways of fixing this, use whichever you like best :

  • "mustache": "0.6"
  • "mustache": "git://github.com/janl/mustache.js.git#6bbc85fe26bc584fb215f2fdb63cabb79c0a03a8"

Yay :)

from punch.

laktek avatar laktek commented on September 21, 2024

Thanks guys for digging into this issue and finding the solution. I've released a new version, which contains @prathe's update for the Mustache version.

from punch.

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.