Commit Graph

43 Commits

Author SHA1 Message Date
David Glasser
efbe277309 Factor cache logic out of less
And improve the cache (now in MultiFileCachingCompiler) to not rewrite
the whole cache on every operation
2015-07-21 02:49:20 -07:00
David Glasser
6acae1df4d document CompileResult for coffeescript 2015-07-21 01:28:39 -07:00
David Glasser
f7ee0ba385 new caching-compiler package
Implements caching for single-file compilers (those that don't implement
'import' directives) as a superclass, CachingCompiler.

Used in coffeescript and templating.
2015-07-20 15:29:37 -07:00
David Glasser
e692bd3fa7 es6 style: fewer semicolons 2015-07-17 01:48:10 -07:00
David Glasser
1bd6c5839e Port coffeescript compiler to ES2015
Next step is factoring out the cache logic into its own package, which
might be done as an ES2015 superclass (though maybe not).
2015-07-17 01:23:52 -07:00
David Glasser
a35fcf4705 Improve coffeescript on-disk cache
Minimize unnecessary reads and writes
2015-07-17 00:45:48 -07:00
David Glasser
5a17a2064b Mostly tweak comments
Replace "XXX BBP" with more specific #BBPFoo
2015-07-15 13:33:51 -07:00
David Glasser
ea45e6a9f1 Allow plugins to register specific filenames
This is in addition to registering for extensions. Note that only the
new SourceProcessor APIs allow this, not registerSourceHandler.

The filename in question is the basename of the file.  The file can be
found in any directory in any package.  If you want to be more picky,
you can just ignore other ones in your processFilesForTarget.

This introduces the SourceProcessorSet abstraction, which simplifies a
lot of repeated code around matching filenames with processors and
avoiding duplicates.

Missing tests.

See also #3985.
2015-07-08 17:23:31 -07:00
David Glasser
5ed5a4c261 remove console.log 2015-07-07 17:56:06 -07:00
Slava Kim
9d610e8d26 Prefer source-maps in memory in a parsed JSON form 2015-07-06 15:25:11 -07:00
David Glasser
44c815a955 coffee uses on-disk cache
Also combine the two coffee registerCompiler calls into one

it's a bad on-disk cache that should be improved to not write out all
the unchanged files every time too.  but the tests do show that it skips
the unnecessary recompile

less doesn't use an on-disk cache yet
2015-06-09 12:33:46 -07:00
David Glasser
befd21c244 comment about multiple registerCompiler in coffee 2015-06-09 10:38:49 -07:00
David Glasser
774b9754ec Test less caching, and improve client refresh
Specifically, ensure that we don't even include client-specific files in
the server WatchSet by making sure we pass a precise set of extensions
to initFromAppDir.  We still also rule out wrong-arch files at a later
stage too (because sourceExtensions only affects initFromAppDir).

