Commit Graph

63 Commits

Author SHA1 Message Date
Sashko Stubailo
e7167e5257 Factor out almost all fs. and path. calls in the tool
This will be useful when we want to be smart with windows file paths later
Also, all of the file calls are asynchronous with fibers now, which comes with
many benefits.

This is a combination of 23 commits. Original messages:
Wrap a large number of fs calls inside files.*

Convert a few more fs calls to files.*

More moving fs.* to files

Implement read/write streams and open/read/close

Get rid of fs from auth.js

Remove fs and unused imports from catalog-local and catalog-remote

Remove unused imports from catalog.js

Replace a whole lot of fs calls

Fix error

Migrate a lot more fs. calls to files.

Add a temporary symlink method

Convert old test to files.*

Use files.pathX instead of path.x everywhere

Replace path.x to files.pathX in tests

Small fixes to files.js and one rename

Make cleanup run in a fiber

Make wrapping functions take function name in case we need it

Add some timeouts and stuff to HCP tests

wrapFsFunc also makes a sync version of the function

Sometimes you just don't want to yield!

Make sure JsImage readFromDisk doesn't yield

Remove unused imports from npm test

Change order of test now that some things don't yield

Fix missing files import, and add a debug error printout
2014-12-15 15:32:06 -08:00
David Glasser
70f257c0e4 Memoize calls to js-analyze 2014-12-08 23:18:15 -08:00
David Glasser
021e9f767d Don't include line number comments in isopackets
The extra legibility is not as useful for code that is always part of
core as it is for user's packages, and it actually has a notable (25%)
effect on isopacket load time.

Fixes #3218.
2014-12-03 12:38:20 -08:00
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