Commit Graph

9355 Commits

Author SHA1 Message Date
Ben Newman
1a8cb855ba Bump package versions for the official 1.6.1.3 release. 2018-06-16 14:56:11 -04:00
Ben Newman
921e55bd3c Bump package versions for 1.6.1.3-rc.0 release. 2018-06-16 11:44:34 -04:00
Ben Newman
6fc83732e4 Bump package versions for the official 1.6.1.2 release. 2018-05-26 17:46:22 -04:00
Ben Newman
fb0315a750 Bump package versions for 1.6.1.2-rc.0 release. 2018-05-26 11:41:50 -04:00
Ben Newman
7cd4947780 Bump package versions for the official 1.6.1.1 release. 2018-04-02 10:21:56 -04:00
Ben Newman
84d776ecb8 Bump package versions for 1.6.1.1-rc.0 release. 2018-03-31 14:33:22 -04:00
Ben Newman
4c0e583249 Update meteor-babel to version 7.0.0-beta.42.
https://github.com/babel/babel/releases/tag/v7.0.0-beta.41
https://github.com/babel/babel/releases/tag/v7.0.0-beta.42

Also updated various @babel/... plugin versions in package.json files.
2018-03-31 13:10:12 -04:00
Ben Newman
893426552d Remove pre-release suffixes from coffeescript packages. 2018-01-20 16:04:13 -05:00
Ben Newman
2c7616d221 Bump package versions for the official 1.6.1 release. 2018-01-20 15:50:01 -05:00
Ben Newman
ce276aec96 Bump package versions for 1.6.1-rc.10 release. 2018-01-19 19:29:47 -05:00
Ben Newman
6ae14731a2 Avoid hiding errors due to missing dependencies of custom Babel plugins.
As illustrated by #9554, if a custom .babelrc plugin such as
@babel/plugin-proposal-optional-chaining imports a missing dependency such
as @babel/core, that failure causes inputFile.require to throw an
exception that looks a lot like @babel/plugin-proposal-optional-chaining
itself is missing, which can be confusing.

This change does not fix the underlying problem (the @babel/core package
still needs to be installed), but it does expose the exception so that the
developer can do something about it, rather than merely leaving the ?.
syntax uncompiled.

Here's the offending line of code:
47ce7e71c9/packages/babel-plugin-proposal-optional-chaining/src/index.js (L2)

Unfortunately, depending directly on @babel/core seems to be the policy
for Babel plugins, per this PR: https://github.com/babel/babel/pull/6778
2018-01-19 18:19:31 -05:00
Ben Newman
dc4be42cbc Fix for @scoped Babel plugin packages in .babelrc files. 2018-01-19 18:19:25 -05:00
Ben Newman
8b3732e18b Bump package versions for 1.6.1-rc.9 release. 2018-01-18 17:22:17 -05:00
Ben Newman
c2845baff7 Bump package versions for 1.6.1-rc.8 release. 2018-01-17 18:09:01 -05:00
Ben Newman
145fce2c4c Update meteor-babel to version 7.0.0-beta.38. 2018-01-17 13:01:21 -05:00
Ben Newman
76ea47e4f7 Fix "constraint solver benchmark" self-test. 2018-01-16 18:56:04 -05:00
Ben Newman
4e345b860a Bump package versions for 1.6.1-rc.7 release. 2018-01-16 17:16:06 -05:00
Ben Newman
d0db2571e4 Guarantee all WebApp handler functions run in a Fiber.
https://github.com/VeliovGroup/Meteor-Files/issues/538
2018-01-16 16:58:57 -05:00
Ben Newman
d78bed0d47 Bump package versions for 1.6.1-rc.6 release. 2018-01-15 18:27:17 -05:00
Ben Newman
abf695c94f Revert changes that made Match.{Where,Maybe,..} non-constructible.
https://github.com/meteor/meteor/issues/9383#issuecomment-345435819
2018-01-15 18:26:44 -05:00
Ben Newman
b06a6af335 Allow calling Mongo.Collection.{call,apply}(this, ...) from subclasses.
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.
2018-01-15 17:09:16 -05:00
Ben Newman
8decd67daf Bump package versions for 1.6.1-rc.5 release. 2018-01-14 23:24:22 -05:00
Ben Newman
d29022fe20 Merge branch 'devel' into release-1.6.1 2018-01-14 23:22:59 -05:00
Theodor Diaconu
9236202115 Fixes #9531 - removing unnecessary check for Mongo.Collection (#9537) 2018-01-14 22:48:11 -05:00
Ben Newman
b07c5cc328 Bump package versions for 1.6.1-rc.4 release. 2018-01-14 17:48:52 -05:00
Ben Newman
2af81bbb87 Remove weak dependency on sockjs-shim package from ddp-client.
The sockjs-shim package was recently removed from core, and will probably
never be published without a prerelease suffix.
2018-01-14 17:48:50 -05:00
Ben Newman
fbdacbf560 Preserve /__cordova/manifest.json URLs, to fix #9526. 2018-01-14 16:32:47 -05:00
Ben Newman
b7567232e4 Merge branch 'devel' into release-1.6.1 2018-01-14 16:13:40 -05:00
Ben Newman
5d22e1d25f Fix/strengthen "compiler plugins caching" self-tests.
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.
2018-01-14 16:09:49 -05:00
Ben Newman
620689f7de Include inputFile.getArch() in CoffeeScript cache key.
https://github.com/meteor/meteor/issues/9528#issuecomment-357530874