Without the change to compiler.js, the final test (adding
yet-another-root.main.less) restarts the server rather than printing
"Client modified -- refreshing".
2015-06-08 22:41:55 -07:00
David Glasser
456d19a65e coffeescript self-test w/ local package file 2015-06-08 21:02:48 -07:00
David Glasser
01404de8fe start of a self-test showing coffee/less caching
doesn't do less yet
2015-06-04 22:49:42 -07:00
David Glasser
bca7f0c23f cache coffeescript compilation in memory 2015-06-04 11:17:19 -07:00
David Glasser
5d9de6f4cd Fix use of exports API by coffeescript 2015-06-04 01:19:14 -07:00
Slava Kim
77e592c9e3 Fix bugs in BBP Coffeescript implementation 2015-06-04 01:19:13 -07:00
Slava Kim
b167d6446f Checkpoint: coffeescript ported to BBP 2015-06-04 01:19:13 -07:00
David Glasser
5218d0e46b don't let coffeescript break stack traces 2015-05-22 19:03:09 -04:00
Maxime Quandalle
57779c7cbe Upgrade CoffeeScript from 1.6.3 to 1.7.1
Assumptions about vars in `compile-coffeescript.js` remains valid.
2014-02-12 15:47:06 -08:00
David Greenspan
6300a72381 add missing semicolon
just happened to notice it
2014-01-27 14:02:01 -08:00
David Glasser
f65b1cd2ae Remove backwards-compatibility code
There's no need to be backwards-compatible here with something that has
never worked (or at least hasn't worked since 0.6.5).
2013-12-19 17:00:58 -08:00
Mitar
a21f0d2e58 Pass "bare" option when using CoffeeScript as well. 2013-12-19 16:54:03 -08:00
Maxime Quandalle
c66b8e3db5 Style tweaks 2013-09-12 14:29:50 -07:00
Maxime Quandalle
8df6553ce2 Add a literate handler in the coffeescript package
Add .coffee.md handling tests
2013-09-12 14:29:50 -07:00
David Glasser
e4c568b1e1 Merge exports list with package variables in slice JSON.
This implies that all exports are package variables, which made underscore,
jquery, and htmljs (which explicitly assigned to fields on the global variable)
break. We now properly encapsulate these packages (except for window.jQuery,
which we let sneak out because bootstrap wants it).  This means that packages
that want _ need to use underscore, and packages that want $ need to use jquery.
Also, you can't use _ in minimongo $where any more (matching mongod).
2013-07-25 18:54:42 -07:00
David Glasser
95c8384e3b Get rid of linkerFileTransform. 2013-07-25 18:54:41 -07:00
David Glasser
23d73f0732 fix coffeescript. test-packages passes! 2013-07-25 18:54:41 -07:00
David Glasser
177a5684c9 checkpoint for using source maps in jsimage.load
syntax error parsing is broken, will fix
2013-07-12 10:11:31 -07:00
David Glasser
faf49921be replace barely-used lineForLine/includePositionInErrors with use of source maps.
Note that this is only triggered when coffeescript manages to output invalid JS,
which should be unlikely.

This does remove the feature where lines and columns were suppressed for parse
errors in the output of template compilation. but (a) that shouldn't happen,
and (b) we'll fix this by implementing source maps for spacebars.
2013-07-12 10:11:31 -07:00
David Glasser
269434a44b Inline source code in source maps instead of keeping another data structure. 2013-07-12 10:11:31 -07:00
David Glasser
a13f330983 All sourceMap fields in data structures are now strings, not generators. 2013-07-12 10:11:30 -07:00
David Glasser
4e18439ae6 Source maps for coffeescript. 2013-07-12 10:11:30 -07:00
David Glasser
d823e57049 Rip @unit out of Meteor.
It's not used, it doesn't fully work yet, it's incompatible with the static
analysis, and it will make implementing CoffeeScript source maps significantly
more difficult.
2013-07-12 10:11:30 -07:00
David Glasser
9bce443701 coffeescript: ensure added code goes after 'use strict' 2013-06-20 11:06:33 -07:00
David Glasser
974bc116be Refactor coffeescript export support: move CS-specific parsing
into CS package.
2013-06-20 11:06:33 -07:00
David Glasser
d40ff521ef Support @export in CoffeeScript.
You must declare your @exports using single-line ### comments:

   ### @export x ###
   x = 5

This involves some ugly and not 100% correct low-level source hackery, making
some assumptions about the format that CoffeeScript generates.
2013-06-19 23:14:58 -07:00
David Glasser
b68483e31b Implement package-level shared variables for CoffeeScript.
CoffeeScript doesn't allow you to assign to global variables using variable
assignment syntax (though you can assign properties to the global object), which
is the way to create package-level shared variables in Meteor. This commit
provides a CoffeeScript-specific to share variables between files in a package
without adding a redundant alternative for JavaScript files: simply assign
properties on the symbol `shared`.
2013-06-18 09:59:42 -07:00
David Glasser
8a7b1ddf35 Merge branch 'devel' into linker.
Conflicts:
	meteor
	packages/absolute-url/.gitignore
	packages/accounts-base/package.js
	packages/accounts-oauth/package.js
	packages/audit-argument-checks/.gitignore
	packages/coffeescript/.gitignore
	packages/coffeescript/package.js
	packages/localstorage-polyfill/.gitignore
	packages/oauth1/package.js
	packages/oauth2/package.js
	packages/random/random.js
	scripts/generate-dev-bundle.sh
	tools/packages.js
	tools/run.js
	tools/server/server.js
2013-05-28 15:10:48 -07:00
Geoff Schmidt
ed18c6ffb5 Comprehensive build-time error reporting system. In particular: if an error occurs, the build will try to continue to identify any other potential problems so that they can be flagged too. Syntax errors are captured and dealt with programmatically, rather than just being echoed to stderr by node. Stack traces are parsed to pull out file and line information, and a distinction is made between the 'user' and 'internal' portions of the stack. All of this is at build time only -- it has not been extended to (run-time) server or browser yet. Also, no source maps yet, though line numbers are computed correctly for units within the linker. 2013-05-13 11:52:43 -07:00
Geoff Schmidt
4bff34a680 Port 'less' package to new plugin API 2013-05-13 11:52:43 -07:00
Geoff Schmidt
8c72a28e35 Port coffeescript package to new plugin API 2013-05-13 11:52:43 -07:00