Commit Graph

9222 Commits

Author SHA1 Message Date
Ben Newman
2effb1a974 Bump package versions for 1.6.1-beta.11 release. 2017-11-25 11:26:42 -05:00
Ben Newman
b3ae296709 Merge branch 'devel' into release-1.6.1 2017-11-25 11:10:57 -05:00
Ben Newman
64d1a59f74 Bump minor versions of packages changed by #9343.
https://github.com/meteor/meteor/pull/9274#issuecomment-346892876
2017-11-25 11:09:45 -05:00
Ben Newman
02583444bd Bump package versions for 1.6.1-beta.10 release. 2017-11-24 11:38:42 -05:00
Ben Newman
fb080c1a83 Merge branch 'devel' into release-1.6.1 2017-11-24 11:38:19 -05:00
George Ehrhorn
febb18922e Fix broken link (#9412)
The link to the ```tracker``` api was broken.
2017-11-24 11:34:56 -05:00
Ben Newman
f3c6460406 Merge pull request #9343 from meteor/jbaxleyiii/streaming-server-render
Improved server rendering, now with stream support.
2017-11-23 15:50:14 -05:00
Ben Newman
b88cbab2a1 Handle errors from Promises returned by Tinytest.addAsync callbacks. 2017-11-23 14:17:49 -05:00
Ben Newman
e6758073bc Note Promise-awareness of Tinytest.addAsync in tinytest/README.md. 2017-11-22 21:11:27 -05:00
Ben Newman
8009351653 Simplify/modernize webapp tests. 2017-11-22 20:09:18 -05:00
Ben Newman
8dbd41719a End HTTP response when stream ends. 2017-11-22 20:09:18 -05:00
Ben Newman
54885bca3b Simplify async server-render tests. 2017-11-22 20:09:18 -05:00
Ben Newman
8aa2c627bc Improve appending to streams in boilerplate-generator. 2017-11-22 20:09:18 -05:00
Ben Newman
7f12cfde95 Simplify boilerplate-generator-tests. 2017-11-22 20:09:18 -05:00
Ben Newman
499a32ac8b Use ...spread elements instead of [].concat in boilerplate templates. 2017-11-22 20:09:18 -05:00
James Baxley
d17683eb98 remove memoization of requests 2017-11-22 20:09:18 -05:00
James Baxley
7ef237f99c refactored to a single stream api 2017-11-22 20:09:18 -05:00
James Baxley
0f78f5cde1 update readme for server sink 2017-11-22 20:09:18 -05:00
James Baxley
fb4e2b6f73 fix tests 2017-11-22 20:09:18 -05:00
James Baxley
3a7f34d610 support redirect, headers, cookies, and client side alignment 2017-11-22 20:09:18 -05:00
James Baxley
037a0be319 simplify stream parsing [ci skip] 2017-11-22 20:09:18 -05:00
James Baxley
2ef27e4151 easier support for strings in template 2017-11-22 20:09:18 -05:00
James Baxley
a5866e2781 initial working stream support 2017-11-22 20:09:18 -05:00
Ben Newman
45e396d41a Bump tinytest package to version 1.1.0. 2017-11-22 20:08:15 -05:00
Ben Newman
0190801a7b Allow Tinytest callbacks to return Promise objects. 2017-11-22 20:08:10 -05:00
Ben Newman
ca76af8d49 Modernize tinytest by using ecmascript. 2017-11-22 18:40:37 -05:00
Ben Newman
86a2ad5679 Bump package versions for 1.6.1-beta.9 release. 2017-11-22 15:26:12 -05:00
Ben Newman
a6b90f85c3 Merge branch 'devel' into release-1.6.1 2017-11-22 14:52:58 -05:00
Ben Newman
8c4bd0fdf3 Update blaze submodule to latest master revision. 2017-11-22 13:27:16 -05:00
Ben Newman
26e94fa303 Generate correct stats for more kinds of meteorInstall minification.
The uglify-es minifier sometimes inlines (0,Package.modules.meteorInstall)
as a callee expression rather than declaring a variable, so this commit
adds support for that minification technique when computing bundle size
statistics for the bundle-visualizer package.

One symptom of this bug: while the bundle-visualizer displays packages
minified in this way with the correct total size, they appear not to have
any node_modules.

cc @abernix
2017-11-22 13:17:56 -05:00
Ben Newman
2482fac274 Make bundle-visualizer JSON stats more readable in dev tools. 2017-11-22 13:17:54 -05:00
skirunman
1d5bf0f1a4 iPhone X status bar fix (#9375) 2017-11-22 11:36:45 -05:00
Hugh Willson
8da6c84eac Update the default CSS parsing/combining/minifying tools (#9263)
* Update the default CSS parsing/combining/minifying tools

The `minifier-css` package is currently using outdated
(and abandoned) npm packages (`css-parse` and `css-stringify`),
as part of its parsing/minification process. This commit
replaces those packages with the robust, modern and maintained
`postcss` package.

* Adjust CSS source file fallback value

* Self test adjustments and cleanup

* Disable sourcesContent generation by postcss

The `standard-minifier-css` package is already associating
source content with the source map, so we don't need to
do this twice.

* Add History.md entry covering backwards compatibility details

* Bump major version due to backwards compatibility breaking changes

* Bump minor versions

* Code review changes (boolean formatting, concat to spread)
2017-11-22 11:13:54 -05:00
Ben Newman
6ae4ca64d3 Merge branch 'devel' into release-1.6.1 2017-11-20 10:54:03 -05:00
Jesse Rosenberger
2a62bcac2d Correct accidental use of Array.prototype.every on an Object.
Fixes the error reported in the 1.6.1 pull request. (Thanks, @yorrd!)

It's worth nothing that the `DDP._allSubscriptionsReady` function which
was broken is used by the deprecated `spiderable` package.  Since
`spiderable` is deprecated, it's advisable to look into ways to stop
depending on it.

Refs: https://github.com/meteor/meteor/pull/9274#issuecomment-345358178.
2017-11-20 13:02:26 +02:00
Ben Newman
8e39fd7762 Make bundle-visualizer depend on dynamic-import directly again.
Since bundle-visualizer is a non-core package, it could be used with a
version of ecmascript that does not imply dynamic-import, though it
definitely requires support for `import()` to function properly.
2017-11-17 15:17:43 -05:00
Ben Newman
d690906f7f Bump package versions for 1.6.1-beta.8 release. 2017-11-17 14:47:17 -05:00
Ben Newman
5bdf684525 Merge branch 'devel' into release-1.6.1 2017-11-17 14:34:11 -05:00
Ben Newman
c4bcf91519 Bump ecmascript version to 0.10.0 instead of 0.9.1.
Since the new version of ecmascript depends directly on dynamic-import,
it's important that it's a version of dynamic-import that does not depend
indirectly on ecmascript, and I'm not sure if the constraint solver can
figure that out easily without a little help.
2017-11-17 14:31:33 -05:00
Ben Newman
1c2d6c6382 Improve readability of dynamic-import helper function.
Per feedback from @abernix:
https://github.com/meteor/meteor/pull/9384#discussion_r151743041
2017-11-17 13:29:49 -05:00
Ben Newman
b81872b01a Remove weak dependency on browser-policy-common from dynamic-import.
Even a weak dependency affects the load order of packages by forcing the
depended-on package to load before the dependent package. Waiting until
Meteor.startup to check for Package["browser-policy-common"] dynamically
does not have this problem.
2017-11-17 13:20:30 -05:00
Ben Newman
d0566bbb18 Make bundle-visualizer use HTTP instead of Meteor.call.
If you're trying to visualize the bundle of an application that does not
use ddp-client, it's annoying if bundle-visualizer pulls in all those
dependencies just to support itself.

cc @abernix
2017-11-17 13:11:20 -05:00
Ben Newman
a80af7e064 Move dynamic-import dependency from meteor-base to ecmascript.
Now that dynamic-import no longer depends indirectly on ecmascript, the
ecmascript package can finally guarantee support for dynamic `import()`,
as it rightfully should.
2017-11-17 12:04:25 -05:00
Ben Newman
2f3bbcde70 Bump dynamic-import package version to 0.3.0. 2017-11-16 20:11:28 -05:00
Ben Newman
305abbefb8 Upgrade install to allow batching of dynamic import() requests.
Now that we're using HTTP POST requests to fetch dynamic modules, it's
more important to make fewer requests when possible, given the higher
latency of HTTP requests compared to WebSocket messages.

The trick is to wait until the next tick of the event loop before actually
sending the request, so that multiple dynamic import() calls in quick
succession are treated as a single request, and all the modules they
require can be returned in a single response object.

For example, we want code like this

  const [
    React,
    ReactDOM
  ] = await Promise.all([
    import("react"),
    import("react-dom")
  ]);

to result in one HTTP POST request for both `react` and `react-dom`, as
well as all their dependencies, rather than two separate requests.
Indeed, that is what happens, since both import() calls take place in the
same tick of the event loop.
2017-11-16 19:49:06 -05:00
Ben Newman
088432410c Remove webapp and random dependencies from dynamic-import.
Letting dynamic-import depend on packages that depend on ecmascript means
ecmascript and its dependencies can't depend on dynamic-import. This
commit gives us back that flexibility.
2017-11-16 19:49:06 -05:00
Ben Newman
a7a63cd743 Allow only server-side code to fetch dynamic server modules.
Each time the server starts, the dynamic-import/server.js module creates a
secret key for accessing dynamic server modules, then exposes that key to
the server-side dynamic-import/client.js module, and no one else.

If client.setSecretKey has been called, that key will be included as a
query parameter in each /__dynamicImport POST request. If it matches the
actual secret key, access is granted to the corresponding dynamic modules;
otherwise, only web.browser dynamic modules are made available.
2017-11-16 19:49:06 -05:00
Ben Newman
d073990a3a Prune dynamic imports result tree rather than failing on error. 2017-11-16 19:49:06 -05:00
Ben Newman
e24eec2084 Support fetching dynamic modules via HTTP POST requests.
Ever since Meteor 1.5 first shipped, dynamic modules have been fetched
over a WebSocket, which is appealing because sockets have very little
latency and metadata overhead per round-trip.

However, using a WebSocket requires first establishing a socket connection
to the server, which takes time and may require a WebSocket polyfill.

An even more subtle problem is that we cannot use dynamic imports in any
of the code that implements the ddp-client package, as long as the
dynamic-import package depends on ddp-client.

By switching from WebSockets to HTTP POST requests, this commit radically
reduces the dependencies of the dynamic-import package, while preserving
(or even exceeding) the benefits of socket-based dynamic module fetching:

1. The client makes a single HTTP POST request for the exact set of
   dynamic modules that it needs, which is much cheaper/faster than making
   several/many HTTP requests in parallel, with or without HTTP/2.

2. Because the client uses a permanent cache (IndexedDB) to avoid
   requesting any modules it has ever previously received, the lack of
   HTTP caching for POST requests is not a problem.

3. Because the HTTP response contains all the requested dynamic modules in
   a single JSON payload, gzip compression works across modules, which
   produces a smaller total response size than if each individual module
   was compressed by itself.

4. Although HTTP requests have more latency than WebSocket messages, the
   ability to make HTTP requests begins much sooner than a WebSocket
   connection can be established, which more than makes up for the latency
   disadvantage.

5. HTTP requests are a little easier to inspect and debug in the dev tools
   than WebSocket frames.

6. The new /__dynamicImport HTTP endpoint is a raw Connect/Express-style
   endpoint, so it bypasses the Meteor method-calling system altogether,
   which eliminates some additional overhead.

7. Fetching dynamic modules no longer competes with other WebSocket
   traffic such as DDP and Livedata.

8. Although the implementation of the /__dynamicImport endpoint is a bit
   too complicated to allow serving dynamic modules from a CDN, that
   remains a possibility for future experimentation. In other words, how
   modules are fetched is still just an implementation detail of the
   `meteorInstall.fetch` callback.

9. As with the WebSocket implementation, the module server is totally
   stateless, so it should be easy to scale up if necessary.

I wish I had appreciated the advantages of an HTTP-based implementation
sooner, but I think the transition will be pretty seamless, since the new
implementation is completely backwards compatible with the old.
2017-11-16 19:49:06 -05:00
Ben Newman
80e564e9c3 Remove underscore from url package, and use modules. 2017-11-16 19:49:06 -05:00