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

Conflicts with babel-preset-power-assert #115

Open
ELLIOTTCABLE opened this issue Jun 22, 2017 · 2 comments
Open

Conflicts with babel-preset-power-assert #115

ELLIOTTCABLE opened this issue Jun 22, 2017 · 2 comments

Comments

@ELLIOTTCABLE
Copy link

When using the power-assert preset (see power-assert-js/babel-preset-power-assert#4, not when used individually as plugins), Istanbul and power-assert don't like eachother very much.

More information over there; I suspect it's a problem with load-order within babel, and one of the two systems stomping on eachother. Only posting here as a cross-reference.

@bcoe
Copy link
Member

bcoe commented Jul 22, 2017

@ELLIOTTCABLE we've seen similar issues with babel-plugin-lodash and babel-plugin-rewire. In the case of babel-plugin-rewire we were able to write some defensive code in istanbul-lib-instrument to step around the error (the include order of the two plugins did however have an effect).

Where possible, I'd like to continue adding defensive logic in the instrumenter, to diffuse these plugin conflicts; at the same time, it might be worth also opening a conversation on babel/babel to discuss how these problems might better be avoided -- seems like theme at this point.

@ELLIOTTCABLE
Copy link
Author

ELLIOTTCABLE commented Jul 23, 2017

Good to hear that defensiveness and compatibility are project goals! Power to you.


Yeah, I would definitely consider this an upstream problem (ordering is always going to matter when applying transformations to source-code, pretending it doesn't is a pipe-dream; and if order matters, robust tools for controlling ordering are seriously necessary. (This is of especial interest to me as a programming-language theorist and messer-around with S2S transforms! 🤣)) Personally, I like the traditional solution — ‘niceness’ or ‘priority,’ with projects being able to document “this needs to happen before some things” (nice: 0), or “this needs to happen after most other transforms” (nice: 20), etc; although something overengineered involving graphs and explicit dependency-graph declaration is possible as well ¯\_(ツ)_/¯.

That said, it's not my battle to dive into with Sebastian et al. If you think it's worth bringing up, drop a mention of this thread, and I'm happy to offer my arguments, though.


Meanwhile, feel free to consider this Issue low-priorty — it's an easy fix, even if it's underdocumented, to just swap the two. (=

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

No branches or pull requests

2 participants