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

Parallel compilations appears to troll hash-for-dep cache #623

Open
asakusuma opened this issue Jul 26, 2018 · 6 comments
Open

Parallel compilations appears to troll hash-for-dep cache #623

asakusuma opened this issue Jul 26, 2018 · 6 comments

Comments

@asakusuma
Copy link

I noticed that rebuild time for a particular addon (with a lot of handlebars AST transforms) recently ballooned from a few seconds to 80-90 seconds.

It appears that something (I'm guessing the parallel compile) is causing hash-for-dep to be invoked as multiple modules, instead of a single module. Since the hash-for-dep cache is module scoped, invoking as multiple modules means that the cache is effectively useless.

EDIT: The cache was only created once in ember-cli-htmlbars-inline-precompile@1.0.2. When I upgraded to 1.0.3 is when the multiple caches thing happened. There were other things also upgraded though at the same time.

cc @stefanpenner

@stefanpenner
Copy link
Contributor

thanks, I think I'll try and (tonight) disable the parallel support in this plugin, until we re-work it to not have this issue.

@scalvert
Copy link

Specifically, the issue appears to be localized to the changes in babel-plugin-htmlbars-inline-precompile. Looking at the diff in v1.0.2 to v1.0.3, you can see that one of the dependency bumps includes babel-plugin-htmlbars-inline-precompile, where it reved version v0.2.3 to v0.2.5. v0.2.5 of that plugin contains fixes to parallel builds.

Pinning to v1.0.2 of this lib fixes the issue.

@stefanpenner
Copy link
Contributor

stefanpenner commented Aug 23, 2018

@scalvert the plugin in question, needs to reduce what hash-for-dep considers a dependency of it. I explained how to @asakusuma.

Previously, this plugin was not correctly considering it's cache key or opted out of parallel.

Both the plugin in question, and this plugin need some work. But if the above recommendation I gave @asakusuma is applied the problem will go away entirely (and it will perform better then even the improvement here could do).

@asakusuma
Copy link
Author

@stefanpenner since I forgot, and for future travelers, can you explain how to control what ember-cli-htmlbars-inline-precompile's hash-for-dep thinks is a dependency?

@stefanpenner
Copy link
Contributor

Improve hash-for-dep docs: https://github.com/stefanpenner/hash-for-dep/blob/master/README.md#what-does-hash-for-dep-consider-a-dependency

If something can be made clearer please open a PR/issue over there.

We will eventually add docs to the various consuming repos that have plugin authorship extensions (htmlbar/babel)

@rwjblue rwjblue closed this as completed Oct 12, 2020
@rwjblue rwjblue reopened this Oct 12, 2020
@rwjblue rwjblue transferred this issue from ember-cli/ember-cli-htmlbars-inline-precompile Oct 12, 2020
@rwjblue
Copy link
Member

rwjblue commented Oct 12, 2020

Is this still an issue?

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

No branches or pull requests

4 participants