alexisvincent / systemjs-hot-reloader

reloads your modules as needed so that you can have satisfyingly fast feedback loop when developing your app
MIT License
228 stars 36 forks source link

Prev instance mocking #48

Closed peteruithoven closed 8 years ago

peteruithoven commented 8 years ago

Alternative fix for https://github.com/capaj/systemjs-hot-reloader/issues/34. It temporarily creates a module that contains the previous instance of the module that's being re-imported. This is currently only the root module.

Because I needed a placeholder I've create a prevInstance.js file in the package. I would really love a better solution. Another hack is that the hot-reloader.js contains the name of the package;

const prevInstancePath = System.normalizeSync('capaj/systemjs-hot-reloader/prevInstance.js');

I would prefer to do something like:

const prevInstancePath = System.normalizeSync('./prevInstance.js');

Curious what you guys think of this solution. Ideas are welcome.

capaj commented 8 years ago

@peteruithoven sorry for a delay. So this would make redux work with system-js-hot-reloader?

peteruithoven commented 8 years ago

Actually the approach I suggested in https://github.com/capaj/systemjs-hot-reloader/issues/34#issuecomment-174723848 is much simpler and doesn't require changing the hot reloader, so I think that's the preffered way. I'll close this for now.