Since these packages aren't published to the npm registry, they can be made private to avoid unnecessary warnings about missing description, repository, and license fields when installing server dependencies and generating dev bundles.
Previously, the async fallback was only used in case of ENOTEMPTY errors,
but Windows appears to throw temporary EPERM errors as well. If the errors
are actually robust/non-temporary, the async version will fail, too.
Should help with #9540.
Fixes#9383.
A subclass contructor should generally invoke a superclass constructor with
appropriate arguments. Exactly how this happens has changed with the
advent of native ECMAScript class syntax.
With native ECMAScript class syntax, invoking the superclass constructor
requires calling super(...args), rather than calling the constructor as a
function against the instance object (this), which is now forbidden
because native ECMAScript class constructors are not callable.
The goal of making native constructors not callable was to prevent the
accidental omission of the `new` keyword. However, the old style of
calling the parent constructor function against the child instance almost
always used .call or .apply, so the ommission of `new` was not a mistake.
With that insight in mind, I have added two new static methods to
Mongo.Collection for the sake of backwards compatibility with existing
code that attempts to subclass Mongo.Collection.
These methods, .call and .apply, invoke a new (non-static) this.init
method against the provided instance. The this.init method is also invoked
by the actual constructor, so calling Mongo.Collection.apply(this, args)
works essentially the same way it used to, before native class syntax and
super(...). This trick effectively reenables calling Mongo.Collection.call
and .apply, facilitating subclassing by non-native function-based classes.
Note: both .call and .apply will throw if the provided child instance is
not instanceof Mongo.Collection.
Inheriting static properties can be difficult without native class syntax,
too. To avoid breaking some widely-used, partially correct idioms (such as
using a for-in loop to copy static properties from the superclass to the
subclass), I decided to make all the static properties of Mongo.Collection
(except for "call" and "apply") enumerable. Here's some code that
illustrates what would break if static methods remained non-enumerable:
d791a697a5/collection-hooks.js (L280-L284)
Though these tricks are clever in a way that doesn't feel entirely
bulletproof, they do fix most code that would have been broken by
converting Mongo.Collection to a native ECMAScript class (in Meteor
1.6.1), thus allowing us to avoid converting Mongo.Collection back to a
non-native function-based class.
The last version of stylus published did not contain a version of the
caching-compiler package that these tests now depend on, so I've removed
the extra architecture matching for the stylus package (not for less).
To fix#9528, we included more information (the target architecture) in
cache keys for files compiled by CachedCoffeeScriptCompiler. Although this
change was right and necessary, it altered the caching behavior tested by
this self-test. Specifically, .coffee files must now be recompiled for the
os.* architecture, whereas previously code compiled for web.browser could
be accidentally reused on the server.
Although it was tempting to avoid including the SockJS library in the
bundle for modern browsers, Meteor 1.6.2 will have a much better way of
managing this kind of differential bundling for modern/legacy browsers
(see PR #9439), and removing SockJS seems to lead to a worse experience
when native WebSockets end up failing, as @jamesmillerburgess discovered:
https://github.com/meteor/meteor/pull/9274#issuecomment-356214405
We've seen some recent intermittent test failures because previous
CallbackLogger results were accidentally carried over when there should be
no results. This change allows running a callback function after resetting
logger._log.length to 0, to ensure the callback adds nothing to the log.
Self-tests that are marked as "slow" are not run automatically for pull
requests, but they should be run before a release.
It was a mistake to publish the first Meteor 1.6.1 release candidate
without running these "slow" tests, as the cordova-builds test would have
caught the problem reported by @macrozone in #9521.
I've decided to remove the "slow" marker from this test, since it's
important for checking Cordova sanity, and clearly could fail.
In order to install Gradle, which is required for Cordova tests to run
in the Meteor self-test suite, this image slightly builds upon the
CircleCI image we'd been using previously.
This is potentially a big change, though it should (with any luck) make
tests faster, and allow us to better test Cordova functionality (at least
as far as Android is concerned). For example, if this works, we won't have
to mark the "cordova builds with server options" self-test "slow" again,
which would (re)disable it during Circle CI test runs.
cc @abernix @hwillson
* Change error suppressing property in livedata_connection.js
Fixes#6912
Switched the property from `expected` to `_expectedByTest`
* Update History.md and bump package patch versions
PR #9343 changed the return type of Boilerplate#toHTML from String to
Stream, which is likely to break existing code that expects a string.
In order to make the change in return type more obvious, I have renamed
the method to toHTMLStream, and I have attempted to update all call sites
appropriately. However, because this change comes in the release candidate
phase of Meteor 1.6.1 testing, it seemed important to preserve the
string-returning behavior of toHTML, with a deprecation notice.
Unless third-party code is using the Boilerplate class directly, I don't
think the toHTML method will ever be called, and we can remove it in
Meteor 1.6.2.
Thanks to @macrozone for tracking this problem down.
Fixes#9521.
These changes are needed to get the plugin meteor-coverage working. IstanbulJS (shipped with meteor-coverage), can only generate the coverage-report for the code loaded after it's initialization. This is why the code, the plugin meteor-coverage contains, must be executed before the code is loaded, which should be tracked in the code-coverage. A suitable check I found was when a debugger isn't used, which makes it impossible to use code-coverage and the debugger at the same time. It's the only feasible condition I could come up with.
The package meteor-coverage also registers a hook of IstanbulJS which overwrites `vm.runInThisContext()` in order to start the coverage. As of now, IstanbulJS does not support overwriting `vm.Script.runInThisContext()`.
https://github.com/meteor/meteor/pull/9274#issuecomment-355241004
The `Error in connection establishment: net::ERR_CONNECTION_REFUSED`
message will still repeat every few seconds, but devtools should coalesce
it into a single line with an incrementing counter, as before.
This is a back-port of a similar change on the web.browser.legacy branch:
b8601d3ce7
To save size in modern browsers, JavaScript bundles built for the
web.browser architecture no longer statically include the SockJS library.
That's safe as long as native WebSockets actually work, but what if
there's a problem with the network that necessitates falling back to
long-polling or some other SockJS strategy?
In those cases, we can load SockJS using a dynamic import(), which is a
little slower than including it in the bundle, but that's OK because the
module will be permanently cached in IndexedDB in production, and falling
back to SockJS should be rare in modern browsers anyway.
Note that this trick would not be possible if the implementation of
dynamic import() still required a socket connection! (#9384)