Comments (7)
I'd be happy to work on a PR in the idea is accepted.
from systemjs-hmr.
Sorry that I haven't responded promptly. Been working to meet a few deadlines. Will check this and your other PR out tomorrow. 👍 Glad to see you taking such an interest in the project :)
from systemjs-hmr.
For a quick initial look, I can't think of a reason not to implement this. With regards to config.
ATM, the config mechanism for reloads is handled as a second arg to System.reload(moduleName, meta)
. Where you can specify information regarding how to do the reload. Although it makes sense to also have a config object for the reloader. (Although for now, we can cover all use cases through the meta object).
Since System.reload is expected to be called by external tooling it's not too big of an issue at this point in time that config is specified every reload.
Will think about this properly tomorrow.
from systemjs-hmr.
I would like this as well, for css
files for example (want to hot reload the stylesheet only, not rerender the whole page from scratch etc.)
from systemjs-hmr.
An easy solution would be to make findDependents
take into account meta.roots
. Something like:
// https://github.com/alexisvincent/systemjs-hmr/blob/master/lib/next.js#L133
if (!dependents.has(dep) && !roots.includes(dep)) {
/* ... */
}
Where roots
will be passed to it from System.reload
. This way, a user of the library can define the points at which reloading stops.
from systemjs-hmr.
@mosho1 The only issue with that would be that the lib has to traverse the tree to determine children it needs to delete. But something like that would be nice and general... I wonder if it's worth being this general. Can you think of a reason we might want to stop somewhere other then just the node or its roots?
from systemjs-hmr.
You can have all kinds of custom reloading scenarios, I don't see a reason to limit it to just the module itself or the roots.
Off the top of my head, say you have multiple data stores that aggregate to one big store (like redux stores) where you want the whole store to reload on change to any of its child nodes, but you might not want the whole app to render again. So any reloads to the child nodes should reach the aggregate store which has the actual reloading logic and then stop.
from systemjs-hmr.
Related Issues (20)
- Better Error Handling HOT 1
- Preemptive File Loading HOT 6
- Deleting old source maps HOT 4
- Add debounce
- Next Major (systemjs-hmr and systems-hot-reloader) HOT 6
- TypeError: Object.values is not a function HOT 4
- parentKey.indexOf is not a function HOT 5
- TypeError: Cannot read property '__reload' of undefined HOT 1
- reload deps children HOT 4
- Display err.originalErr HOT 2
- The systemjs-hmr polyfill must be loading after SystemJS has loaded HOT 8
- Every other hot reload fails with browser exception HOT 12
- New release 2.0.10 HOT 1
- systemjs-hmr is searching for Maintainers!
- script errors on load? HOT 3
- SystemJS 0.21.X HOT 2
- __unload function and AMD HOT 3
- Support SystemJS >= 2.0.0
- Rollup and import { module } from '@hot' HOT 1
- Question with @hot HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from systemjs-hmr.