The beta released with this commit (modules-beta.6) included everything on
the release-1.3 branch up to bdf64da339
("Avoid circular package.json resolution chains.").
Unfortunately, additional commits were pushed to the branch before this
commit was pushed, so the release tag release/METEOR@1.3-modules-beta.6
does not correspond to any commit in the branch history.
Rather than attempting to rewrite the branch history, I decided to amend
this commit with this explanation before pushing it.
To see exactly what was released with the sixth beta:
git fetch --tags
git log release/METEOR@1.3-modules-beta.6
This fixes Babel.parse, improves Babel.compile cache performance, and
stops forcing strict mode in module files, which fixes problems with
global variable assignments.
Switching from "require" to "import" in the coffeescript plugin
broke our hack that keeps coffeescript from clobbering our version
of Error.prepareStackTrace, because imports are automatically
hoisted to the top of the file, and thus so are any side effects of
requiring a module.
The new fix has the tool save a copy of the correct
Error.prepareStackTrace so that any plugin that wants to unclobber
Error.prepareStackTrace can do so.
Other, fancier fixes are possible; there's a package called
stack-chain that installs a getter/setter on
Error.prepareStackTrace:
e51a7b2e0f/stack-chain.js (L136)
The trick of returning an object other than `this` from the constructor
function makes the classes created by Meteor.makeErrorType impossible to
subclass, unless the subclass is very careful to return the same object
from its own constructor.
Fortunately, the only reason we needed an actual Error instance in this
code was to get access to its .stack property, which we can just as easily
borrow from an auxiliary Error object.
Instead, we rely on the fallback function defined in
meteor/packages/modules/modules.js to resolve meteor/package identifiers
at runtime. The ImportScanner also now warns if no such Meteor package
seems to be available.
Package stubs were a clever hack, but eliminating them means every module
installed by meteorInstall now corresponds to some actual module file.
Previously Meteor packages were installed at /node_modules/<package-name>.
This commit wraps them in an additional directory called "meteor", which
prevents their names from colliding with other installed npm package
names, and also means Meteor package identifiers must now include the
"meteor/" prefix:
import Blaze from "meteor/blaze"
This change will eventually enable Meteor packages to import npm packages
installed in top-level node_modules directories of apps. That won't work
just yet, though, because the app bundler doesn't yet know anything about
external dependencies imported by packages.
When downloading files during a Cordova hot code push, we need to
detect if a file is not available instead of inadvertently downloading
the default index page.
If we serve files with a Last-Modified based on the file date, this
interferes with content-based cache validation using ETag because
clients are required to take both into account.
We previously served non-cacheable files with a max-age of a day. This was done
to avoid image flickering on page reload (see #773).
As far as I can tell, image flickering still occurs because `location.reload`
always forces validation. But switching to `location.replace` means that max-age
will actually be respected, and we don't want to cache these assets for a day
because then changes would not be visible on reloads.
If a cached version of an asset is still fresh (depending on the `max-age`), there
is no need to send even a conditional request. Because `location.reload()` for
some reason does force validation, it makes sense to use `location.replace` instead
and improve reloading performance by avoiding unnecessary requests.
Previously, the ETag header was set (by `send`) to a default value based on the
inode of the file. Using the asset hash instead allows for proper conditional
requests even after redeployments.
To take advantage of content-based caching, we also have to disable the
Last-Modified header because having this set to the file date would still make
requests conditional on the most recent deployment. This requires updating the
send dependency and is done in a separate commit.
Fixes#626.
Prior to this change, linker’s package global variable scanning mechanism was
broken. All package global variables were exposed as full global variables.
This was due to calling `escope`’s `analyzeScope` function with `{sourceType:
"modules"}`.
While at it, fixed incorrect code that exposes `process` on the client. The
previous code seemed to work to work because we were exposing all package globals as
real globals.
Should fix#5870 and #5819
This commit allows middleware to set the status code of the http response. This will allow a server-side router to return, for example, a '404 Not Found' response. This has SEO benefits because currently search engines may index example.org/page-that-doesn't-exist because Meteor returns a 200 OK code and the normal boilerplate response body. With a proper 404 status we can still return the boilerplate to render a client side 404 template but search engines won't index the page. Instead of a hardcoded 200 response, we call res.writeHead with res.statusCode, and fallback to the default 200 code if it has not been set.