320 Commits

Author SHA1 Message Date
Naomi Seyfer
a2c9561ce2 Incrementing versions 2013-02-18 14:23:11 -08:00
Naomi Seyfer
657c101b2b Merging master to devel for 0.5.6 2013-02-15 11:16:52 -08:00
Nick Martin
33a4cd617b Add a bunch of comments. 2013-02-14 21:50:17 -08:00
Andrew Wilcox
148670cfc6 add ##HTML_ATTRIBUTES## to app.html.in 2013-02-14 20:14:49 -08:00
Andrew Wilcox
cc27c50339 Browser identification and html attributes hook
This commit is theoretically independent of the route policy PR, but
had multiple merge conflicts with it.  This PR branch thus is based on
the route policy PR.  (That is you should only merge this PR if you've
already merged the route policy PR).

Adds an html attribute hook, used by the appcache package to insert the
manifest attribute into the app HTML.

However, to use the hook the appcache package needs to be able to
identify the browser (to decide whether to include the attribute or
not for that browser).

We now have multiple places that want to identify the browser: the
unsupported browser page, the appcache package, and, if we eventually
implement not delivering large polyfills to browsers that don't need
them, in app HTML generation code as well.

To avoid detecting the browser in multiple places ad-hoc, this commit
creates a Meteor "browser" object, intended to be a standard way of
identifying the browser server-side.  It uses but does not expose the
npm useragent module (we could choose a different mechanism to
identify the browser in the future if we wanted to).  The browser
object contains

* `name`: the name of the browser in camel case
* `major`, `minor`, `patch`: integers describing the browser version

In addition to the html attribute hook, the appcache package also
needs a way to get from the connect `req` object to the identified
browser (browsers *start* caching when they see the manifest
attribute, but only *stop* caching when they get a 404 for the
manifest...)

Eventually though we'd like smart packages to be able to serve content
without having to plug directly into connect.

This commit thus also introduces an early version of a Meteor
`request` object, intended to be a high-level description of the
request without exposing details of connect's low-level `req`.
Currently it contains:

* `browser`: browser identification object described above
* `url`: parsed url, including parsed query params

To get started, as a temporary measure I've added a
`categorizeRequest` function to __meteor_bootstrap__ which converts a
connect `req` to a Meteor `request`.  (Suggestions for a better name
are welcome).  This can go away once smart packages such as appcache
are being passed a `request` object directly when they serve content.

This allows `request` to be used uniformly: it is passed to the html
attributes hook, and the appcache package can use it when deciding
whether to generate a 404 for the manifest.
2013-02-14 20:14:49 -08:00
David Glasser
1535fe3437 Bump version number and add release notes. 2013-02-14 16:49:06 -08:00
Nick Martin
8896281b05 Merge remote-tracking branch 'remotes/origin/pr/679' into devel. Fixes #679. 2013-02-13 21:10:59 -08:00
Nick Martin
7677944d3d Merge branch 'master' into devel 2013-02-13 16:33:03 -08:00
Andrew Wilcox
f2d9792f90 Route policy declarations (for network routes only for now).
Allows packages such as stream and accounts to declare URL prefixes
such as /sockjs/ and /_oauth/ to be network routes.

Updates server to avoid serving app HTML on network routes.

Checks for conflict between files in public/ and network routes.  For
example, the developer might not know that /sockjs/ is reserved, and
might create a file "public/sockjs/socks-are-great.png".
2013-02-13 13:12:59 +00:00
Andrew Wilcox
93b31e563c Code review updates to the bundle manifest.
`__meteor_bootstrap__.bundler` => `__meteor_bootstrap__.bundle`

`bundle.bundle_dir` => `bundle.root`

Rather than placing app_info/appInfo containing the manifest in the
bundle object, instead I'm now placing the manifest directly in the
bundle object.  A) no code currently uses bundle.appInfo.load; B) if
someday we expand the manifest to also include server side resources
than we'd be getting rid of `load` anyway; C) I think it reads better:

`bundle.appInfo.manifest` => `bundle.manifest`

cp_r now returns a list of os-specific relative file system paths as
strings, instead of paths as arrays.

I changed the normalized "path" field in the manifest to be a relative
path instead of an absolute path (`"/static/cat.jpg"` =>
`"static/cat.jpg"`).  This felt better when looking at the manifest; I
think because the path is relative to the bundle root.
2013-02-12 12:35:30 -08:00
Andrew Wilcox
99ebc78d7a Generate a bundler manifest.
Creates a manifest of the static files delivered to the client, for use
by the app cache.  The manifest is also designed to be usable to generate
etag's for issue #626.

In the original bundler code `self.css` and `self.js.client` starts
out as an array of os-specific file paths and later becomes an array
of URLs (including query parameters).  While I tried to minimize code
changes to avoid creating extra work for the engine project, this
turned out to be too crazy to deal with.  In this version `self.css`
and `self.js.client` stay as file paths, and _generate_app_html now
pulls the client URLs from the new manifest.

This PR is thus proposing a design where the bundler manifest becomes
the source of knowledge about client static resources included in the
bundle, and is then used to generate the app html, the app cache, and
perhaps etag's in the future.  (If it made sense then the `load` list
of server Javascript files could also be folded into the manifest,
making the manifest the source of knowledge about all static
resources... but the code in this PR don't include any steps in that
direction).
2013-02-12 12:35:30 -08:00
Nick Martin
6cbd30c057 Merge branch 'devel' into release-0.5.5 2013-02-08 21:49:03 -08:00
David Glasser
4f2d725d3f If Meteor.settings.public exists, make it available on the client as well.
(Suggested by @jagill at Meteor Dev Shop 0!)
2013-02-08 17:51:33 -08:00
Nick Martin
1385137f01 Bump version number in prep for release 2013-02-07 22:49:56 -08:00
Andrew Wilcox
d4534c5f15 Make static not cacheable.
Fixes #631.

Update the dev_bundle to use the Meteor version of gzippo which allows
clientMaxAge to be set to 0, and change server.js to set the
clientMaxAge to 0 for static.
2013-02-07 20:39:05 -08:00
Nick Martin
48010de100 Comment on app.manifest exclusion. 2013-02-01 11:20:22 -08:00
Andrew Wilcox
0fcb503fa4 also exclude app.manifest from returning app_html 2013-02-01 11:15:59 -08:00
Nick Martin
d71e31b5b5 Make inFiber help pass arguments through. This fixes with_password in meteor deploy/logs/mongo. 2013-01-31 12:24:42 -08:00
David Glasser
5a54a5c79f Update Node to 0.8.18.
We now used TypedArrays (Uint8Arrays), and versions of Node prior to 0.8.17 have
a security vulnerability related to TypedArrays.
2013-01-30 09:55:47 -08:00
Avital Oliver
b2cc217cfb Exit meteor run --once on bundler crash 2013-01-28 13:40:02 -08:00
Avital Oliver
d2319bc134 Wrap some CLI functions in a Fiber 2013-01-25 18:48:04 -08:00
Mark van Straten
cb78d24ee3 Fix for allowing piping of password to deploy
When piping password from bash $echo MYPASSWD | meteor deploy MYSITE stdin.setRawMode() is not available. Check availability before calling.
2013-01-18 19:05:15 -08:00
Andrew Wilcox
a8349f3973 Fix exclusion of favicon.ico and robots.txt on Windows.
The use of path.sep is incorrect because req.url is a URL, not a file
path, and so always contains forward slashes.

I verified that the original code does not work on Windows and that
the new code does.
2013-01-18 19:04:32 -08:00
David Glasser
2aa92b2ed3 Update to use APIs from new versions of fibers and uglify-js.
Combine files before minimizing.

minimongo - subkey sort fails when minized, so clearly there is some sort of
uglify bug.
2013-01-16 11:34:30 -05:00
David Glasser
3a99938dff Upgrade Fibers to 1.0.0 and UglifyJS to 2.2.3.
This definitely won't "work" because both have API changes.

UglifyJS 1 was having issues minifying certain code (eg lodash).  But UglifyJS 2
was occasionally segfaulting (as was other code using large regexps).  See the
bottom of https://github.com/laverdet/node-fibers/issues/89

Hopefully this will fix it.
2013-01-16 10:47:57 -05:00
Andrew Brampton
435c664c8b Ignore example directories that begin with a period. This avoids 'meteor create --list' displaying .gitignore. 2013-01-12 14:32:27 -08:00
David Glasser
2d27799008 find_mongo_pids: Fix regression in 203a82d.
Don't consider "ps" stderr to be an error. This occurs on OSX Mountain Lion if
DYLD_LIBRARY_PATH or a similar env var is set, and is harmless.
2013-01-08 10:41:01 -08:00
David Glasser
864371f9ab Bump version number to 0.5.4 and write History.md. 2013-01-08 10:40:52 -08:00
David Glasser
203a82d9b9 Fix race condition in 'meteor mongo'.
The 'exit' event on a ChildProcess doesn't necessarily occur before all the
'data' events on its stdio, so sometimes 'meteor mongo' didn't find the
process. We should have been using the 'close' event. Switch from
child_process.spawn to child_process.exec, which simplifies the code and uses
the right event.
2013-01-03 09:29:52 -08:00
David Glasser
2d7d419ef8 Add a comment about the now-undocumented meteor run --once. 2013-01-02 17:48:43 -08:00
David Glasser
dd5bf80f5b Make the modification needed for testing the updater simpler. 2012-12-31 11:48:44 -08:00
David Glasser
45a19ee918 Re-run app when --settings file changes. 2012-12-29 13:28:17 -08:00
David Glasser
cf4190e9c0 Increment version to 0.5.3. 2012-12-23 12:36:05 -08:00
David Glasser
13074d58b9 Remove two copies of underscore.js from Meteor, using NPM package instead.
Follow-up to 27382c6. A step towards addressing issue #302.

We still have one copy in the underscore smart package, for serving to clients.
2012-12-21 11:20:01 -08:00
Naomi Seyfer
a744cbd9e8 Print a warning when you try to reset a deployed app, regarding how to actually dwym 2012-12-19 14:19:14 -08:00
David Greenspan
27382c62ee meteor.js: wrap in Fiber, use npm underscore
Conflicts:
	app/meteor/meteor.js
2012-12-18 16:49:51 -08:00
Naomi Seyfer
e0532012f6 Remove --debug option, replace with general NODE_OPTIONS env var 2012-12-18 15:35:35 -08:00
Naomi Seyfer
7724c7ef7f Changed from a fake enum thing to just strings for debug opts
Taking Geoff's advice.  Also adjusting the docstrings in the usage
for --debug and --debug-brk
2012-12-12 12:53:39 -08:00
Naomi Seyfer
9bc802b3f6 Added file with library of mongo exit codes
Make meteor clearer about why mongo exited.

test for one possible mongo badness

Only print explanation if we have it
2012-12-07 11:27:18 -08:00
David Glasser
8916b1cd02 Don't add '.meteor.com' to deployed app names (the server will do that now and
return the site URL).
2012-12-06 16:45:01 -08:00
Naomi Seyfer
325b93e6ea Add newline 2012-12-06 14:28:27 -08:00
Naomi Seyfer
16fff9ea48 Fixed documentation to talk about unsetting 2012-12-06 14:21:42 -08:00
Naomi Seyfer
ad45a0854b Passing an empty settings file unsets settings on deploy 2012-12-06 14:21:42 -08:00
Naomi Seyfer
3f8b7c9b78 More code review comments; simplifying mongo kill 2012-12-06 14:21:42 -08:00
Naomi Seyfer
0531db7dcb Adjusting code as per code review comments 2012-12-06 14:21:42 -08:00
Naomi Seyfer
dc47e4304c Geoff comments on usage text 2012-12-06 14:21:42 -08:00
Naomi Seyfer
67c37b9d41 removed extraneous console.log 2012-12-06 14:21:42 -08:00
Naomi Seyfer
8769274e76 Settings working with meteor deploy 2012-12-06 14:21:42 -08:00
Naomi Seyfer
fb1d2b319a Tests for --settings, and also Nick's review comments 2012-12-06 14:21:42 -08:00
Naomi Seyfer
4d5498424a launch_mongo now returns a handle that can stop the mongo proc 2012-12-06 14:21:42 -08:00