Comments (10)
Hey @JBBr
Thanks for the amazing write-up! Wonderful to get such clear issues.
I'd rather just support "safe" writes (aka atomic writes). I think I have this working now, and it will be in the next release. What OS are you on? I'm on Linux. I'm going to leave this issue open so when the next release is out you can confirm that this is working.
The speed thing might have just been other improvements we've been making in meteor-hmr. The atomic writes should be very close to the same speed as a normal write.
from meteor-hmr.
thanks, just tell me if I can help you in any way (test master on osx/linux/windows with "safe write" or anything else)?
btw: I tested the new refactor.7 release as it includes your "atomic writes" commit. Unfortunately hot-reload still fails with Intellij's "safe write". No error log in console anymore (As the TODO log for renames has been removed).
whoops, my fault. Sorry for the confusion. Although refactor.7 has been released after the "atomic writes" commit, it's not yet in the packaged accelerator version. So I will probably have to wait for a new release or try the master directly.
from meteor-hmr.
Best way to test is to try master directly.
from meteor-hmr.
hey guys sorry i'm away for the weekend, i might have made a mistake somewhere trying to get this out before i left but i'm pretty sure the latest accelerator should be running, v1.0.7. What I maybe didn't mention is that you must quit Meteor and restart it to load the new accelerator version (maybe we'll fix this in a future release). it's a long weekend here so might only be back tuesday :)
from meteor-hmr.
I did a meteor reset
and ran meteor again with refactor.7
build. Now meteor-hotload-accelerator
includes the changes.
Unfortunately hot reload still does not work with "safe write" setting. Just get a plain => Client modified -- refreshing
in meteor console and a full browser refresh on every change.
But don't worry, have a nice weekend! I think this isn't a major problem anyway - it's just confusing for people how do not understand why hot-reload isn't working as it's supposed to.
from meteor-hmr.
Thanks for the patience, @JBBr. Either way I'd like to try get this fixed, ideally meteor-hmr should work correctly wherever meteor does. The problem is just how unreliable node's fs.watch()
is, in certain circumstances and across platforms. Can you try gadicc:ecmascript-hot@=1.3.2-refactor.8
and see if it's any better?
from meteor-hmr.
I also added this to the README in the meantime:
On a save, you should see the following on the client console:
[gadicc:hot] Connected and ready. [gadicc:hot] Updating ["/client/colors.js"] [gadicc:hot] Skipping HCP after successful HMR
If you're not seeing that, probably we're not picking up the save. The
biggest reason for this currently is atomic writes ("safe writes"),
which we're working to fix. You can track the progress in
#53.Otherwise see further down about DEBUG LOGGING.
from meteor-hmr.
You can try gadicc:ecmascript-hot@=1.3.2-refactor.9
too... would love feedback on both releases.
from meteor-hmr.
Nice, it works for me now in both refactor.9
and refactor.8
. I'm on OSX 10.11 by the way. I haven't tested it yet on other systems. Maybe the behavior of file watches is different on Linux/Windows.
While using refactor.9
I had an issue with removing an element (in this case removing an entire <p>something</p>
. The whole Meteor process crashes with the following output.
I wasn't able to reproduce this and I'm not sure if this has to do anything with atomic writes or even meteor-hmr. Looks more like some kind of websocket connection problem. But just in case - maybe you see the cause of this directly.
undefined:0
/Users/user/.meteor/packages/static-html/.1.0.7.c2cb7b++os+web.browser+web.cordova/plugin.compileStaticHtmlBatch.os/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:116
^ throw error;
^
Error: EBADF, write
SyntaxError: Unexpected end of input
at Object.parse (native)
at WebSocket.<anonymous> (/Users/user/.meteor/packages/gadicc_ecmascript-hot/.1.3.2-refactor.9.h926c6++os+web.browser+web.cordova/plugin.compile-ecmascript-hot.os/npm/node_modules/meteor/gadicc_hot-build/node_modules/meteor-hotload-accelerator/lib/accelerator.js:89:22)
at WebSocket.emit (events.js:98:17)
at Receiver.self._receiver.ontext (/Users/user/.meteor/packages/meteor-tool/.1.3.2_4.1ig628y++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/ws/lib/WebSocket.js:682:10)
at Receiver.opcodes.1.finish (/Users/user/.meteor/packages/meteor-tool/.1.3.2_4.1ig628y++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/ws/lib/Receiver.js:391:14)
at /Users/user/.meteor/packages/meteor-tool/.1.3.2_4.1ig628y++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/ws/lib/Receiver.js:372:33
at Receiver.expectData (/Users/user/.meteor/packages/meteor-tool/.1.3.2_4.1ig628y++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/ws/lib/Receiver.js:147:5)
at Receiver.expectHandler (/Users/user/.meteor/packages/meteor-tool/.1.3.2_4.1ig628y++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/ws/lib/Receiver.js:371:16)
at Receiver.add (/Users/user/.meteor/packages/meteor-tool/.1.3.2_4.1ig628y++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/ws/lib/Receiver.js:87:24)
at Socket.firstHandler (/Users/user/.meteor/packages/meteor-tool/.1.3.2_4.1ig628y++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/ws/lib/WebSocket.js:663:22)
from meteor-hmr.
Yay! Thanks for reporting back. Ok, so the big change I did from refactor.8 -> refactor.9
was unnecessary, but probably more sustainable :) I'm on Linux, so we have that covered... Windows, I'm hoping that since I'm using Atom's patchwatcher code now, well, it seems to be a lot more stable and cross-platform compatible.
One more report from @clayne11 here:
refactor.9 working for me with:
OS: Mac OS X 10.11
Text editors: Atom, vimvim definitely didn't work with refactor.7
I'm going to close this issue since we've solved it. But the other error you saw, we do use a websocket for the hmr and I've definitely seen this error before, so it probably is hmr-related. If you see it again, please open a new issue, especially if you figure out how to reproduce it. One possibility is this is caused by not using atomic writes (where the "changed" event can fire multiple times during a long write)... I should probably debounce the event.
from meteor-hmr.
Related Issues (20)
- Check for NODE_ENV !== 'development' and not NODE_ENV === 'production' HOT 7
- When in package but not app: "Arguments to path.join must be strings"
- Redbox problem HOT 2
- [Windows] [beta.6] .babelrc path error HOT 6
- [Windows] [beta.4] Random websockets error HOT 1
- Not working with Meteor 1.3.3.1 HOT 4
- [2.0.0-beta.6] Wrong file getting hot-reloaded HOT 1
- [2.0.0-beta.6] Getting into an infinite loop
- Refused to load the script 'http://localhost:3002/hot.js HOT 9
- Uncaught RangeError: Maximum call stack size exceeded
- "No (relevant) hot.accept() in..." (with an incomplete import chain) HOT 10
- Track dynamic require() calls to augment import chain
- Failed to parse SourceMap: http://localhost:3000/packages/f6ecec4bc04452452b12b571877bd3802b84f242.map
- Seems to rely on settings.json when run in Cordova HOT 10
- "Uncaught TypeError: Cannot read property '_collection' of undefined" when run in Cordova
- Path must be a string
- reloading-related WebSock problem stops meteor from booting HOT 1
- Doesn't work with Meteor 1.4.1.2 HOT 27
- Conflict: Constraint [email protected] is not satisfied by babel-runtime 1.0.1. HOT 3
- Info for potential maintainers
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 meteor-hmr.