-
Notifications
You must be signed in to change notification settings - Fork 36
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
NodeJS support #61
Comments
For me this would ease the speed of NodeJS development in SystemJS considerably. What would be necessary in order to adapt hot-reloader to make this possible? |
This would be useful in the main process of electron apps. |
I now have this working with electron + jspm + typescript + react + mobx, for both the electron main process (which is node) and the renderer processes (which is a browser). The starter project is at: https://github.com/AntonyBlakey/starter-electron-jspm-typescript-react-mobx and the reloader that it uses (a modified version of this one) is at: https://github.com/AntonyBlakey/systemjs-hot-reloader. The key was to separate the reloader from the socket creation, because I don't have a fix for the jspm + typescript typings issue, but that's not too hard to work around either by replicating the jspm installs as npm installs, or symlinking automatically between |
@AntonyBlakey Would you be willing to bring your changes into this project. |
@alexisvincent Do you have an idea on how We are currently trying to run our testcases on node. They can't be run because node is not aware of '@hot', obviously... |
@mpfau This depends on what your tests are being transpiled to. How are you running your tests on node? (Since |
@alexisvincent found a workaround to stub const Module = require('module').Module;
Module._cache['@hot'] = {exports: {module: undefined}}
const resolveFilenameNode = Module._resolveFilename
Module._resolveFilename = function(request, parent, isMain) {
if (request === '@hot') return request
return resolveFilenameNode(request, parent, isMain)
} |
Very nice. Out of interest, what testing framework are you using. |
We recently switched from tape to ospec (https://github.com/lhorie/mithril.js/tree/rewrite/ospec). It has been written by the very smart Leo Horie (author of mithril). |
I wonder if it would be possible to create a variation of this project that works for Node apps running SystemJS? That could potentially just use the hot-reloader component with some built-in file watching method of sorts, that could just need to be imported to work.
Just putting this down here as a feature to consider, feel free to close as well.
The text was updated successfully, but these errors were encountered: