Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sticky Caching on Components? #94

Closed
porkloin opened this issue Oct 30, 2017 · 6 comments
Closed

Sticky Caching on Components? #94

porkloin opened this issue Oct 30, 2017 · 6 comments

Comments

@porkloin
Copy link

Loving Mannequin so far :)

However, several times I've experienced sticky caching issues with my components. I created one component "Button" at button.html.twig and then copy-pasted the contents into "Image" at image.html.twig. I changed the twig and variables, but forgot to change the name of the component, and now "Image" continues to be called "Button in my component library. This persists even through a restart of the mannequin process.

I'm going to guess this is being cached somewhere? I'm running Mannequin in very verbose (-vvv) and getting a clean log. I looked through the documentation for any help, but there wasn't anything that seemed immediately illuminating.

Thanks!

@porkloin
Copy link
Author

porkloin commented Oct 30, 2017

A little more information:

If I copy image.html.twig to a file called images.html.twig it shows up as a new component with the correct name. Then if I delete image.html.twig I have two files remaining (button.html.twig and images.html.twig) both of which are listed in Mannequin under their correct names. However, when I move images.html.twig to image.html.twig, the name reverts to "button" automatically.

FWIW, this also happens with any variables and markup - once they're created and initially detected by Mannequin, the only way to modify the component and have the changes appear is to change the file name.

@porkloin
Copy link
Author

Sorry for the spam, but I just realized there is a debug flag for the Mannequin executable. Output of debug follows:

mannequin-debug.txt
mannequin-debug.txt

The first is when I have /base/button.html.twig and /base/image.html.twig, the second is when I have /base/images.html.twig included as well.

@rbayliss
Copy link
Contributor

Hey @porkloin,
Glad you're liking it so far! You're probably hitting Twig caching. You can work around it by passing 'auto_reload' as one of the twig options, like this. We should be setting this to true by default though, so I'm going to leave this issue open as a reminder to deal with that. Let us know if that doesn't cut it for you!

@rbayliss rbayliss added this to the 1.0.5 milestone Oct 30, 2017
rbayliss added a commit that referenced this issue Oct 30, 2017
@rbayliss
Copy link
Contributor

rbayliss commented Nov 2, 2017

This should be resolved in 1.0.6. To update, you should be able to run: composer update lastcall/mannequin*.

@rbayliss
Copy link
Contributor

rbayliss commented Nov 2, 2017

Sorry - and by resolved I mean that you no longer need to explicitly set auto_reload on your configuration. It is the default.

@rbayliss rbayliss closed this as completed Nov 2, 2017
@porkloin
Copy link
Author

porkloin commented Nov 2, 2017

Woo, thanks @rbayliss! I really enjoyed your talk at BADCamp and am looking forward to messing with Mannequin more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants