Commit Graph

7345 Commits

Author SHA1 Message Date
Ben Newman
aee0092f64 Merge branch 'release-1.8.3' into release-1.9 2019-12-18 13:19:31 -05:00
Ben Newman
ebdaa230d5 Update meteor-babel to version 7.7.5. 2019-12-18 12:39:57 -05:00
filipenevola
1a5d6fb5b6 - MDG => Meteor Software
- updates CONTRIBUTING.md
2019-12-13 08:05:14 -04:00
Filipe Névola
a1caff04b7 Merge pull request #10789 from sebakerckhof/patch-2
Fix comment in resolver
2019-11-28 13:51:03 -04:00
Ben Newman
c90246d55b Merge branch 'devel' into release-1.9 2019-11-26 15:46:38 -05:00
seke
a87e9116e6 Fix old-style tests 2019-11-26 15:31:13 -05:00
Ben Newman
34ada3f791 Declare type of Promise.await in tools/index.d.ts. 2019-11-26 14:36:26 -05:00
seke
830b8a40cb Update source-map to 0.7.3
source-map 0.7.0+ has a much faster Rust WASM implementation.
Because this needs to be loaded, the constructor is now asynchronous.
The consumer should also be destroyed after it's no longer needed.
2019-11-26 14:15:33 -05:00
Ben Newman
cf8dbf1c37 Add static-html compiler plugin to custom-minifier test app. 2019-11-26 12:58:49 -05:00
Ben Newman
f6fcd620a7 Add a package.json to custom-minifiers test app.
Self-tests involving this test app were failing because of an undefined
jQuery reference on the client.
2019-11-26 12:49:23 -05:00
Seba Kerckhof
a72c92c852 Fix comment in resolver
Between 1.3 and 1.3.1 the modules.js file got moved from modules to modules-runtime
2019-11-21 20:53:37 +01:00
Ben Newman
407b2d17cb Remove eslint and pre-commit hook to fix npm security warnings. 2019-11-14 17:34:29 -05:00
Ben Newman
0af5c64bd1 Update modules test app to Meteor 1.8.2. 2019-11-14 17:21:02 -05:00
Ben Newman
14cb5fc026 Merge branch 'devel' into release-1.9 2019-11-14 16:30:42 -05:00
Ben Newman
c24077e65f Allow relative --test-app-path arguments when running test-packages.
https://github.com/meteor/meteor/pull/10772#issuecomment-553517459

The assertion in tools/fs/optimistic.ts was failing if I passed a relative
path for --test-app-path, and passing the path as a second argument when
calling assert made it easier to tell what was going on, so I decided to
keep that change.
2019-11-13 12:43:42 -05:00
Ben Newman
edbaeae98b Merge branch 'release-1.8.2' into release-1.9 2019-11-12 19:47:30 -05:00
Ben Newman
faeab6c7d4 Revert "Temporarily wrap files.rename on non-Windows platforms to validate safety."
This reverts commit 52d4809aeb, as promised
in the previous commit message.
2019-11-12 17:22:33 -05:00
Ben Newman
52d4809aeb Temporarily wrap files.rename on non-Windows platforms to validate safety.
Now that files.rename uses Promise.prototype.await on Windows, it's
important to be sure it never gets called outside of a Fiber. Though we
don't run our full test suite on Windows, we can validate this expectation
by wrapping files.rename on all platforms. This commit should be reverted
once the validation is complete.
2019-11-12 17:12:02 -05:00
Ben Newman
d52c9cc82f Avoid calling writeFileAtomically outside Fiber. 2019-11-12 16:58:05 -05:00
Ben Newman
8567390e7e Fix error stack trace parsing during Windows self-tests. 2019-11-12 16:38:22 -05:00
Ben Newman
c4e05dfffe Rewrite files.rename on Windows to retry after 50ms intervals.
Falling back to a full recursive copy was MUCH more expensive than waiting
a short amount of time before retrying the rename.

This aligns with the way graceful-fs handles EPERM and EACCES errors on
Windows: https://www.npmjs.com/package/graceful-fs#improvements-over-fs-module
2019-11-12 15:06:41 -05:00
Ben Newman
1b9fec3f8d Tolerate variable startup message order in static-html self-test. 2019-11-12 12:52:39 -05:00
Ben Newman
41868fa165 Attempt to make static-html self-tests less flaky.
Salvaged from PR #10771, which I had to revert because it caused EMFILE
(too many open files) errors on Windows.
2019-11-11 19:35:48 -05:00
Ben Newman
926cba9a77 Revert "Merge pull request #10771 from meteor/copy-directories-asynchronously"
This reverts commit 77a9784929, reversing
changes made to e0ddae2cc7.
2019-11-11 19:35:16 -05:00
Ben Newman
b71ab5bec5 Bump compiler.BUILT_BY and LINKER_CACHE_SALT to force rebuild. 2019-11-11 19:12:11 -05:00
Ben Newman
61b2d1710b Attempt to make static-html self-tests less flaky. 2019-11-11 18:41:43 -05:00
Ben Newman
c7cc817d69 Use wrapDestructiveFsFunc for files.promises.writeFile. 2019-11-11 17:39:35 -05:00
Ben Newman
cf04e051e3 Write files in Builder#_copyDirectory asynchronously.
Using fs.writeFileSync in a serial style becomes especially costly when
we're writing a lot of files. In a recent profiling exercise I did on
Windows, nearly 80% of the time taken by Builder#_copyDirectory was spent
just closing the written files. By using the asynchronous fs.writeFile
function, we should be able to parallelize at least some of this work, and
await all the promises at the very end of copying the directory.
2019-11-11 17:26:03 -05:00
Ben Newman
f8de4127da Merge branch 'release-1.8.2' into release-1.9 2019-11-08 20:07:59 -05:00
Ben Newman
bd9043db20 Prefer "main" field of package.json over "module" in legacy bundle.
https://github.com/meteor/meteor/issues/10658#issuecomment-550456095
https://github.com/meteor/meteor/issues/10658#issuecomment-551870115

As usual, changes to module resolution logic need to happen in parallel in
tools/isobuild/resolver.ts and in packages/modules-runtime. However,
thanks to the modern/legacy system, it's easy to make the modules-runtime
package behave exactly the way(s) we want in the server, modern client,
and legacy client bundles.
2019-11-08 11:15:23 -05:00
Ben Newman
37b1683fbc Centralize legacy arch logic in tools/utils/archinfo.ts. 2019-11-08 11:15:23 -05:00
Ben Newman
f290eef631 Simplify delayed watching of lazy modules. (#10763)
* Avoid modifying unibuild.watchSet in PackageSourceBatch._watchOutputFiles.

Should fix #10736 by preventing old hashes from remaining in
unibuild.watchSet, which was sometimes causing isUpToDate to fail
immediately upon restart.

* Regression test for issue #10736.
2019-11-08 11:08:56 -05:00
Ben Newman
dea305ca4a Set a higher LRU cache size for makeCheapPathFunction entries.
In PR #10720, we introduced the makeCheapPathFunction in an effort to
reduce the caching overhead for very frequently called (and already pretty
quick) operations like files.stat.

However, the default maximum LRU cache size of Math.pow(2, 16) can cause
quite a bit of cache eviction churn for large applications, which @veered
has identified as a potential source of build performance problems.

By setting the maximum cache size to Math.pow(2, 20) instead, I am no
longer seeing any files.stat calls in the profiling output for rebuilding
a large internal app, saving several seconds of rebuild time. The obvious
downside is that this cache might accumulate more memory over time, which
is why I didn't just set the max to Infinity, though that might be a
viable option if the total set of paths ever stat'd is small enough to fit
into the available memory.

In the future, I hope to find ways of managing LRU cache size that respond
to actual memory pressure (relative to available memory), rather than
pruning the cache after an arbitrary numeric threshold is reached.
2019-11-05 11:19:43 -05:00
David Glasser
3e9e11d76c tools/deploy: provide more context for version-status errors (#10670)
Also only print the error once on failure.
2019-11-05 10:01:53 -05:00
Ben Newman
b912eed72b Merge branch 'release-1.8.2' into release-1.9 2019-10-25 09:56:51 -04:00
Ben Newman
1cf59867b2 Remove no-longer-necessary noYieldsAllowed wrapper from loadIsopackage. 2019-10-24 19:36:32 -04:00
Ben Newman
7fb7fcdd6d Work around incorrect fs.statSync type inference. 2019-10-24 19:36:32 -04:00
Ben Newman
56c21a9796 Attempt to make optimisticStatOrNull less expensive. (#10720) 2019-10-24 18:55:12 -04:00
Ben Newman
11e60dc22e Finish converting changes from PR #10730 to TypeScript. 2019-10-24 18:17:41 -04:00
filipenevola
bbd256ffd1 Fix "Cannot find module" error when using dynamic and nested imports.
Fixes #10643.
2019-10-24 18:09:29 -04:00
Ben Newman
ff0d85d391 Avoid unnecessary Buffer allocations in minifyJs. 2019-09-24 10:41:51 -04:00
Ben Newman
d080f3f1fa Merge branch 'release-1.8.2' into release-1.9 2019-09-23 14:02:33 -04:00
Ben Newman
a102e5fe37 Use optimisticStatOrNull in readAndStatDirectory.
This drastically (by more than half) cuts down the number of calls to
files.stat that occur during PackageSource#_findSources scanning.
2019-09-23 12:02:32 -04:00
Ben Newman
48d27202e7 Skip watching output files without absPath or sourcePath properties.
https://github.com/meteor/meteor/pull/10522#issuecomment-533393100
2019-09-22 11:50:52 -04:00
Ben Newman
daa26c087d Merge branch 'release-1.8.2' into release-1.9 2019-09-19 19:41:57 -04:00
Ben Newman
9cba123401 Restore CLI progress messages by revisiting progress.ts conversion.
I noticed recently that progress messages were no longer displayed (though
the ASCII spinner was still animating). I bisected the problem to the
progress.ts conversion in #10650, and I attempted to reproduce the
conversion, step by step. The problem ended up being the renaming of
._title to .title, which was a mistake because external code accesses
progress._title. Once I updated those invasive access points, progress
messages began displaying once again.
2019-09-19 19:01:33 -04:00
Ben Newman
df3fac2e1f Sanitize risky whitespace characters to recover from failed JSON.parse.
Partial alternative to using json5, which we tried in commit
5124cb495c, which was recently reverted due
to performance concerns: 0e19c365a8.

Should solve the specific problem reported in #10688.
2019-09-19 16:14:56 -04:00
Ben Newman
0e19c365a8 Revert "Use json5 for optimisticReadJsonOrNull."
This reverts commit 5124cb495c.

Perhaps unsurprisingly, JSON5 is much slower than JSON, so much so that
"other optimisticReadJsonOrNull" has become the single most expensive leaf
when building one of our internal applications. We will have to find
another solution.
2019-09-19 15:15:47 -04:00
Ben Newman
d0781233e8 Install typescript in devDependencies of skel-typescript.
This is important so that tools like VSCode will pick up the correct
version of the TypeScript SDK, rather than whatever default version was
installed with VSCode.
2019-09-19 13:22:22 -04:00
Ben Newman
7313fa792b Merge branch 'release-1.8.2' into release-1.9 2019-09-19 12:37:40 -04:00