Commit Graph

9417 Commits

Author SHA1 Message Date
Ben Newman
c1bdeb7ea5 Bump package versions for 1.6.2-beta.5 release. 2018-02-03 17:23:33 -05:00
Ben Newman
0d14d58017 Merge branch 'devel' into release-1.6.2 2018-02-03 17:22:08 -05:00
Ben Newman
57a6f44a65 Make the class properties transform "loose" to fix #9628. 2018-02-02 16:25:10 -05:00
Ben Newman
bd5cf99edb Ignore babel-preset-meteor if found in a .babelrc file.
This could have prevented #9631 from being a problem in the first place,
and feels like the right thing to do, considering the number of cases
we've seen of people accidentally including babel-preset-meteor in their
.babelrc files.

As usual, we have to bump the ecmascript version as well, so that the
compiler plugin will be rebuilt.
2018-02-02 15:54:57 -05:00
Ben Newman
5c8a3737d7 Bump package versions for 1.6.2-beta.4 release. 2018-01-31 18:38:16 -05:00
Ben Newman
29e48758df Merge branch 'devel' into release-1.6.2 2018-01-31 18:26:12 -05:00
Ben Newman
14f6f9328b Modernize Tracker package.
Changes:

* Use ECMAScript class and arrow function syntax for Tracker.Computation
  and Tracker.Dependency.

* Remove the deprecated.js file (no more Deps, Tracker.depend, or
  Tracker-related Meteor.* APIs).
2018-01-31 17:37:14 -05:00
Ben Newman
0f0ef96611 Prevent _typeof(Reflect) from throwing in older browsers.
Should fix #9598, thanks to @abernix's diagnosis of the problem:
https://github.com/meteor/meteor/issues/9598#issuecomment-361570289

My later comment in that issue thread is not accurate, since the Babel
wrapNativeSuper helper already pulls in the core-js Reflect.construct
polyfill. Instead, the root of the problem really seems to be Babel's
generation of an unguarded _typeof(Reflect) expression.
2018-01-31 17:29:15 -05:00
Ben Newman
85d74f8d2b Revert "Upgrade to Mongo 3.6 (#9533)"
This reverts commit dfc0702558.

We've seen some odd test failures (e.g. `passwords - tokens`) and trouble
updating from 1.6.1 to 1.6.2-beta.3 (easily solved with `meteor reset`,
but also worth investigating), so I think we should keep working on the
Mongo 3.6 upgrade in a PR, rather than running all of our tests against
a devel branch that includes Mongo 3.6.

cc @abernix @hwillson
2018-01-30 17:47:12 -05:00
Ben Newman
99ddadca22 Bump jquery Meteor package version to match jquery version.
It's nice to match versions, but we couldn't bump the minor version of the
Meteor jquery package without breaking compatibility with the current Meteor
release (1.6.1), since jquery is a core package.

The next Meteor release (either 1.6.1.1 or 1.6.2) will either use the new
1.12.1 version or (ideally) jquery will no longer be a core package, and
thus will not be constrained by the release.

Related: #9605
2018-01-30 12:39:01 -05:00
Ben Newman
4e074be6a8 Update default meteor/jquery version to 1.12.1 to fix #9605.
Note that you can run `meteor npm install jquery` (any version) in your
top-level application directory, and the meteor/jquery package will use
that version instead of 1.12.1.
2018-01-30 12:32:14 -05:00
Ben Newman
17eaa5bd6f Implement Mongo.Collection as a function again.
This reverts commit b06a6af335, where I
attempted to allow `Mongo.Collection` to be subclassed by non-native class
syntax by implementing static `call` and `apply` methods.

As the reproduction in #9595 demonstrates, in order to subclass
`Mongo.Collection` properly given this trick, one would need to override
not only the `constructor` method but also the `init` method that the
`Mongo.Collection` base class calls. Since this implicit expectation is
too much to ask of new subclassing code, let alone existing subclassing
code, I'm afraid the only remaining option is to go back to implementing
`Mongo.Collection` as a traditional constructor function, rather than
using native `class` syntax, so that subclasses can invoke the constructor
using `Function.prototype.{call,apply}` as they've always done.
2018-01-29 19:23:13 -05:00
Ben Newman
9cc9ff7f49 Actually depend on es5-shim so that Cordova can import it.
Another attempt to fix #9572. 🤞

