-
Notifications
You must be signed in to change notification settings - Fork 68
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
Are all dependencies required at runtime? #24
Comments
Hi @matthewwithanm, thank you for your question!
Yes. You are right.
The answer is, "All of the dependencies necessary". That's due to my design decision. In transformation phase, instrumentors (including babel-plugin-espower) transform assertion expressions by AST level so they should store original expression into code. At runtime, power-assert-formatter parses them back by using acorn, calculate locations, then maps captured values in a diagram form.
Ah webpack... Maybe you need to add some webpack loaders to suppress warnings, but you may not want that.
Yes. Currently here is the only channel for questions.
Thank you for using power-assert! |
Thanks so much! That clears things up a lot. As for the webpack stuff, there seem to be two things at play: 1) the use of a dynamic require (which I assume is the same reason for this), and 2) acorn's use of a built file. Neither of these is really an issue with power-assert (though a FAQ addressing them would be awesome). Thanks again for the help! |
Hi @matthewwithanm, thanks again for your information!
Okay, I'll add FAQ section to README. |
I have some tests that I'd like to run both in node and the browser. The tests are compiled using Babel (with babel/register to run in node, and with webpack's Babel loader for the browser).
My assumption was that I could just add babel-plugin-espower to my .babelrc plugins in order to apply the transformation for both cases. This worked, however, the browser build is including power-assert's dependencies, including acorn (some of which are causing webpack to generate build warnings). I think I understand why this is happening; my tests require power-assert, so naturally the dependencies are getting bundled.
So my question is, are all of the dependencies necessary at run time or are they just required for the transform? (If just for the transform is there a recommended way to omit them?)
I hope this is the right forum for this question! Thanks so much for such an awesome project!
The text was updated successfully, but these errors were encountered: