The jscript transform is perfectly safe for server code, and relatively
cheap compared to the cost of having to compile every file for both the
client and the server, just because the set of plugins is different.
meteor/meteor#7821 is a breaking change for anyone running the `meteor` tool as `root` right now. This moves it higher and explain that it's not just a warning.
If a test process does not explicitly call process.exit, pathwatcher
watchers may keep it alive indefinitely (either that, or there's a bug
with the persistent:false option to fs.watchFile).
This accidental immortality can be prevented by explicitly closing all
watchers when we no longer have any interest in file change notifications.
In particular, optimisticReaddir was getting called before relevant dirty
callbacks were firing, and thus failing to notice actual changes on the
file system.
In general, the tools/fs/watch.js code is the one place where we really
need an up-to-date view of the file system. Put another way, if optimistic
functions worked perfectly, we wouldn't need to rely so much on WatchSet
logic, but for now it's a balance of equally important strategies, and we
shouldn't be compromising one by intermingling it with the other.
This will make it easier to use tools like https://yarnpkg.com/ with the
right version of Node, etc.
With this commit, here's all you have to do:
meteor npm install -g yarnpkg
Then test that it works:
meteor yarn info
Note that any commands registered by Meteor itself will not be honored.
This partially reverts commit 96c95629eb.
When running `meteor update`, we call writeReleaseFileAndDevBundleLink
immediately before reading .meteor/release, so there's no time for a file
change notification to invalidate the cached contents of that file.
In the future, we could perhaps call optimisticReadFile.dirty(path) as a
consequence of files.writeFile(path, ...), but that may be tricky.
Judging from the variety and extent of test failures, switching to
chokidar.watch was too drastic a change for this late-beta stage of the
release cycle.
The problem with pathwatcher.watch was that watches don't survive the
deletion of the watched file, because (like fs.watch) it watches files
based on inodes, not paths. This problem can be solved in a relatively
narrow way, by attempting to rewatch the file after any "delete" or
"rename" events.
Especially on Linux, chokidar.watch tends to throw ENOSPC errors when too
many files are being watched.
I removed this logic earlier because I thought chokidar could handle such
failures by itself, but that was wishful thinking.
Healthy competition among fs.watch wrappers appears to have produced a
clear winner: https://www.npmjs.com/package/chokidar
This wrapper is better for Meteor than pathwatcher was, because it can
watch directory trees recursively, and it has no trouble watching
nonexistent file paths, whereas pathwatcher would throw an exception.
As of optimism@0.3.0, the value of `this` within subscribe functions is no
longer the optimistic wrapper function object (instead: null or global, as
if called with no receiver object), so we need to retain a reference to
the optimistic function so that the watcher can call .dirty(...args).
Setting mongoOptions.server.auto_reconnect was removed by #7880 via commit
0ffb9ac824, though it seems the Server
options still respect autoReconnect, even in version 2.2 of the driver:
http://mongodb.github.io/node-mongodb-native/2.2/api/Server.html
That said, having inspected the code of the `mongodb` package, I do not
believe this change is really critical, since the default value for
autoReconnect appears to be true.
More importantly, I can't find any support in the code of the `mongodb`
npm package or its dependencies for the claim that setting
mongoOptions.server.reconnectTries to 0 is the same as making it infinite,
so this commit sets it to Infinity.
Because I previously published a 1.2.3 version with the same code as
1.3.0, I have also published a 1.2.4 with the same code as 1.3.1, though
of course you should use the latest version (1.3.1) if possible.
* Reconnect to mongo indefinitely.
A fix for https://github.com/meteor/meteor/issues/7822
It seems the driver now always autoReconnects, but only for 30s.
To get the old (sensible) behavior of endlessly reconnecting, we set `reconnectTries` to 0.
* Releasing an rc of mongo package