Repository navigation
Conversation
Current coverage is 87.56%@@ master #3585 diff @@
==========================================
Files 194 194
Lines 8949 9306 +357
Methods 1007 1052 +45
Messages 0 0
Branches 2004 2107 +103
==========================================
+ Hits 7829 8149 +320
- Misses 1120 1157 +37
Partials 0 0
|
|
Thanks! 👍 |
| }); | ||
| } else { | ||
| uid = addRequire(source, maxBlockHoist); | ||
| } |
There was a problem hiding this comment.
Could you validate this with a file like
import Foo from 'foo';
import {named} from 'foo';
console.log(Foo, named);
I think at the moment we merge the require calls for multiple imports with the same source, so this might be an issue.
There was a problem hiding this comment.
Ok I'm getting
import a from "bar";
import {b} from "bar";
console.log(a, b);var _bar = require("bar");
var _bar2 = babelHelpers.interopRequireDefault(_bar);
console.log(_bar2.default, _bar.b);|
Ok, slight complication is that amd/umd depend on commonjs so this breaks those (this is probably the reason why it was split up), so need to add some logic to amd as well to account for this.. |
e0cf517 to
52dee1c
Compare
52dee1c to
3665f3f
Compare
|
So @loganfsmyth brought up the issue of users who might be using the es2015 preset but with a fixed version of the umd/amd plugin which would fail in the current setup in this case the commonjs plugin which is part of es2015 would be updated and the umd/amd plugin would still be pinned so it would break because it depends on both working? |
I did a similar mod when cleaning up my plugin tests 😀 |
|
@hzoo can that be solved without being able to version the packages independently and publish a new major? (And is the benefit worth the effort?) |
|
I'm not sure it can? Both plugins inherit from cjs transform so I was trying to figure out how to only run something for the cjs transform.. but if they both run everything in the cjs plugin and you can't change the other 2 plugins (because of the pinned dependency) it would break since it changes the default behavior of the cjs transform. Basically did bb6b9bb (the last commit) |
|
Ok looks like we can't really do this to support live bindings according to @loganfsmyth, @benjamn. I'l keep up by rebased version of this PR at #6039 if people really want this as another option, but it can go in later after 7.x unless someone else wants to review/finish it up. new PR: #6039 |
|
This should land in beta.1 |
Ref https://twitter.com/dan_abramov/status/755104686471049218 (thanks to @gaearon for the question/suggestion).
src change
new actual test
expected test of old code 😢
new expected test 😸
Old test changes
FYI: I remembered that babylon had a feature where if you don't create an
expected.jsfile, it will be generated for you automatically. I remembered there might of been something like that for babel and so I found this. I just uncommented this for the tests to change to the new expected behavior (saved a lot of time, and yes it should be probably be fixed/added under some flag and added to contributing in https://github.com/babel/babel/blob/master/CONTRIBUTING.md#writing-tests).Will need to think about where else this could be applied (just have to look at some existing tests). I think we can do it for wildcard too)