Fixes #9528.
2018-01-14 13:33:12 -05:00
Ben Newman
365804218f Remove sockjs-shim package and always polyfill SockJS, again.
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
2018-01-12 15:49:41 -05:00
Ben Newman
ebe51997d6 Bump package versions for 1.6.1-rc.3 release. 2018-01-12 12:20:49 -05:00
Ben Newman
afe1ba7044 Update meteor-babel and reify to latest versions.
https://github.com/meteor/meteor/pull/9274#issuecomment-354870359
46109280c2
2018-01-11 20:17:07 -05:00
Ben Newman
49f9c7b087 Add failing ecmascript test-case of nested imports in class methods.
Thanks to @CaptainN for reporting this:
https://github.com/meteor/meteor/pull/9274#issuecomment-354870359
https://github.com/meteor/meteor/pull/9274#issuecomment-356988553

Only the `import { testExport as oyez } ...` in `method` is problematic
here, though I wanted to add some tests of class properties as well.
2018-01-11 20:17:07 -05:00
Ben Newman
d4bf359b71 Fix test warnings by depending on semver in package-version-parser. 2018-01-11 13:27:56 -05:00
Ben Newman
96d8d86638 Make CallbackLogger#expectNoResults more reliable.
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.
2018-01-11 13:27:54 -05:00
Ben Newman
667dd0700b Define global.Promise if missing. 2018-01-11 13:27:52 -05:00
Ben Newman
40a0e5b917 Merge branch 'devel' into release-1.6.1 2018-01-11 11:55:36 -05:00
Jesse Rosenberger
f551a56f93 Merge pull request #9512 from hwillson/issue-5127
Pass login type to client side Accounts.onLogin callbacks
2018-01-10 09:07:18 -08:00
James Burgess
3638897939 Regression test for prototype and non-enumerable properties in minimongo (#9516) 2018-01-10 11:44:39 -05:00
James Burgess
ed98a07125 Do not suppress logging of errors that have the expected flag (#9515)
* 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
2018-01-10 11:43:19 -05:00
Ben Newman
c45e90d24f Bump package versions for 1.6.1-rc.2 release. 2018-01-09 19:33:30 -05:00
Ben Newman
991fb5ea86 Rename Boilerplate#toHTML to toHTMLStream and deprecate toHTML.
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.
2018-01-09 12:12:11 -05:00
Ben Newman
573f14f171 Allow EnvironmentVariable#withValue callbacks to return Promises.
As a happy side-effect, this also allows buildmessage.enterJob callbacks
to be async and/or return Promises.
2018-01-09 11:46:02 -05:00
Ben Newman
49ff5bcb33 Update meteor-babel and reify to latest versions.
Fixes #9504.
2018-01-09 10:59:51 -05:00
Ben Newman
cc70c62983 Reduce noisiness of WebSocket disconnection errors.
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.
2018-01-04 14:40:45 -05:00
Ben Newman
5e38bd5758 Bump package versions for 1.6.1-rc.1 release. 2018-01-03 14:48:21 -05:00
Ben Newman
6f9d07b977 Try loading SockJS dynamically after native WebSocket errors.
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)
2018-01-03 14:43:49 -05:00
Hugh Willson
04a1eff87b Add PR link to History.md and bump package version 2018-01-03 14:13:54 -05:00
Hugh Willson
a638475a61 Pass login type to client side Accounts.onLogin callbacks
Client side `Accounts.onLogin` callbacks are triggered after a
successful login, but they're also triggered after a successful
DDP reconnect (if already logged in). As discussed in #5127,
some people think this is the correct behaviour, while others
feel that `onLogin` callbacks should really only fire after a
user has actually logged in (e.g. after using something like
`Meteor.loginWithPassword`). Since people are split on the
proper approach here, an alternative solution would be to
provide client side `Accounts.onLogin` callbacks with a way
to tell if they're being called after a login or after a
reconnect, then let them decide what to do.

Server side `Accounts.onLogin` callbacks receive an object that
contains various login details. One of those items is a login
`type`, that can hold values like `password`, `resume`, etc.
When a user completes a true password based login, the returned
login `type` is `password`. When the user is already logged in
but undergoes a DDP disconnect + reconnect, the returned login
`type` is `resume`. This means server side `Accounts.onLogin`
callbacks have a way to tell which type of login is happening,
allowing them to respond accordingly.

This PR adjusts client side `Accounts.onLogin` callbacks such
that they also receive a single login details object, that
contains login type information. Unlike the server side login
details object, the client side login details object only
contains the login type (to help reduce network transfer
overhead, make sure we're not exposing server details on the
client we shouldn't be, etc.).

This approach should give developers a better way to respond to
different client side login types, and act accordingly.

Fixes #5127.
2018-01-03 13:36:54 -05:00