Commit Graph

14508 Commits

Author SHA1 Message Date
Slava Kim
bb940f3de6 Don't add anti-XSSI header to source-maps in devel
Saves a tiny bit of time rebuilding.

150-300ms on the benchmark.
2015-07-06 02:06:04 -07:00
Slava Kim
65d2a641d0 Add profiling to sha1 2015-07-06 01:13:00 -07:00
Slava Kim
1931a9f169 Add the filtering feature to tool-profiler reports
If the METEOR_PROFILE env variable is set to a number, it would be used
a filter bound for reporting.

Useful to eliminate the noise of small and fast functions.

Ex.: `env METEOR_PROFILE=100 ./meteor` will only print sections that
took more than 100ms to complete.
2015-07-06 01:10:17 -07:00
Slava Kim
318b41f5a9 Add a cache layer for individually prelinked files
This helps especially for app files changes:

- usually a file is changed alone, the imports are not changed
- the changed imports do not affect individually prelinked files (thus "prelink")
- there is no point re-prelinking all files when one is changed

Saves 400ms on an internal benchmark for a mobile edu app
2015-07-05 23:49:30 -07:00
Slava Kim
ec64433df7 Prefer renaming in builder ...
.. rather than unlinking old file and writing over. This way it is atomic.
2015-07-05 21:28:46 -07:00
Slava Kim
edf3be0d21 Remove debug log 2015-07-05 20:35:00 -07:00
Slava Kim
a3841479eb Reuse Builder's from previous iterations
An optimization to avoid writing the same files over and over again.
Tested only on Mac OS X.

There is a potential problem with this approach on Windows, since the
way processes retain open files is different.

On Linux (and I assume, OS X, too), when a process has a file open, it
reads the file from a memory snapshot loaded by OS. The OS also would
increment the reference count for that file, so even if it is unlinked
from the FS, OS would still keep it available as long as the process
keeps it open.

When we want to replace a file under a running Meteor app process, we
first delete the old built file and then write a new file to the same
path. In my understanding, it would force the OS to assign a different
inode for the new file, so the old file and the new file will be
different. Then, we either restart the app process, or signal it to
reload its assets, so it reads the new files, releasing the older ones.

I need to verify this understanding with somebody who actually knows how
OS and FS work.
2015-07-05 13:22:32 -07:00
Slava Kim
ff61acade9 Translate Builder to ES6 2015-07-01 03:10:35 -07:00
David Glasser
70cc03cfbf catch errors running registerCompiler callback
also, add XXX comments about the (very old) issue that source map
filenames are wrong for plugin files
2015-06-30 02:23:44 -07:00
David Glasser
ef04a21dfd better error if published source has no handler 2015-06-30 01:38:37 -07:00
David Glasser
05366ab5c2 fix duplicate compiler extension errors
There are a few different times when we detect duplicate compiler
extensions.
(a) We detect them in Plugin.registerCompiler if a single
    isopack itself registers duplicate extensions.
(b) When compiling a unibuild in compiler.compile, we check to see if a unibuild's
    plugin-providing dependencies overlap.
(c) When preparing a unibuild for bundle-time source processing, we
    check the same condition.

(Why do we need to re-check in (c)? If a unibuild was published and
passed (b) at publish time but is being bundled with different versions
of dependencies, it might fail (c).)

There were a few fixes here:

- In compiler.js (b), if we detected a duplicate extension, the code to get
  the name of the conflict package was wrong and could throw.
- In compiler-plugin (c), we just weren't using buildmessage.

