Conversation
README.md
Outdated
| ### Production | ||
| In production, `systemjs-hot-reloader` maps to an empty module so you can leave | ||
| the `systemjs-hot-reloader` import in your `index.html`. | ||
| the `systemjs-hot-reloader` import in your `index.html`. Just make sure, that `connect()` is only invoked, if it is available (`if (connect instanceof Function)`). |
There was a problem hiding this comment.
Actually, systemjs-hot-reloader maps to a module exporting a single function so you don't need to check for this.
There was a problem hiding this comment.
Hmm, that does not work for me. I am building with systemjs-builder and have to manually add the mapping ("systemjs-hot-reloader": "@empty"). And even then, connect is not a function but an empty Symbol...
Am I doing sth. wrong?
There was a problem hiding this comment.
Theres an entry in the package.json
https://github.com/alexisvincent/systemjs-hot-reloader/blob/master/package.json#L42
which maps it to lib/production.js when production == true. systemjs-builder should respect that.
Also mapping "systemjs-hot-reloader": "@empty" will override my mapping and give you a null option so you have to do what you described in the README
There was a problem hiding this comment.
I see! But that mapping is only active if you are using jspm. I am using SystemJS without JSPM...
Is there any way with systemjs to apply the jspm mapping?
There was a problem hiding this comment.
I think actually that systemjs-builder uses the jspm package info. But its possible not.
The alternative is to in your own systemjs config,
{
"packages": {
"systemjs-hot-reloader": {
"map": {
"./dist/index.js": {
"production": "./lib/production.js"
}
}
}
}
}Or something like that
There was a problem hiding this comment.
Hmm, that does not work for me.
However, I removed the function check around connect() as this is definitely not needed for jspm users.
| * Using a single `systemjs` configuration (`system.config.js` in this case) for the GUI/main and the worker threads simplyfies the setup. | ||
| * The worker is instantiated as usal: `new Worker("WorkerBootstrap.js")` | ||
|
|
||
| ### Circular dependencies / detection of entry points |
There was a problem hiding this comment.
I actually recently updated systemjs-hmr so that it supports circular dependencies in the roots as well :) Check out the findEntries function.
The entries docs are helpful thanks, but in terms of ordering, I would prefer that the workers and entries docs came after the basic usage (including state reloading)
There was a problem hiding this comment.
findEntries (systemjs-hmr@2.0.8) did not work in my case as the entry point is included from multiple other points of the application, too. In my case, the resulting entries list only contains modules that are not imported.
Sure, just change the order to your preferred variant!
There was a problem hiding this comment.
@mpfau The entry points it detects should be sufficient to reimport the full dependency graph. Do you have a reproducible case where it doesn't do this?
There was a problem hiding this comment.
Yes. However, in my case there are hundreds of modules involved. I will try to provide a simple example.
There was a problem hiding this comment.
Thanks. Because if thats the case then theres a bug
No description provided.