Meteor Auto Server Refresh


#1

Hello, I am very new to meteor. Anytime I hit the save button from my text editor, the app from my browser takes average of 10-15 seconds to refresh. I do not have a lot of packages installed but this keeps happening. what could be the possible cause and how do I correct it?


#2

Packages actually affect your build time relatively little because meteor is smart about only rebuilding specific packages that change. If you application code itself is starting to grow, this can cause your build times to start to escalate. I believe there are some performance improvements coming to the build process in 1.2, but until then breaking your app into packages can be very effective to cut build times down to 3-5 seconds


#3

Thanks for your response but my codes are still very minimal. Could the way I structure my app affect the load time? I mean I have multiple folders as am trying to keep things as separated as possible.


#4

hi Henryc, I know what you mean. each time u submit something from the forms, the page refresh isn’t it?? well I always put “return false;” in the end of my events function. return false will make the page not refreshing after you hit the submit button or save button.

Hope this will help :smiley:


#5

Oh this solves one half of the problem but the real problem is this. I make some little changes to my code and hit cntl S, it takes about 15 seconds for meteor server to restart/refresh. This can be very frustrating so am wondering if there is a way around this?


#6

All files you change and are on top level rebuild whole server.
Put your client side files in client folder and it will just refresh client without rebuilding server side.

And if you bundle your stable part of code into packages, also the client refresh times should improve.


#7

Wanted to post a screenshot of my project structure but am a new user and cant upload images yet. but then I structured my app the way you explained. I have client folder and server folder and I put the codes accordingly.


#8

Out of curiosity, which OS are you using?


#9

I am using windows 10


#10

Are you using a UI framework such as Semantic UI?
I’ve noticed the compilation of the less files can cause a delay, I’ve read the build process is also refined / faster in the upcoming 1.2 release.


#11

Unfortunately I’m not sure if this is the case, but if Windows does not provide native file watchers then your build times will be affected due to the need to poll for changes and then refresh. When you make a change and save, keep the command window in the foreground and watch to see if the changes are picked up right away, or if it takes a few seconds for the build process to start… If it takes a few seconds to start, my guess is that is where your perceived build latency comes from.


#12

Yes I am using semantic UI and for some reasons I believe it could be the problem. In my other tutorial apps that I used no UI at all, it was way faster!


#13

It really doesn’t take time on the command line to refresh


#14

Yeah, I’ve never sued Semantic UI… Maybe it’s the dependency on less to compile the css?


#15

it could be, Am not sure.


#16

@marczzio12
Use preventDefault. “return false” will prevent the default behavior (ex.: post) AND stop the event propagation.


#17

ture i figured it out. I use event.preventDefault();


#18

Help! this issue has increased in the past few days. My app takes up to 20 seconds to refresh after every change I make on in my codes


#19

I’m experiencing the same problem. Meteor 1.2, Semantic UI from official package. No packages though. Using proper client and server folders. After saving a change it takes ~20 seconds to reload the page.

I’m using Kubuntu 14.10.


#20

The Problem is Semantic UI… remove the full semantic package and install it in bits depending on the component you need… For instance you can install just the semantic CSS or Semantic dropdown etc.