-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Incorporate cache keys. #15
Conversation
@rwjblue could you crosslink why you're doing this? |
The upstream usage of Right now, the following scenario will leave you with a cached JS file that is not properly invalidated:
The last babel/broccoli-babel-transpiler#89 is aiming to solve this, and will warn/deprecate/etc any instances where the |
okay LGTM, could you maybe add a few short code comments and/or a sentence about it to the README? |
@Turbo87 - Update README and added a couple inline comments explaining why this is being done. |
I have to admit I'm not entirely happy with the approach because it is very uncommon to pass functions to Babel plugins and even more so to Babel 6 plugins where they are usually referenced in a does should we actually bundle/depend on the handlebars precompiler in this plugin instead of passing it in like we currently do? |
@Turbo87 would love your 👀 on this, and ideas to improve it. |
In the upstream changes this case is handled properly in the default scenario you describe. When the config includes an array (where options are the second item in the array), those options are used for the cache key by default. If a function is found in that options hash, it is expected to include its own
We cannot bundle here, as it is dependent on the Ember version in use by the app itself (and changes per build).
I'm not sure what else we can do, but we must do something. I'm definitely open to ideas... |
This works in conjunction with the changes made upstream in broccoli-babel-transpiler to allow individual plugins to augment the cache key.
Updated to make |
Chatted with @Turbo87 and he is not super opposed to shipping this for now and coming back to fix things when Ember itself can ship as an NPM package (and we can avoid passing this function around like this). |
Provide
baseDir
and pass through second argument ascacheKey
.This is backwards compat to 0.0.5...