Commit Graph

60 Commits

Author SHA1 Message Date
David Glasser
2dfe97ee32 update linker.js 2014-06-17 17:33:55 -07:00
ekatek
2db52b9bd9 comment clean up 2014-04-10 23:28:04 -04:00
ekatek
9423e3dfcb clean up unipackage 2014-04-09 09:55:29 -07:00
Geoff Schmidt
95e3959165 The period goes outside the parens (like this).
(Except when the parenthetical is a complete sentence.)
2013-12-30 06:20:49 -08:00
Emily Stark
bfc7f22dc0 Don't number lines that end in backslash.
Fixes #1326
2013-08-20 11:14:44 -07:00
David Glasser
b04818221e Move source map instructions comment above imports. 2013-07-29 18:07:12 -07:00
David Glasser
3a7eac6dca Declare _FooTest symbols as testOnly; they are only visible to tests.
They are visible to *all* tests, not just the package's own tests.
2013-07-25 18:54:42 -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
37e2cc4dee Make audit-argument-checks into an empty package, detected via weak deps.
This requires making sure that empty packages work!
2013-07-25 18:54:41 -07:00
David Glasser
95c8384e3b Get rid of linkerFileTransform. 2013-07-25 18:54:41 -07:00
David Glasser
060151dd81 test-packages now has no immediate server-side errors (client-side, sure)
eliminate accounts-urls package
2013-07-25 18:54:40 -07:00
David Glasser
75cad725e2 first stab at dropping the @export comment parser 2013-07-25 18:54:40 -07:00
David Glasser
9f38258b54 Drop all @export lines. Add api.exportSymbol instead. 2013-07-25 18:54:40 -07:00
David Glasser
15c396b686 linker: Add a few newlines before the exports section. 2013-07-19 10:08:10 -07:00
Geoff Schmidt
ee60b7bcae If you @export Foo.Bar.Baz, define Foo.Bar for you
(if it wasn't already defined by an import.)
2013-07-18 23:46:31 -07:00
Geoff Schmidt
83ab263a88 Adjust source maps more efficiently at link time.
(Saves more than a second off of linking a small app!)
2013-07-16 23:48:03 -07:00
David Glasser
b9f343f8b4 Add Firefox instructions.
Change comment style to one which does not make FF print warnings. This breaks
Chrome, so start setting the header again.
2013-07-12 10:11:32 -07:00
David Glasser
6eb9cdb69f make it work in node too 2013-07-12 10:11:32 -07:00
David Glasser
4308b7c063 - switch from X-SourceMap header to //@ comment
- specify sourceMapUrl in browser manifest
- don't make source maps for app pure-JS files
- make URLs happy
- break traceback beauty
2013-07-12 10:11:31 -07:00
David Glasser
3205e33537 using source maps in JSImage.load now probably works 2013-07-12 10:11:31 -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
85ae17ae0f Add instructions on enabling source maps to linked browser code. 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
96a1f43a3c add a comment about line number comments on generated files 2013-07-12 10:11:30 -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
df5d48c9af Fix to generation of source maps for concatenated files. 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
f0673cef7e don't generate empty global import files 2013-07-12 10:11:29 -07:00
David Glasser
b3e752c86c Source maps now are correct.
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.
2013-07-12 10:11:29 -07:00
David Glasser
e61c64e26b the path is packages/foo, not package/foo 2013-07-12 10:11:29 -07:00
David Glasser
09cb871d15 Write slice JSON with source map and sources as separate files.
We have not written the corresponding read code yet.
2013-07-12 10:11:28 -07:00
David Glasser
b9bf08b45a Correctly get the package name in the linker. 2013-07-12 10:11:28 -07:00
David Glasser
30f82aa5bf Rename getLinked[Files/Output] -> getPrelinked$1 2013-07-12 10:11:28 -07:00
Geoff Schmidt
14b337ad5d rebase fixups 2013-07-12 10:11:28 -07:00
Geoff Schmidt
685a4ffdcf Source maps are generated, but they (1) are only
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.
2013-07-12 10:11:28 -07:00
Geoff Schmidt
013c9f82e7 groundwork 2013-07-12 10:11:27 -07:00
David Glasser
a753284c6d Improve error message on bad @export. 2013-07-02 16:41:10 -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
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
e15831ad94 refactorings so that computeGlobalReferences has access to library 2013-07-01 22:50:57 -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
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
974bc116be Refactor coffeescript export support: move CS-specific parsing
into CS package.
2013-06-20 11:06:33 -07:00