Comments (36)
Pushed and published to npm
from systemjs-hmr.
Thanks for the issue. I can't look at it just yet, I'm swamped with deadlines. But will check this out on the weekend.
from systemjs-hmr.
Can you be more specific? It would be really helpful to see an example dependency tree.
from systemjs-hmr.
I will try to come up with a minimal example and ping you here!
from systemjs-hmr.
Any progress on this?
from systemjs-hmr.
I am currently occupied with my studies but will post an example on Friday.
from systemjs-hmr.
Great :)
On Wed, 02 Nov 2016 at 23:26 Frederik Schubert [email protected]
wrote:
I am currently occupied with my studies but will post an example on Friday.
—
You are receiving this because you commented.Reply to this email directly, view it on GitHub
#3 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABz4rSRRBRm0DHvPfPP6lbiQp95BS14Bks5q6QAJgaJpZM4KYEDg
.
from systemjs-hmr.
It is really difficult to come up with a minimal reproducible example for this issue. This error appears "sometimes" in our angular 2 projects. I suspect that the error is connected to how the decorators are evaluated.
One possible fix would be to reimport the modules in the order in which they were loaded the first time. As far as I understood from the code, the order of the reimports is decided by the order of Object.keys
.
Sorry that I cannot come up with something more helpful yet.
from systemjs-hmr.
I need to have a good look at how this hot reloader works. I think this codebase can be greatly simplified. But I may be wrong. I'm in the process of refractoring and adding comments. So I'll be in a better place to look at this later this week. SystemJS handles circular deps according to the spec. And when I take a look at this I'm hoping it's as simple as recursively deleting modules upwards and then reimporting the root and relying on SystemJS for the rest
from systemjs-hmr.
Yes that would have been my approach as well. Currently the modules are deleted and reimported manually by the plugin.
The manual reimport is needed to call the reload
hook of the deleted modules. See here
from systemjs-hmr.
Oh I see. Checkout issue #2. Won't need that reload logic anymore
from systemjs-hmr.
Great!
from systemjs-hmr.
See #2 I pushed a rewrite of the reloader, with new unload and state hydration mechanisms. Should fix your issue.
from systemjs-hmr.
The rewrite looks good! I will give it a try as soon as I can and report my results here.
from systemjs-hmr.
Awesome, if you haven't already read the rewrite, I've added extensive documentation (as in more documentation then code I think), in the next.js file. Should be very clear how it works, I want it to be super simple to contribute.
from systemjs-hmr.
Yes I read through it. It is much easier to comprehend now! 👍
from systemjs-hmr.
Cool cool 👍. The README has been updated to explain how this works.
from systemjs-hmr.
I get the same error as #5. Using the version that is in master.
Seems like I was still using the old version.
from systemjs-hmr.
Oh, you need to import systemjs-hmr/dist/next.js
from systemjs-hmr.
Alright. Now I get this error when the System.normalize
hook is called during reload:
TypeError: this.has is not a function
at SystemJSLoader.coreResolve (http://localhost:3000/jspm_packages/system.src.js:1730:12)
at SystemJSLoader.<anonymous> (http://localhost:3000/jspm_packages/system.src.js:1752:32)
at http://localhost:3000/jspm_packages/system.src.js:2546:36
from systemjs-hmr.
Hmm. How are you testing this?
from systemjs-hmr.
I patched the systemjs-hot-reloader
to use the new API. Basically I just removed the catch
from here.
I also tried to do it via the console but I get the same error.
from systemjs-hmr.
How far does it get in the reload process
from systemjs-hmr.
The error occurs during the normalization. It seems that the prototype patching is not working correctly. The this
in this function has not the right prototype chain. So the call to this.has
fails here.
I should also add that I am using plugin-typescript
but that should not be a problem I guess.
from systemjs-hmr.
I cloned this repo and tried the test and get the same error. Which systemjs version are you using?
I am using SystemJS v0.19.40
.
I inlined the System.has
function and then the hot reload works. In the end reloader.loadCache.clear();
throws an error because the loadCache
is undefined.
from systemjs-hmr.
I found a fix and will make a PR. #7
from systemjs-hmr.
Thanks! I also forgot, when using _System
you need to _System.normalize(System, "someModule")
from systemjs-hmr.
Do your circular reps work now.
from systemjs-hmr.
Now I get this error when the modulename is normalized:
TypeError: CreateListFromArrayLike called on non-object
at eval (http://localhost:3000/jspm_packages/github/alexisvincent/systemjs-hmr@master/dist/next.js:200:50)
from systemjs-hmr.
Sorry. Pushing a fix
from systemjs-hmr.
Great! Now it works!
from systemjs-hmr.
Awesome :) Thoughts on the new state hydration/ unload api?
from systemjs-hmr.
I like it! I am not sure about the @hot
module name but I can't come up with something better. :)
from systemjs-hmr.
If you come up with a better name let me know :) Do you have an opinion on the exporting state vs private persistent object state hydration techniques?
from systemjs-hmr.
I like the current API with the exported state. This gives the developer the freedom to implement the state re-hydration any way he/she likes.
from systemjs-hmr.
Cool thanks for the input.
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.