Commit Graph

22356 Commits

Author SHA1 Message Date
David Glasser
0e549a47ed Use ignoreEval in the (unused) findGlobalDottedRefs code too.
Add comment explaining why eval has the wacky behavior in escope.
2013-07-01 22:50:58 -07:00
David Glasser
38462b596e Fix ++/+=. Add comment about why we can't use ImplicitGlobalVariable. 2013-07-01 22:50:58 -07:00
David Glasser
bf8b7e50c3 Handle parse errors. 2013-07-01 22:50:58 -07:00
David Glasser
d64e16f72e Goodbye, blacklist! 2013-07-01 22:50:58 -07:00
David Glasser
8686a9e592 Different hack for getting package-scope vars for js-analyze itself. 2013-07-01 22:50:58 -07:00
David Glasser
f1aaa5227a Add a bunch of 'vars' found by looking at built packages. 2013-07-01 22:50:58 -07:00
David Glasser
09c9133038 comment about breaking @unit 2013-07-01 22:50:58 -07:00
David Glasser
353e0ea383 Run JSAnalyze at link time to determine package-scope variables. 2013-07-01 22:50:58 -07:00
David Glasser
d2ab75c38e Use ignoreEval option. Otherwise vars don't get resolved if there's eval around. 2013-07-01 22:50:57 -07:00
David Glasser
717372168f Move js-analyze tests to a separate package to simplify loading 2013-07-01 22:50:57 -07:00
David Glasser
0652b2180e Comment re lack of dependencies. 2013-07-01 22:50:57 -07:00
David Glasser
c378858672 Remove underscore dependency. use slice now has no dependencies. 2013-07-01 22:50:57 -07:00
David Glasser
e15831ad94 refactorings so that computeGlobalReferences has access to library 2013-07-01 22:50:57 -07:00
David Glasser
b96926b0e1 some more tests for findAssignedGlobals 2013-07-01 22:50:57 -07:00
David Glasser
659954bd4b JSAnalyze.findAssignedGlobals: a simpler analysis for linker.
Includes tests ported from findGlobalDottedRefs. Should add more tests.
2013-07-01 22:50:57 -07:00
David Glasser
d1735fbe14 Add David Greenspan's "global dotted refs" static analysis. 2013-07-01 22:50:57 -07:00
David Glasser
e49c434599 Add empty js-analyze package.
Imports some Esprima JS analysis tools as NPM packages. The test is from
https://github.com/dgreensp/public/tree/master/js-refs/ but I am using
Npm.depends instead of copying source code into the project. (This also means
that it only run server-side, which is OK for my current needs.)
2013-07-01 22:50:57 -07:00
David Greenspan
7bfa8b9c88 steps toward test driver working 2013-07-01 19:54:09 -07:00
David Greenspan
21ed1bdbe0 Merge branch 'linker' into shark 2013-07-01 18:54:51 -07:00
David Greenspan
79befd4df9 Merge branch 'devel' into linker 2013-07-01 18:54:27 -07:00
David Greenspan
76ab959951 test-in-browser: don't use #if in attributes
don't know why this even works atm.

spacebars may add the ternary operator
2013-07-01 18:49:40 -07:00
David Greenspan
55e9e7e441 @emit element annotations cause event dispatch 2013-07-01 17:53:24 -07:00
David Greenspan
0263ca7299 empty string still counts as arg being present 2013-07-01 15:37:41 -07:00
David Greenspan
42bc63dc91 get rid of EmptyComponent
not really empty since now Component renders its content
by default
2013-07-01 15:33:46 -07:00
David Greenspan
317fc8abee example stuff from demo 2013-07-01 15:31:44 -07:00
David Glasser
841d24a93e Merge branch 'linker-raw-js' into linker.
Reimplements "client/compatibility" files for the linker branch.

In a package, access this with the {bare: true} option to api.add_files. In a
package, this elevates file-level vars from "file-local" to "package-local" (not
global!)
2013-07-01 13:03:35 -07:00
David Glasser
50392a5a17 Bare is only allowed on the client. 2013-07-01 13:01:34 -07:00
David Glasser
3c4d0a11f3 Test bare. 2013-06-28 16:39:45 -07:00
David Glasser
9293e7164a Implement bare in linker. 2013-06-28 16:32:36 -07:00
David Glasser
b8bb929e79 No-op refactor to internal linker interface. 2013-06-28 16:32:36 -07:00
David Glasser
2b2e60bbad Pass bare through to the linker. 2013-06-28 16:32:36 -07:00
David Glasser
ec34962e6f rename raw -> bare at Avi's suggestion
This matches what CoffeeScript calls the same thing.

For compatibility we'll make raw work too, for now.
2013-06-28 16:32:36 -07:00
David Glasser
698de75b12 Checkpoint: generate raw option 2013-06-28 16:32:36 -07:00
David Glasser
1f2a770117 Display stdout and stderr in a test that had been failing (but mysteriously stopped failing) 2013-06-28 16:32:27 -07:00
Avital Oliver
56359db24d Fix 'meteor logs' against an ssh tunnel 2013-06-28 16:03:09 -07:00
Emily Stark
bd03d52cd0 Merge branch 'assets-docs' into linker 2013-06-28 14:55:59 -07:00
Emily Stark
e6078ba108 Mention that Assets.getText hardcodes utf8 2013-06-28 14:55:47 -07:00
Emily Stark
7046d4cc91 Assets docs 2013-06-28 14:55:47 -07:00
David Greenspan
f1853086ed recognize annotations in Spacebars compiler 2013-06-27 15:23:46 -07:00
David Greenspan
c6a5c89a74 spacebars: further unify error reporting 2013-06-27 14:37:11 -07:00
Avital Oliver
86669dc44c 'meteor logs' now works on localhost w/o ssh tunnel 2013-06-27 11:44:02 -07:00
David Greenspan
8aed126bad {{@ annotations}}, better error messages 2013-06-27 10:44:55 -07:00
Naomi Seyfer
09e468ebc5 Allow you to use GALAXY=localhost:9414 for interacting w/ a galaxy w/o an ssh tunnel 2013-06-27 10:11:57 -07:00
David Glasser
1919705e40 Merge branch 'weak-sauce' into linker
Implements weak dependencies and uses them to fix {{currentUser}}
2013-06-26 12:47:55 -07:00
David Glasser
9130701834 Fix {{currentUser}} and {{loggingIn}} by using weak dependencies. 2013-06-26 12:46:57 -07:00
David Glasser
7e4f720e8e Implement weak dependencies.
A normal dependency of X on Y consists of a "must-use" constraint ("if X is
loaded, Y must be loaded too") and an "ordering" constraint ("if X and Y are
both loaded, Y must be loaded before X").

The previously-existing support for "unordered" dependencies allows you to
create a dependency with "must-use" but not "ordering".  This commit adds "weak"
dependencies, which have "ordering" but not "must-use".

As an example, the accounts-base package wants to define some Handlebars helpers
like {{currentUser}} if the handlebars package is being used, but it's fine to
use accounts-base without handlebars. So it should declare a weak dependency on
handlebars.

A package can tell if another package has already been loaded by checking to see
if `Packages.foo` exists. (So as a result, even slices which export no variables
get a `Packages.foo = {}` line.) Weak dependencies do not import symbols into
your namespace; you must access their symbols through
`Packages.foo.someExportedSymbol`. You don't get to use plugins from your weak
dependency.
2013-06-26 12:34:42 -07:00
David Glasser
e33694874d Test slices now never contain exports.
@export is now an error in test slices.

This is preparation for ensuring that any slice with exports has at least
"Package.foo = {}"; without this commit, both the use and test slice would (with
that change) try to overwrite Package.foo.

Remove the attempt to allow @export in 'use strict' CoffeeScript files:
ECMAScript 'use strict' is fundamentally incompatible with our implementation of
exports, and it was probably a bug that this used to work at all.
2013-06-26 12:26:12 -07:00
David Glasser
11c8fcd341 "meteor rebuild-all" should exit 1 on error 2013-06-26 12:26:11 -07:00
David Glasser
d82bb3a8c1 Remove old "weak" name for unordered dependencies. 2013-06-26 10:43:24 -07:00
David Greenspan
53affec869 generic Components respect "content arg"; bugfix 2013-06-25 16:00:13 -07:00