-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Do not treat client and server directories specially in packages. #10414
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
Conversation
PR #10414 changes the behavior of the build system in a subtle way that does not automatically trigger recompilation.
124dfad
to
268692a
Compare
Just to tell that i tried the build with the current version of |
We have a different architecture and we build our code inside the packages. We've been depending on the client folders within packages to speed things up, but after this merge I don't think this would be feasible. I think the consistency of the dev experience inside/outside the packages was a valid assumption. |
I've been trying to understand from the issue which prompted this patch: is removing this special treatment of client and server the only possibility of fixing it? If Meteor really wants to drop the packages completely, then this move would be understandable. Otherwise, it precludes one of the really great features of Meteor, the possibility of developing truly modular applications, in the vein of Vulcan for instance. It is a real shame that we don't have this anymore, as it makes it more difficult to develop large yet pluggable applications. |
Can you explain more clearly the technical consequences of this? What happens when I import Edit: I think this thread answers my question: https://forums.meteor.com/t/meteor-1-8-1-client-and-server-directories-in-packages/48452/3 |
The right way to fix this will be for Meteor to respect the "where" argument to Note: the current implementation of client refreshing needs to be improved to use the "where" argument correctly, so this comment is a statement of intention, not immediately useful advice. Sorry for the inconvenience, in the meantime! |
Thank you for checking this up, @benjamn. We are already using the It seems like this is an older, hidden bug, as described there:
|
@manueltimita Right, what you're doing should be enough to make this work without any code changes on your side. However, there are some flaws in the way Meteor currently determines whether it's safe to do a client-only refresh (namely, it relies on |
Thank you for the clarification, @benjamin. |
I'm confused. I'm currently on Meteor 1.8 and have the "special" directories server/client/both. This to me makes sense and I don't know why anyone would want to change that. What I don't like is the imports directory. I think things should act like they do today inside the imports directory, where server/client/both mean what they say, but without the imports directory. Are we still going to have special directories server/client/both in the future? |
@aadamsx We're talking about packages here, not application code. We're going to keep the If you would like all your application code to be loaded lazily by default, so you don't have to worry as much about the
|
Most importantly, this change means that changes to files not used by the server bundle will not trigger a server restart. Fixes #10449 by implementing the strategy I described in this comment: #10414 (comment)
The
client/
andserver/
directories should be meaningful only for organizing application code.Before this commit, if a Meteor package contained a
client/
orserver/
directory, any modules inside it could be imported, but they would not be properly compiled, because thePackageSource#_findSources
method would ignore them in its initial scan, which determines the set of modules that get passed into compiler plugins.Fixes #10393.