-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
Consider reducing ensure_compiled checks #329
Comments
relevant: #173 |
I also would like to add that the guess may emit false negatives: i.e. it will say that a module is not available when it was just not made available yet. |
Thanks for letting me know! As @liamwhite points out there have been issues with the I agree that explicitly passing module names would be the best. After working on it for a bit I don't see any easy way of doing that though (e.g. how The reason why I'm using You may want to just define all extensions you want to use in one place. Right now I've a few ideas:
I'll try a few things out and see what can work, and if there might be some other way to prevent having to call |
For runtime, you don't need
This could be a good approach. To close the gap, you could have a test people would put in their apps and in the test you would traverse the base module and all modules in the system to see if anything was not configured properly.
This way you remove the validation concern from compile/runtime and into test.
Yup, try/catch would have exactly the same issues. |
Resolved in #335 which adds a base module to all extensions that can be used to check what the extension supports. This should prevent all I did think about requiring explicit However, that requires some more consideration for how config in Pow should work and how extensions should be structured, so I've opted to look into that at a later point. Thanks for the help! |
Hi @danschultzer!
Apologies this the wrong repo, but I am relaying a bug report done on Ecto. The mechanism Pow currently uses to discover modules may considerably slow down compilation, as each
ensure_compiled
call to a module that does not exist will halt the compilation of the current module until all other modules in the system are compiled. Since you are performing this check to find guesses, it will halt in many cases. If one module happens to check the other that is also running the same check, they will deadlock. This is a circular dependency which will likely emit warnings in the future. I would drop the implicit checks and guessing in favor of explicitly passing module names.Thanks!
PS: I will improve the docs for
ensure_compiled
with these notes as well.The text was updated successfully, but these errors were encountered: