-
Notifications
You must be signed in to change notification settings - Fork 17
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
HTMLbars cache isn't busted on rebuilds #28
Comments
I'll chime in since I was also part in looking into this. I opened a PR to ember-cli-htmlbars which adds the If they accept it we can add the // index.js
target.registry.add(
'htmlbars-ast-plugin', {
name: 'conditional-compile-template',
plugin: TemplateCompiler(config.featureFlags),
baseDir: function() {
return __dirname;
},
cacheKey: function() {
return config.featureFlags;
}
}
); |
What's the best way of busting the cache right now? How are you guys doing it? Edit: I followed jobackman's lead and his method works. Thank you so much! |
Just an update from my side. |
Since I'm not sure if they'll accept my suggestion over at the htmlbars repo or even seen it, I've set my package.json to use ember-cli-conditional-compile from a before #25 was merged rather than having a forked version of htmlbars. #25 resolved a deprecation warning coming from htmlbars, which if it is triggered always busts the cache. So to reliably bust my htmlbars cache I updated my package.json to a use a commit from before the bugfix was merged:
So on building I'll always get the cache busted since I'm not supplying a cache strategy This has worked reliably for me so far. |
I think this is resolved now; let me know if it reappears and I'll take another look! |
I believe the cache issue (#21)
is still present.
@minichate looks like I've been celebrating a bit to early when I made this PR #25 a month ago.
Looks like the newer versions of ember were actually disabled caching when throwing the warning about missing caching strategies. So the "fix" in the PR actually did nothing except reinstating the issue.
I believe we were all testing this "fix" when other plugins were also incompatible, resulting in no cache. I just encountered that the caching issue is still an issue when I managed to remove all AST-warnings.
After taking a closer look at ember-cli-htmlbars it looks like the new AST-caching strategy (specifying a
baseDir
) only lets htmlbars know where to look for changes and makes sure cache is busted when file changes are made in an addon's directory. There is no support for cache busting based on options yet, which is what's needed here.There is are discussions for making
ember-cli-htmlbars
the same type of cacheKeys as this module has babel/broccoli-babel-transpiler#89, but until then it looks like there are only "hacky" ways for this addon to actually bust the template cache.Just wanted to let you know about my findings and thanks for a great plugin!
The text was updated successfully, but these errors were encountered: