Commit Graph

9797 Commits

Author SHA1 Message Date
Ben Newman
9fb02e9bb2 Bump package versions for 1.7.1-beta.21 release. 2018-07-20 19:12:12 -04:00
Ben Newman
a58775663f Bump package versions for 1.7.1-beta.20 release. 2018-07-19 18:12:30 -04:00
Ben Newman
753be8d2ff Rewrite RoutePolicy#checkForConflictWithStatic to avoid WebApp.defaultArch.
This should help with the problem that @lmachens reported here:
https://github.com/meteor/meteor/pull/9942#issuecomment-406241869
2018-07-19 14:06:42 -04:00
Ben Newman
82174ff0a8 Stop overriding autoupdate version in test-in-browser driver.
This hack dates all the way back to 2013: a2c4a78743

Though it is convenient to reload the browser when server files change
while running test-packages, that's not the behavior of most Meteor apps
that use the autoupdate package, and this hack introduced a signficant
difference in behavior between the test-in-browser and test-in-console
driver packages, which finally surfaced due to the interaction between
@toinevk's headless testing PR #9814 and my refactoring of the autoupdate
package (fe9e4035f9). Tests should behave
the same regardless of which driver package is used.

It turns out there's a better way to make the browser reload each time the
server restarts: simply modify Meteor.settings.public, since that object
is included in the client hashes computed by the webapp package.
2018-07-19 14:06:42 -04:00
Ben Newman
45bbac5940 Fix appcache test by tolerating both Autoupdate.{versions,autoupdateVersion}. 2018-07-19 14:04:33 -04:00
Ben Newman
60c670f0b3 Move AUTOUPDATE_VERSION logic out of webapp_server.js.
It seems obvious in hindsight, but any logic relating to the
AUTOUPDATE_VERSION override should reside within the autoupdate package,
and the true client hashes should be available to any other package that
needs them, without AUTOUPDATE_VERSION getting in the way.
2018-07-19 14:04:32 -04:00
Ben Newman
977ce228b3 Import puppeteer more reliably. 2018-07-19 14:04:32 -04:00
Ben Newman
a756af487b Merge branch 'devel' into release-1.7.1 2018-07-18 12:42:01 -04:00
Ben Newman
af26e8b052 Merge pull request #9558 from jamesmillerburgess/accounts-remove-underscore
Modernize accounts packages
2018-07-18 09:33:28 -07:00
James Burgess
e56c18f26b Modernize binary-heap package (#9615) 2018-07-18 08:07:22 -07:00
Ben Newman
ea04dde68a Merge branch 'devel' into accounts-remove-underscore 2018-07-18 08:03:23 -07:00
zebra-lucky
a8c6701c60 Implement Mongo 3.4 Decimal128 in packages/non-core/mongo-decimal (#9662) 2018-07-18 07:59:54 -07:00
Ben Newman
50b6751728 Merge pull request #9814 from toinevk/devel
Switch Meteor's headless browser tests from PhantomJS to Headless Chrome
2018-07-18 07:54:44 -07:00
Ben Newman
d8042c8fa9 Merge pull request #10053 from nathan-muir/nm-ddp-perf
ddp-server: replace usage of Object with Map & Set
2018-07-18 07:53:44 -07:00
Ben Newman
121eb30c90 Shorten initial README.md description for inter-process-messaging. 2018-07-17 21:12:46 -04:00
Ben Newman
fe45f24c8f Bump package versions for 1.7.1-beta.19 release. 2018-07-17 21:02:07 -04:00
Ben Newman
50b44f6465 Update meteor-babel to version 7.0.0-beta.54. 2018-07-17 20:35:37 -04:00
Ben Newman
7d25b592b6 Use ARSON to encode and decode IPC payloads and results. 2018-07-17 16:44:59 -04:00
Ben Newman
5ea442bb12 Update packages/inter-process-messaging/README.md. 2018-07-17 16:44:58 -04:00
Ben Newman
f4946306c0 Make IPC system more testable, and implement some basic tests. 2018-07-17 16:44:58 -04:00
Ben Newman
eceb3b0f57 Silence UnhandledPromiseRejectionWarning in exit handler. 2018-07-17 16:44:58 -04:00
Ben Newman
9faaddd641 Handle child process 'exit' event in IPC system. 2018-07-17 13:24:02 -04:00
Ben Newman
393196eb93 Remove parent/child terminology from the IPC system.
Every process is potentially the child of some other process and the
parent of zero or more child processes of its own, so it's confusing to
use terminology that always treats the current global.process as a
"parent" process, or to include PARENT and CHILD in the message types.

Instead, this new implementation uses message types MESSAGE, RESPONSE,
PING, and PONG, and refers to `process` and `otherProcess` objects,
with the caveat that sometimes `process === otherProcess`, because
`process.send` can be used to send messages to the parent process.

Instead of relying on the child to send a special CHILD_READY message to
the parent when it's ready to receive messages, the sending process polls
the receiving process with a preflight PING message, and the receiving
process immediately responds with a PONG when ready.
2018-07-17 13:11:48 -04:00
Ben Newman
692b533d49 Extract IPC type strings into a shared module. 2018-07-17 10:27:00 -04:00
Ben Newman
77ed148614 Use listener API for communication between build/server processes.
Fixes #10073, per
https://github.com/meteor/meteor/issues/10073#issuecomment-405290391

While thinking about this bug, I realized that sending IPC messages to
specific packages in the server process was much less flexible than
sending messages based on an arbitrary topic string, since the topic
string approach allows both `autoupdate` and `dynamic-import` to listen
for the same message.

The topic string approach calls for a listener interface like
`onMessage(topic, callback)`, which elegantly replaces the previous
approach of requiring packages to export a single `onMessage` function.

However, because the `meteor` package does not have access to the module
system, implementing the `onMessage` listener interface in the `meteor`
package would have required exposing an API like `Meteor.onMessage(topic,
callback)`, which has an unpleasant global smell to it. Instead, the
`onMessage` function should be explicitly imported (using the module
system) from a less-generically-named package.

Since I knew I was going to have to move the message dispatch logic out of
the `meteor` package, I decided to create a new package called
`inter-process-messaging` to implement the parent/child components of the
IPC system.
2018-07-16 18:59:50 -04:00
Ben Newman
547b1675b7 Bump package versions for 1.7.1-beta.18 release. 2018-07-13 03:50:39 -04:00
Ben Newman
e2e0f71b14 Bump package versions for 1.7.1-beta.17 release. 2018-07-11 20:23:26 -04:00
Ben Newman
244fd2a677 Replace Package._on(name, callback) with Package._promise(name).
https://github.com/meteor/meteor/pull/10055#discussion_r201855997

As I explained in this comment, Package._on(packageName, callback) was a
bad API because it never called the callback if the package was not
installed, which caused any app not using the autoupdate package to get
stuck trying to communicate with the autoupdate package.
2018-07-11 19:37:44 -04:00
Ben Newman
52eb3590b7 Bump package versions for 1.7.1-beta.16 release. 2018-07-11 16:31:19 -04:00
Ben Newman
05e7aebef7 Merge branch 'devel' into release-1.7.1 2018-07-11 15:52:05 -04:00
Ben Newman
4b905ed51e Update reify npm package to version 0.16.4. 2018-07-11 15:46:51 -04:00
Ben Newman
098ce3f5db Update reify npm package to version 0.16.3.
This already landed on release-1.7.1, but I've cherry-picked it back onto
devel to avoid confusion.
2018-07-11 15:44:29 -04:00
Ben Newman
2765238a29 Update meteor-babel to version 7.0.0-beta.53. 2018-07-11 15:29:45 -04:00
Ben Newman
05ffaa504b Force older autoupdate clients to reload. 2018-07-11 13:08:33 -04:00
Jesse Rosenberger
f7752a071a Merge branch 'devel' into HEAD 2018-07-11 09:29:26 -07:00
Ben Newman
41e2615424 Fix tests by awaiting newly-async WebApp.staticFilesMiddleware. 2018-07-11 10:32:29 -04:00
Ben Newman
1387473cf5 Pause requests for the legacy bundle while rewriting it.
This is the solution I came up with for the problems I described here:
https://github.com/meteor/meteor/pull/10055#issuecomment-403219805
2018-07-10 21:17:14 -04:00
Ben Newman
4b17a0b760 Allow sending IPC messages from build process to server process.
Instead of having every message consumer listen to every message and act
on the ones that seem relevant to its interests, we now have a single
process.on("message", callback) hook that can dispatch messages to
different Meteor packages running in the server process.

Receiving packages should export an onMessage function. The onMessage
function may be async, and its result will be delivered back to the build
process as the result of the sendMessage Promise.
2018-07-10 21:17:14 -04:00
Ben Newman
213d4389c2 Implement Package._on(name, callback) to intercept Package._define. 2018-07-10 21:17:14 -04:00
Ben Newman
99b79dc00f Include hash of minimum modern versions in autoupdate versions. 2018-07-10 17:43:28 -04:00
Ben Newman
6335d68c0a Use api.mainModule in autoupdate package. 2018-07-09 18:05:14 -04:00
Ben Newman
fe9e4035f9 Rewrite autoupdate to distinguish versions by client architecture.
Now that we're postponing the legacy build until after the first client
refresh message is sent, there's a risk that changes to the legacy build
will not be picked up until after the next rebuild.

If we attempted to fix that problem by sending the refresh message after
the legacy bundle is rebuilt, then we would lose most of the benefit of
delaying the legacy build, because the client would not refresh until
after the legacy build completed.

The right way to fix the problem is by sending a second client refresh
message after the legacy build finishes, but doing so with the current
autoupdate implementation would very likely cause modern clients to reload
a second time.

The solution implemented by this commit is simple in theory: the
autoupdate package should keep track of distinct versions for each client
architecture, so that modern clients will refresh only when the modern
versions change, and legacy clients will refresh only when the legacy
versions change, which allows us to send two refresh messages without
causing any clients to refresh more than once.

In reality, this was a fairly major rewrite, since the ClientVersions
collection has a totally different schema now. I've tested it as well as I
can, though I'm not entirely sure what will happen if clients using the
previous version of the autoupdate package begin receiving DDP messages
from this version of the autoupdate server code.
2018-07-06 19:58:57 -04:00
Ben Newman
e3082a43f6 Precompute WebApp.* client hashes in generateClientProgram.
This means the autoupdate package is no longer responsible for recomputing
client hashes, and we can recompute the hashes whenever there's a new (or
updated) client program, which enables delayed builds of architectures
like web.browser.legacy (#10055).
2018-07-06 13:32:49 -04:00
Ben Newman
ae2ebda6af Start webapp server after WebAppInternals.* fully populated. 2018-07-06 13:32:48 -04:00
Ben Newman
265d9e30d4 Reload legacy bundle using a syncQueue.runTask callback. 2018-07-05 11:20:50 -04:00
Nathan Muir
79ae1849f5 ddp-server: replace usage of Object with Map & Set 2018-07-05 07:51:04 +10:00
Nathan Muir
677026ebb5 mongo-id: improve performance of idParse & idStringify 2018-07-05 07:51:07 +10:00
Ben Newman
b8074a809d Update packages/non-core/blaze submodule to latest master revision. 2018-07-04 14:05:45 -04:00
Ben Newman
f8c47a775f Merge pull request #10051 from jamesmillerburgess/oauth-underscore-usage
Use underscore on both client and server in github-oauth and meetup-oauth
2018-07-04 14:04:39 -04:00
Ben Newman
aade180d46 Build web.browser.legacy bundle after startup on rebuilds. 2018-07-04 12:26:23 -04:00