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).
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.
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.
The header and footer of the linked file now is generated entirely at link
time. There is no more "boundary" __imports__asfdadsads blob.
Also, fix an inexplicable typo in js_analyze.
generated for server targets, not browser targets;
(2) aren't used for anything, (3) can only be generated
by linker (not by, say, coffeescript); (4) are stored
incorrectly (inline in control files, rather than as
separate files); (5) are wrong anyway (at minimum, they
need to be adjusted for boundary string replacement
during link)
But hey. Source maps.
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.
@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.