cc @paulincai
2018-01-26 17:45:43 -05:00
Ben Newman
c9777e3fc4 Modernize Tracker package.
Changes:

* Use ECMAScript class and arrow function syntax for Tracker.Computation
  and Tracker.Dependency.

* Remove the deprecated.js file (no more Deps, Tracker.depend, or
  Tracker-related Meteor.* APIs).
2018-01-26 13:26:49 -05:00
Ben Newman
5a97b7ebfa Merge branch 'devel' into release-1.6.2 2018-01-26 12:33:42 -05:00
Ben Newman
8415880b2e Remove api.use("promise") from Meteor babel-runtime package. 2018-01-26 12:27:02 -05:00
Ben Newman
1dc34f3872 Stop importing @babel/runtime/regenerator in Meteor babel-runtime package.
Because Promise.asyncApply is only defined on the server, and Meteor 1.6
no longer uses Regenerator to compile async/await and generator functions
on the server, this code no longer serves any meaningful purpose.

On top of that, the babel-runtime.js module is loaded on the client, so
this code was forcing the Regenerator runtime to be included in the client
JS bundle, even if generator functions were not used anywhere else in the
application.

The benefit of removing this @babel/runtime/regenerator dependency won't
be fully apparent until Meteor 1.6.2, since there are probably other
places in client code that depend on it, so it will probably still be
bundled in most applications. However, the new web.browser.legacy system
(#9439) should remove most of those dependencies for modern browsers, as
Meteor 1.6.2 will no longer use Regenerator to compile async/await and
generators for the modern JS bundle.
2018-01-26 12:17:56 -05:00
Ben Newman
bba2fc7bc5 Merge branch 'devel' into release-1.6.2 2018-01-25 12:56:03 -05:00
Ben Newman
1b34b81c75 Fix undefined Date constructor in Cordova es5-shim.
Fixes #9572.
2018-01-25 12:48:23 -05:00
Ben Newman
0fdec072c5 Bump package versions for 1.6.2-beta.3 release. 2018-01-24 18:11:32 -05:00
Ben Newman
b8663fb14a Merge branch 'devel' into release-1.6.2 2018-01-24 18:07:47 -05:00
Hugh Willson
dfc0702558 Upgrade to Mongo 3.6 (#9533)
Update the Meteor Tool to use Mongo 3.6.2 for 64-bit OS'
and Mongo 3.2.18 for 32-bit OS'. A few important mentions:

- As of Mongo 3.6, all Mongo binary downloads include
  SSL - there is no longer a non-SSL based download bundle
  (so it's a bit bigger, but that shouldn't be an issue).
- Using the `--nojournal` option with WiredTiger based
  replica sets is no longer supported (see
  https://jira.mongodb.org/browse/SERVER-30760). The
  `--nojournal` flag was added in
  bcfe072d52
  to help reduce the amount of disk space used by Mongo,
  but since this option is no longer supported, we'll
  have to live with the extra disk space usage.
- Add PR link to History.md
2018-01-24 22:01:46 +02:00
Ben Newman
d9d43a7efa Bump package versions for 1.6.2-beta.2 release. 2018-01-23 18:16:02 -05:00
Ben Newman
0ec73ca63a Update cordova-plugin-meteor-webapp to version 1.6.0.
Included changes:
https://github.com/meteor/GCDWebServer/pull/2
https://github.com/meteor/cordova-plugin-meteor-webapp/pull/39
https://github.com/meteor/cordova-plugin-meteor-webapp/pull/35
5c610efe4e
2018-01-23 18:11:52 -05:00
Ben Newman
ca6197fce4 Exclude sockjs-0.3.4.js from JS bundle in modern browsers, again.
Thanks to bug reports from @jamesmillerburgess, in Meteor 1.6.1-rc.4 we
reverted a change that unsuccessfully attempted to remove SockJS from the
JS bundle (and instead injected a <script> tag to load SockJS in older
browsers): 365804218f

With this commit, we are once again attempting to exclude SockJS from the
JS bundle for modern browsers, this time taking advantage of the
web.browser.legacy system to control which browsers receive which bundle.

The definition of a "modern" browser is stricter now (essentially, any
browser with native async/await support), so I'm hopeful that browsers
with incomplete WebSocket support will get the legacy bundle, which
includes SockJS.

However, if there are still bugs in modern browsers due to faulty
WebSocket message compression (for example), we should be able to address
those problems directly, rather than reverting this change yet again.
2018-01-23 16:46:31 -05:00
Ben Newman
87ab1084ef Bump package versions for 1.6.2-beta.1 release. 2018-01-23 14:42:26 -05:00
Ben Newman
b8ad84b6b8 Bump minor versions of more core packages.
I missed these packages when publishing 1.6.2-beta.0, since I hadn't
bumped their versions in #9439 as I should have, so the release script did
not republish them. Because of this, 1.6.2-beta.0 will not be usable, and
so I will publish 1.6.2-beta.1 ASAP.

The boilerplate-generator version bump is patch rather than minor, since
the relevant changes to that package seemed backwards-compatible.
2018-01-23 14:37:04 -05:00
Ben Newman
2453abbcbc Bump package versions for 1.6.2-beta.0 release. 2018-01-22 21:28:55 -05:00
Ben Newman
f878ba19c7 Address initial review feedback from @abernix.
I've decided to stick with Meteor.isModern for now, since it's false for
both web.browser.legacy and web.cordova bundles, which would make logic
involving a hypothetical Meteor.platform property more complicated than
simply using Meteor.isModern. I'm open to revisiting this later.
2018-01-22 18:07:56 -05:00
Ben Newman
e0eacc62fd Set Meteor.isModern to false in Cordova environments. 2018-01-22 18:07:56 -05:00
Ben Newman
7fc1b1b73c Introduce "legacy" shorthand for web.browser.legacy and web.cordova. 2018-01-22 18:07:55 -05:00
Ben Newman
8ccbe3baa0 Avoid breaking backwards compatibility for asset URLs. 2018-01-22 18:07:55 -05:00
Ben Newman
4529885a6a Compile ECMAScript for web.browser with fewer Babel plugins.
https://github.com/meteor/babel-preset-meteor/blob/master/modern.js
https://github.com/meteor/babel/blob/dfcce32868/options.js#L81

With the minimum versions from babel-preset-meteor/modern-versions.js, the
difference between "modern" and "legacy" browsers boils down to supporting
native async functions.

I'm eager to stop compiling generator functions with Regenerator, and none
of the transforms that compile async functions to native generator
functions seem much better than the Regenerator experience (source maps
are still wonky within the async function, so it's obvious you're not
working with native code).

Native async functions are supported by 73% of desktop and mobile browsers
worldwide (81% in the US), and that percentage is only going to keep
increasing. I see no reason not to embrace this future now.
2018-01-22 18:07:55 -05:00
Ben Newman
eba781fd55 Tolerate non-enumerable .raw property in template tag function. 2018-01-22 18:07:55 -05:00
Ben Newman
5d0fd60c61 Allow explicit source parameter to setMinimumBrowserVersions.
Calling getCaller was noticeably slowing down server startup,
unfortunately.

cc @hwillson
2018-01-22 18:07:54 -05:00
Ben Newman
e33d1552c2 Avoid overriding babelCompilerFeatures.runtime if already defined.
This led to a regression in coffeescript-test-helper because the truthy
extraFeatures.runtime property allowed require("@babel/runtime/...") to
appear in a compiled CoffeeScript file, though require was not defined.

If @GeoffreyBooth agrees, we could have the coffeescript package
api.imply("modules"), which would make require would work, but I seem to
remember we had some reasons for not doing that previously.
2018-01-22 18:07:54 -05:00
Ben Newman
24d757c344 Import only modern core-js polyfills in ecmascript-runtime-client.
In my research, I found the data used by @babel/preset-env to be more
conservative than necessary, so I have not followed their minimum version
constraints exactly.

For example, every feature of the ECMAScript `Map` API is clearly
supported in Firefox 45+, according to MDN:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#Browser_compatibility

However, @babel/preset-env requires `core-js/modules/es6.map` in any
version of Firefox earlier than 53:
e270fbe7f0/packages/babel-preset-env/data/built-ins.json (L117)

Since I can't find any evidence that @babel/preset-env knows better than
other sources (I think they might just be using a compatibility table that
doesn't go back far enough), I have tentatively trusted MDN in picking
these versions.

If any bugs are ever reported due to this choice of versions and
polyfills, we have two options to fix them:

* Tighten the minimum version constraints so that the affected browsers
  are considered legacy instead of modern.

* Include the missing `core-js` polyfills for all modern browsers.
2018-01-22 18:07:54 -05:00
Ben Newman
62f304bdbc Send dynamic modules appropriate for web.browser[.legacy].
Just as the URLs of static JS resources depend on request.browser, so too
must dynamic modules be loaded from the correct build directory based on
the user agent string of the __meteor__/dynamic-import/fetch HTTP request.
2018-01-22 18:07:54 -05:00
Ben Newman
18ab7e9b39 Enable useBuiltIns option when compiling for modern JS environments.
Background:
https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-runtime#usebuiltins
242538dea1
855d5dda80
2018-01-22 18:07:54 -05:00
Ben Newman
a67c0c7ac9 Record location of decisive calls to setMinimumBrowserVersions.
cc @hwillson
2018-01-22 18:07:54 -05:00
Ben Newman
969e1b37f0 Include Promise polyfill only in web.browser.legacy bundles. 2018-01-22 18:07:53 -05:00
Ben Newman
9424bf08c3 Try loading SockJS dynamically after native WebSocket errors.
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-22 18:07:53 -05:00
Ben Newman
bfbb8baf5f Add "/__arch" prefixes to URLs in tools/isobuild/bundler.js.
This avoids the need to add architecture-specific prefixes in
webapp_server.js, and also fixes dynamic module source map URLs.
2018-01-22 18:07:53 -05:00
Ben Newman
a7cdc7004d Make dynamic module HTTP response JSON more human-readable. 2018-01-22 18:07:53 -05:00
Ben Newman
d3b6d5dc4b Upgrade lolex (test) npm dependency of ddp-client to version 2.3.1.
May help prevent the problem that occurred in this Circle CI test run,
since lolex was the package with hash sha1-LycSsbwYDendzF06epbvPAuxYq0=:
https://circleci.com/gh/meteor/meteor/12641
2018-01-22 17:56:54 -05:00
Ben Newman
187c9dce06 Prevent any version of PhantomJS from being considered "modern."
We'll need to set up BrowserStack or headless Chrome tests to exercise
modern JS bundles. It is still very valuable to run tests with
web.browser.legacy in PhantomJS, because most day-to-day development
browsers qualify as "modern," and we don't want "legacy" browsers to
become a blindspot.
2018-01-22 17:56:54 -05:00
Ben Newman
25cbf3c918 Remove no-longer-necessary shim-common package.
Now that both sockjs-shim and es5-shim are using the web.browser.legacy
system instead of injecting <script> tags with the server-render package,
these shared utilities are no longer used anywhere.
2018-01-22 17:56:54 -05:00
Ben Newman
19cd3406f8 Collapse sockjs-shim into socket-stream-client with web.browser.legacy. 2018-01-22 17:56:53 -05:00
Ben Newman
443acfaf5d Use web.browser.legacy instead of server-render to load es5-shim. 2018-01-22 17:56:53 -05:00
Ben Newman
3940488b97 Fix an http test failing due to new static resource URL prefixes. 2018-01-22 17:54:44 -05:00