Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Eli White
    @TheSavior
    I think it is reasonable to say that we support everything our unit tests cover
    By merging and releasing quickly we enable it to be quicker to get fixes, and we at least validate against regressions
    speedskater
    @speedskater
    thats reasonable but I mean more something like the wildcard imports we haven't considered in the first place but are out there. But I like your approach regarding using existing libraries and their unit tests for integration
    we can do this. I would propose the following. I create the babel 6 release till the end of this week. than I will make you contributor as well and we try both to merge asap and release after some kind of four eye check?
    Eli White
    @TheSavior
    I don’t have the context for specific code changes as you do
    But that sort of plan sounds good in the aggregate
    speedskater
    @speedskater
    Okay. Than I'will try my best to stick to the plan. I will have to go offline now. We can chat again in some days after the released version.
    Eli White
    @TheSavior
    :+1:
    speedskater
    @speedskater
    bye
    speedskater
    @speedskater
    its done babel 6 version shipped as rc1. As soon as no major issues occur we will finally ship 1.0.0
    and from there move on as planned
    Andrew Throener
    @trainerbill

    @speedskater I am interested in testing out this plugin. I npm to the babel6-support branch and added it to babelrc and getting:

    SyntaxError in plugin 'gulp-babel'
    Message:
    Unexpected token import

    Andrew Throener
    @trainerbill

    changed to master branch and getting:

    TypeError in plugin 'gulp-babel'
    Message:
    Filename must be a string

    speedskater
    @speedskater
    @trainerbill I think you can just use the main branch and run 1.0.0-rc-1 as this is the current default version. the babel6-support branch is quite old
    Eli White
    @TheSavior
    @speedskater I’m pretty excited about this version but it looks like it doesn’t quite work with our system at work yet
    Andrew Throener
    @trainerbill
    @speedskater Yeah I got it working. I also had rewire installed which it was choking on.

    @speedskater on thing I am noticing is that Rewire isn't available on a * import:

    import * as mymodule from './mymodule;

    mymodule.Rewire is undefined. if I have a export default fallback it seems to work. Is that your suggested use?

    Andrew Throener
    @trainerbill

    @speedskater came across an edge case. I am getting:

    Duplicate declaration "typeOfOriginalExport" (This is an error on an internal node. Probably an internal error)

    and I think its because it is doing the rewire twice. I am using gulp babel and also a build procedure with a dynamic require. Is there a check to see if the import/require has already been rewired?

    Eli White
    @TheSavior
    @trainerbill Did you search the issues? speedskater/babel-plugin-rewire#106
    Andrew Throener
    @trainerbill
    thx @TheSavior. Did you find a work around?
    Eli White
    @TheSavior
    Nope. We are still on babel5 because of it
    I’m curious how similar of an environment you are in to us
    Are you using browserify with babelify?
    Andrew Throener
    @trainerbill
    no. I am working on the server side in Node
    Eli White
    @TheSavior
    Did you look at the repro repo that I put up?
    You should see if you have a similar situation of requires
    Andrew Throener
    @trainerbill
    but i have a build process that builds to a folder, then I have a dynamic require(cause I can't get systemjs to work) and I am requiring a file out of the build folder which is now rewiring twice. once in the build and once again in the gulp test process with mocha
    Eli White
    @TheSavior
    If not, you should comment out all of the code in your project until the error goes away and put up the smallest test repo you can
    It would help us make sure both of our situations are taken care of
    Andrew Throener
    @trainerbill
    that would be tough... I am going to look through the plugin code and see if I can fix it quick. will report back
    there is a wasProcessed
    so it seems like this was at least thought of
    Eli White
    @TheSavior
    It shouldn’t be that hard to track down. There is one file in your require tree that if you require that, it has requires that fail. Just gotta find that file, and which require it fails on
    Andrew Throener
    @trainerbill
    I know what one it is... I have a glob that dynamically imports custom modules
    but I am writing tests for it so I kinda need it in there...
    Andrew Throener
    @trainerbill
    @TheSavior So when I just do a straight build should i not see the __noRewire somewhere? It seems like that is what prevents the plugin from trying to rewire again... but on my builds I am not seeing it anywhere.
    Eli White
    @TheSavior
    Truthfully, I’m not sure
    Andrew Throener
    @trainerbill
    just spit balling to try and get a resolution so they can fix it faste
    speedskater
    @speedskater
    @trainerbill Can you provide your sample file in a PR (similar to the existing samples) ?
    Regarding the wildcard import. This is intentional. The reason is by allowing to import the rewire to exist on a wildcard import it may break existing code. E.g. it would be possible another module using your module expectes that only certain functions or objects are exported and breaks on the rewiring api. But you can use a named import to get to the API.
    Jason English
    @jasonenglish
    Does rewire work with external libs? I'm able to get it to work with my existing modules, but when trying to rewire a lib I import, none of the rewire api exists.
    speedskater
    @speedskater
    @jasonenglish Theoretically if you transform the code of the external library it should work as well. What is your reason to do this?
    Jason English
    @jasonenglish
    @speedskater jasmine unit tests where it expects that the method is called with the correct arguments
    @speedskater is there a better practice for testing function calls from external libraries?
    speedskater
    @speedskater
    @jasonenglish Maybe. Assume you want to test your module A, which has a dependency to module B, where B is an external module. In this case you only have to transform module A because. By transforming module A you are able to rewire the dependencies to methods of B within A. This allows you to track and spy on the external calls. Does this answer your question?
    Jason English
    @jasonenglish
    @speedskater I think it might, I'll try doing that. thanks!
    Richard Marks
    @RichardMarks

    I am trying to get babel-plugin-rewire@1.0.0-rc-2 to work on a babel 6 karma mocha webpack setup, and I have followed the instructions in the readme, and I am ending up with the following error

    Uncaught TypeError: Cannot read property 'Rewire' of undefined

    Any advice/assistance would be most appreciated

    that is double underscore Rewire double underscore ... gitter interpreted it as markdown oops
    Uncaught TypeError: Cannot read property '__Rewire__' of undefined
    there
    Gavri (Gabriel) Guy
    @gavriguy
    I tried to search for it but couldn’t get a clear answer - is there a way to rewire an es6 class instance method?