-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server always rebuilds even when only client side javascript changed. #10591
Comments
That was the original behaviour, before ES imports, thing under the client folder will only be imported at the client and will result in client only refresh. Benjamn mentioned that he has plan to generalize this behaviour (not depending on the client folder) for both the main app and the packages, which I'm really looking forward to! |
Yes, but the imports folder was supposed to be exempt of this, no files
inside that folder should be eagerly loaded...
|
Are they eagerly loaded? I don't think so, I think it just impact the dev refresh behaviour, but maybe I'm wrong. Either way, since the client files can be inferred by tracing the import dependency tree starting from the client entry point, I think the refresh behaviour can be generalized beyond the client folder, for both the app and packages, which I think is what you looking for. |
Would this also help with issues like #10106? We've moved to a multi package.json architecture to have jest, eslint and other dev only depencencies in another node_modules outside the meteor app... which is pretty annoying as we have to configure jest and webpack to resolve modules from multiple folders causing hard to debug bugs from time to time. |
@sakulstra I am referring to a completely different thing here... Nothing to do with jest, server-side code or windows vs linux. This may incidentally produce less rebuilds so in the end speed up your devs tough. @aliogaili I double checked, I did not use the right vocabulary. They are in fact not eagerly loaded. As I was myself pointing out that the console.logs weren't showing. So they are not used at all by the server code but the file watcher seems to trigger both reloads anyways since it is not inside a client parent folder. |
Having the same issue on Is there a way to find out 'why' Meteor decides to trigger a rebuild of either side? Something like; I've browsed the server bundle trough the (chrome) node-inspector, but the file I touch isn't listed there. |
Even with an empty All my code lives in
|
@smeijer Does your application use the @Salketer Using the final/official release of Meteor 1.8.2, I can no longer reproduce the server refresh for edits to |
@benjamn , it does:
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
adding activity |
I thought this was resolved in latest version? I've not tested it yet. |
@smeijer is there a reproduction you can share? |
It's a large application that I then should somehow try to slim down. As I said, it's not every file that triggers it. Is there a way to log which dependency path triggered the rebuild? Something like
? |
I agree that would be useful. There is currently no easy way to do this. Note that there may be multiple paths.
It's something I could have used in the past already, so maybe I'll see if I can tackle this next week, but feel free to beat me to it. |
Turns out, the reproduction is quite simple. It looks to me that the server still always rebuilds when changes are detected that were not in a If I understand correctly, the I have a repo here: https://github.com/smeijer/meteor-rebuild-issue/
|
@smeijer yes, that's because Meteor has to watch all those directories in case you have commonjs requires, which are not statically analyzable. E.g. you can do something like: If you would only have es6 imports, we can just rely on Meteor's ImportScanner to add the necessary files, but unfortunately that's not an assumption we can make. |
@sebakerckhof, that makes sense, but it is really unfortunate. Would it be possible to add a setting to the A more advanced solution would perhaps be to see if the imported path has any |
Yeah, but Meteor tries to be a zero-config tool as much as possible, so I'm personally not in favor of adding an such an option. It could be automated. Meteor already scans for imports/requires etc. in the ImportScanner, so it wouldn't add much cost, but this currently happens way after the watches are added. Plus, There might be more reasons to watch the files I don't know about (but @benjamn does). Anyway, I made a quick and dirty version which allows to skip watching with an envar when you only have static imports, you can try it out, by cloning this branch: https://github.com/sebakerckhof/meteor/tree/feat/watchset-feedback |
It would be nice if #10455 could be continued or even getting merged. It would solve the trouble of long rebuild times due to a server refresh when only the client is being updated. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Ping |
Hi, we have a PR that is passing with changes to fix this issue. PR #11381 We should have a review next week so we can proceed. |
Possible duplicate of #9960 |
This PR #11474 should finally fix this soon 😉 Keep watching! |
I see a couple complains in the form of #10449 about meteor packages causing server rebuilds.
But without using packages, the behavior is the same.
Changing something in
/imports/ui/pages/home/home.js
causes a server rebuild, while changing something in/imports/ui/pages/home/home.html
causes only a client rebuild.I have tried to move back to 1.8.0.1 and the result is the same.
Digging a bit more, it comes to the fact that the ui directory is not inside a client directory. Putting it inside a "client" directory works. The thing is that
/imports/ui/pages/home/home.js
is only imported by the file/imports/startup/client/routes.js
which is only imported by/imports/startup/client/index.js
I see no reason for that particular file to be imported/used server-side, but it still causes server rebuilds. I have also trying using console.log and throwing errors on the root level of the file and nothing impacts the server so I assume it really is not loaded by the server.
The text was updated successfully, but these errors were encountered: