Commit Graph

17809 Commits

Author SHA1 Message Date
Ben Newman
35da19ab4e Avoid "The handle(...) returned by watching..." errors on Linux.
It's a shame that Pathwatcher issues this warning using console.error,
without taking any verbosity options into account:
https://github.com/atom/node-pathwatcher/blob/7ef76e5dfd/src/main.coffee#L53

Fortunately, I believe I've identified the underlying reason why this
happens, which may help resolve the following issue:
https://github.com/atom/node-pathwatcher/issues/98

If all goes well, I'll submit an upstream pull request.

I've also reinstated an old file watching test that I mistakenly removed
when I attempted to switch to chokidar instead of pathwatcher.
2016-10-21 21:14:44 -04:00
Ben Newman
48a2ccbde7 Dirty optimistic functions when node_modules directories change.
This is a bit different from the previous strategy of invalidating
optimistic functions for specific npm package names.

Now, whenever we make changes to the contents of a specific node_modules
directory, or whenever the developer independently modifies an app's
node_modules directory, all optimistic results derived from paths
contained within that node_modules directory will be marked as dirty, and
thus may need to be recomputed.

This strategy prioritizes starting fewer watchers (just one per
node_modules directory) while still allowing npm packages to be added or
removed while the app is running:

  https://github.com/meteor/meteor/pull/7668#issuecomment-255120373

The drawback is that changes within subdirectories of node_modules will
not be detected until the server is fully restarted, but that seems like
an acceptable tradeoff, since npm packages change much less often than
application code.
2016-10-21 20:06:23 -04:00
Ben Newman
5df8f89f7b Warn about babel-runtime helpers not provided by the Meteor package. 2016-10-21 17:56:01 -04:00
Ben Newman
42a9d37326 Tolerate missing files in ImportScanner#_readModule. 2016-10-21 14:00:13 -04:00
Ben Newman
e50d916709 Don't swallow JSON.parse SyntaxErrors in optimisticReadJsonOrNull. 2016-10-21 14:00:13 -04:00
Ben Newman
94754ca9e9 Bump $BUNDLE_VERSION to 4.6.0 before rebuilding dev bundle. 2016-10-20 17:51:04 -04:00
Ben Newman
9ff66d11c7 Ugrade the meteor-promise npm package to version 0.8.0.
Most notably, this update provides error stack traces that include context
from Promise.await calls and await expressions, so (for example) you can
tell where a certain yielding files.* method was originally called,
instead of only getting a useless native stack trace.
2016-10-20 17:51:03 -04:00
Ben Newman
73519c2b79 Fix shrink_fibers function in generate-dev-bundle.sh.
This logic needs to agree with the following expression:
https://github.com/laverdet/node-fibers/blob/8d7e4ffeb5151ade/build.js#L31
2016-10-20 17:19:56 -04:00
Ben Newman
6b06f440f1 Upgrade the fibers npm package to version 1.0.15.
This should hopefully improve performance in the rare event that a large
number of fibers get created simultaneously.
2016-10-20 17:19:55 -04:00
Ben Newman
04056db28f Bump package versions for 1.4.2-rc.1 release. release/METEOR@1.4.2-rc.1 2016-10-19 18:12:27 -04:00
Ben Newman
04b5227d43 Bump $BUNDLE_VERSION to 4.3.7 before rebuilding dev bundle. 2016-10-19 17:26:26 -04:00
Ben Newman
6af6eee022 Update Node to version 4.6.1.
https://nodejs.org/en/blog/release/v4.6.1/
2016-10-19 17:26:00 -04:00
Ben Newman
f731bda922 Merge branch 'devel' into release-1.4.2 2016-10-19 16:01:24 -04:00
Ben Newman
fec8303c21 Use Array#forEach in twitter_client.js. 2016-10-19 16:00:00 -04:00
Jesse Rosenberger
c67f782743 Support additional params on oAuth1 authorize URL
Using a the previously-supported ability to pass a function (versus a string) for an oAuth1 URL, this commit implements (and relocates) a function which safely applies whitelisted params to that URL.