With just those fixes, we would actually see *both* kind of errors show
up if the error was in the app rather than a package, because
bundler.bundle didn't actually bail out on error after compiler.compile!
So we added that fix too, with a relatively conservative WatchSet.
2015-06-30 01:18:05 -07:00
David Glasser
fc87db45ac test disk cache 2015-06-30 00:21:11 -07:00
David Glasser
dd548edd72 less: better error for unknown @import
also, fix coffee/less self-test
2015-06-30 00:09:42 -07:00
David Glasser
2bcabf8fcd add missing var 2015-06-29 21:13:53 -07:00
David Glasser
74e53700ff In-memory caching for linker 2015-06-29 20:02:05 -07:00
David Glasser
76b711145d In-memory caching for templating plugin 2015-06-29 20:02:05 -07:00
David Glasser
62c8c62192 use es6 options for linker.fullLink 2015-06-29 20:02:05 -07:00
Slava Kim
96bd372e29 Renewed stylus readme 2015-06-29 18:01:13 -07:00
Slava Kim
412393af68 Use newer version of meteor/stylus fork 2015-06-29 16:10:38 -07:00
Slava Kim
8281b32465 Implement lru in-memory caching for stylus 2015-06-29 15:23:51 -07:00
David Glasser
917c10f2b6 add lru-cache to dev bundle 2015-06-29 12:39:22 -07:00
David Glasser
b033fb4e9f Even more Profile calls 2015-06-29 12:19:25 -07:00
David Glasser
28faaa218e Add new files on our branch to .eslintignore 2015-06-29 12:19:08 -07:00
David Glasser
5b42b38459 More profiler calls 2015-06-29 11:52:13 -07:00
Slava Kim
cecbc51639 Put global imports for linters and minfier mode for minifiers into options 2015-06-27 11:32:46 -07:00
Slava Kim
9cabba87c3 Use getPathInBundle rather than getPathInPackage in minifiers 2015-06-27 02:27:46 -07:00
David Glasser
61d4be9940 fix source map test for better world
"app/" in stack traces was an artifact of how we lay out files in the
built server, not how the source files are laid out, and isn't actually
as good as just using the source file name.  Slava improved this on this
branch by just using the real file name. So the test (newly merged from
devel) needs to be improved to match.

While we're at it, let's test for filenames in a package.
2015-06-27 00:00:24 -07:00
David Glasser
43b38f38cc Use ES6 escape for emoji 2015-06-26 23:49:25 -07:00
David Glasser
e2b6ba060e oops, missed this merge conflict 2015-06-26 23:32:58 -07:00
David Glasser
ed2fd7a4e7 Only run eslint hook on js files
Looks like if you explicitly name non-js files on the command line, it
pays attention.
2015-06-26 23:25:12 -07:00
David Glasser
919be97b6f Merge branch 'devel' into batch-plugins
Resolves these conflicts:
	meteor
	scripts/dev-bundle-server-package.js
	scripts/dev-bundle-tool-package.js
	tools/files.js

This requires building a new dev bundle, and moving the wrapCallSite
thing to source-map-retriever-stack.js.
2015-06-26 23:24:56 -07:00
David Glasser
638a42ddaa escape { in regexp
It appears to work without the escape, but it's not valid according to
ES5 or ES6 (`{` is not a PatternCharacter).
2015-06-26 21:59:42 -07:00
Sashko Stubailo
adaa64efd0 Remove unnecessary comment 2015-06-26 19:43:58 -07:00
David Glasser
288fbbd595 fix meteor run with no errors 2015-06-26 18:26:11 -07:00
Slava Kim
11af9d88b0 Fix the propagation of the lint option to app runner 2015-06-26 17:46:29 -07:00
Slava Kim
ea2503a3cd Memoize more things for linting performance 2015-06-26 17:46:17 -07:00
Slava Kim
fa29c70d61 Make a method non-private 2015-06-26 17:35:51 -07:00
Slava Kim
86968f9a2b Fix minifier crash when no files are available 2015-06-26 17:35:33 -07:00
Slava Kim
d06fe17e25 Give minifiers an option to set the output path for files
Also makes linked js urls better in devel mode
2015-06-26 17:31:28 -07:00
Slava Kim
fed3a5ec48 Create two modes for minifiers: production and development
Also, extract the CssMerge part into minification
2015-06-26 17:08:14 -07:00
Slava Kim
d7d8f8cfb9 Don't write bundle to disk when running meteor lint 2015-06-26 13:59:31 -07:00
Slava Kim
4313cbcc62 Move linting messages merging to bundler 2015-06-26 13:59:06 -07:00
Slava Kim
3857aa3312 Fix incorrect string concat 2015-06-26 11:22:20 -07:00
Slava Kim
435d92add4 Don't print "Linting your app" unless there are linting messages to report 2015-06-26 11:17:53 -07:00
Slava Kim
7d9c58f7ff Merge linting messages with MessageSet.merge as opposed to string concatenation 2015-06-26 11:14:56 -07:00
Slava Kim
4231ccdba3 Don't lint isopacks if the compilation failed 2015-06-26 11:05:01 -07:00
Slava Kim
9690f370de Don't try to lint the app if compilation of app isopack failed 2015-06-26 11:02:44 -07:00
Slava Kim
a92ec5c6bb Remove wipeLinterCache logic 2015-06-26 10:57:29 -07:00
Slava Kim
a626acb5d6 bump warning 2015-06-25 17:03:06 -07:00
Slava Kim
d8e26bd272 Use fork of source-map-support in tool, too
In addition to apps
2015-06-25 16:59:17 -07:00