This introduces a twitter_common.js file shared between server and client which indicates which Twitter-supported params are permitted on the authorize step.  The two params which Twitter supports right now are `force_login` and `screen_name`.  (See: https://dev.twitter.com/oauth/reference/get/oauth/authenticate)

This commit removes the non-functional implementation of `force_login` introduced by meteor/meteor#6987 and implements it via the aforementioned method.

As a precaution (and since neither `ecmascript` nor `es5-shim` are used by this package), I stuck with JS ES3.

Closes meteor/meteor#7584
2016-10-19 16:00:00 -04:00
dhrubins
3e1a449f5e Fix CSP2 script digests in browser policy (#7911). 2016-10-19 14:56:06 -04:00
Jesse Rosenberger
90f65cdac7 Remove message about filing an issue if nofile ulimit can't be raised
While this seems like a good idea to find any edge-cases I wasn't thinking of, I'm afraid this would be be displayed frequently for users that set their `ulimit -n` higher in their shell profile since `ulimit -n` can only be lowered once explicitly set in a particular session.
2016-10-19 14:38:53 -04:00
Jesse Rosenberger
36f0eb667d Raise ulimit for nofile to the system maximum
This should permit watching as many files as the system permits.  Previously, if the default ulimit was set to a value higher than 16384, it was lowered and if the user had configured their system to have a higher ulimit, Meteor wouldn't have take advantage of it.
2016-10-19 14:38:53 -04:00
Jesse Rosenberger
fb5ceb62ff Increase the value of the first ulimit max open files change attempt
Make the first attempt 32768 instead of 16384 since some users have large numbers of files or node_modules trees (meteor/meteor#6952).  This hasn't been raised since Meteor started watching many more files nor since the addition of native NPM.
2016-10-19 14:38:53 -04:00
Jesse Rosenberger
3c3352be12 Don't lower ulimit max open files if it's already higher than desired
Previously, if the default ulimit was set to a value higher than 16384, it was lowering it.  While this doesn't do much for users with default OS settings, those that have modified their ulimit settings will have their settings maintained.
2016-10-19 14:38:53 -04:00
Ramez Rafla
eef23a30b4 Adding gap: into CSP
In UIWebView on iOS10 we get CSP failure to load gap://ready, this resolves it on both simulator and device
2016-10-18 16:50:32 -04:00
Ben Newman
8142521610 Merge pull request #7935 from klaussner/mongodb-driver-links
Update links to MongoDB driver docs.
2016-10-18 16:49:37 -04:00
Ben Newman
c8837c8a68 Merge branch 'release-1.4.2' into devel 2016-10-18 16:47:53 -04:00
Christian Klaussner
a171938daf Update links to MongoDB driver docs 2016-10-18 22:31:45 +02:00
Ben Newman
ccd960eeb3 Bump package versions for 1.4.2-rc.0 release. release/METEOR@1.4.2-rc.0 2016-10-18 14:32:13 -04:00
Ben Newman
6c501b0148 Respect $METEOR_DISABLE_OPTIMISTIC_CACHING for debugging purposes. 2016-10-18 14:25:07 -04:00
Ben Newman
320874989f Implement and use optimisticReadJsonOrNull for better caching.
The problem with optimisticReadFile is that it doesn't cache anything when
the file is missing, because files.readFile throws an ENOENT exception.
2016-10-18 14:05:52 -04:00
Ben Newman
6999bdd99e Revert "Use files.* methods instead of optimistic functions in meteor-npm.js."
This reverts commit b69716d778.

Now that we have a better system for invalidating optimistic results
derived from node_modules paths, these optimizations are safe (and yes
fourseven:scss rebuilds successfully).
2016-10-18 14:05:51 -04:00
Ben Newman
af626a5ed6 Dirty relevant optimistic functions after npm updates. 2016-10-18 14:05:51 -04:00
Ben Newman
30d9a57f0d Allow dirtying optimistic functions by npm package name or path. 2016-10-18 13:26:06 -04:00
Ben Newman
b69716d778 Use files.* methods instead of optimistic functions in meteor-npm.js.
This fixes a bug that prevents fourseven:scss from properly rebuilding,
because the new .../node_modules/node-sass/vendor/<platform>/binding.node
file is not found by Builder#copyDirectory, because the cached results of
optimisticReaddir are the same as before the rebuild.

Unfortunately, this change introduces a small performance regression
(hundreds of milliseconds at worst), because these files.* methods are
called many times.

I think we can continue using optimistic functions here if we are more
careful about invalidating their results, especially after calling
meteorNpm.rebuildIfNonPortable, but I'll save that for a future commit.
2016-10-18 13:02:20 -04:00
Ben Newman
90ece32013 Fix problems in request callback that broke getUrlWithResuming tests. 2016-10-17 15:19:21 -04:00
Ben Newman
30aec9f345 Report an error when HTTP request body is incomplete.
When a download aborts prematurely, the status code is often 200 OK, even
though we probably should not proceed with any further processing of the
downloaded information.

This silent failure leads to problems like the dreaded "Error: ENOENT: no
such file or directory, open... os.json" (#7806 and others), which were
hard to diagnose properly because the failure occurred only later, when
extracting a buffer that downloaded incompletely.

The getUrlWithResuming helper should be able to retry after this error is
thrown, which will result in a more helpful warning, even if in the most
common case, i.e. MaxCDN failure, it will never actually succeed.

Note that this change will not help until Meteor 1.4.2 is officially
released and becomes the implementation used to download later releases.

Mitigates #7806.
2016-10-17 13:52:53 -04:00
Ben Newman
1ac4bbaa84 Bump package versions for 1.4.2-beta.13 release. release/METEOR@1.4.2-beta.13 2016-10-17 11:51:55 -04:00
Ben Newman
c33c68f817 Avoid scanning app node_modules for global variable assignments.
File#computeAssignedVariables is one of the most expensive methods called
during initial startup. This change significantly reduces the number of
times it needs to call through to findAssignedGlobals, which saves quite a
bit of parsing time. The exact savings are hard to quantify, of course,
because they depend entirely on how many modules you have in your app's
node_modules directory.

Scanning for global variable assignments is only really useful in Meteor
packages, where we sometimes need to intercept assignments for the
purposes of api.export, though this is increasingly unnecessary now that
you can (and should) just import values from node_modules.

In the app, the only possible value of intercepting global variable
assignments was to prevent polluting the global scope, but we don't even
create a private scope for the app when useGlobalNamespace is true, so
there really was no point to scanning app node_modules.
2016-10-17 11:51:52 -04:00
Ben Newman
592e2d68d4 Merge branch 'devel' into release-1.4.2 2016-10-17 10:40:26 -04:00
Ben Newman
580e84d64a Merge pull request #7817 from alphanso/iss7794
Separate timeouts for expiration of password reset and enrollment.
2016-10-17 10:02:36 -04:00
Ben Newman
f4db858aa7 Merge pull request #7823 from lucfranken/readme-use-git-checkout-on-app
Readme: Make clear how to run your app with a local checkout of Meteor.
2016-10-17 09:53:44 -04:00
Ben Newman
2a14061c6e Merge pull request #7919 from abernix/feature/c9s-package-dir-rename
Add METEOR_PACKAGE_DIRS support and deprecate PACKAGE_DIRS.
2016-10-17 09:50:12 -04:00
Ben Newman
492021b8df Provide babel-runtime/helpers/defineProperty at runtime. 2016-10-16 16:41:14 -04:00
Ben Newman
7a18012975 Consult babel-runtime package when discarding helper modules.
The most fool-proof way to tell if a module is provided by babel-runtime
is to load babel-runtime as an isopacket and ask it.

This should fix any remaining issues like this one:
https://github.com/meteor/meteor/pull/7668#pullrequestreview-4379559
2016-10-16 16:40:11 -04:00
Ben Newman
dfa8c343ce Export checkHelper function from babel-runtime package. 2016-10-16 16:29:29 -04:00
Ben Newman
8d4ef3f1f7 Only filter out node_modules/babel-runtime/{helpers,regenerator} modules.
This is a refinement of my previous commit 56c041c858.

The Meteor babel-runtime package does not provide substitutes for
babel-runtime/core-js/* modules, so we should not be discarding them from
the client bundle.

Fixes #7930.
2016-10-15 12:01:02 -04:00
Jesse Rosenberger
8de559a967 Change Facebook oAuth param from authType to auth_type
According to the Facebook docs:

https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow

The parameter should be `auth_type`, not `authType`.  A cursory look through their API history didn't show anything about it being changed, but I can confirm that using this feature does not work with `authType` in the current implementation.

Related meteor/docs#94
Related meteor/meteor#7584
Closes meteor/meteor#7078
2016-10-14 20:39:48 -04:00
Ben Newman
693fce59be Merge branch 'release-1.4.2' into devel 2016-10-14 19:10:15 -04:00
Ben Newman
e94d2ad4fc Remove references to node_modules "reference-directly" mode. 2016-10-14 17:01:47 -04:00
Ben Newman
168351c472 Bump package versions for 1.4.2-beta.12 release. release/METEOR@1.4.2-beta.12 2016-10-14 16:47:59 -04:00
Ben Newman
91058b53a7 Allow (junction) symlinking node_modules on Windows.
Hopefully fixes #7830 by ensuring that server node_modules are physically
present in the programs/server/npm directory.
2016-10-14 16:29:35 -04:00
Ben Newman
c572b12f26 Allow Builder#copyDirectory to make junction links on Windows. 2016-10-14 16:25:07 -04:00
Ben Newman
9039f98b30 Make findMongoPort return null if net.connect throws. 2016-10-14 16:24:27 -04:00