Commit Graph

6782 Commits

Author SHA1 Message Date
Ben Newman
095ded40b0 Add an ecmascript core package.
This package will be installed by default for all new apps and packages.

Passing the {transpile:false} option to api.addFiles makes it possible for
a dependent package to specify that some files should not be processed
through babel-compiler.
2015-07-16 18:02:07 -04:00
Ben Newman
caca6565eb Add a babel-runtime core package. 2015-07-16 18:02:06 -04:00
Ben Newman
cd483bf172 Add a babel-compiler core package. 2015-07-16 17:41:09 -04:00
Ben Newman
87347928b1 Rename ie8 package to ie8-support. 2015-07-16 17:39:34 -04:00
David Glasser
52e6b38ea1 Merge branch 'batch-plugins' into devel
Add new batch plugin APIs to Isobuild

New `Plugin.registerCompiler`, `Plugin.registerLinter`, and
`Plugin.registerMinifier` plugin methods.

* `registerCompiler` replaces the now-deprecated `Plugin.registerSourceHandler`
  and expands it to allow compilers which process more than one file at a time,
  and which always run in the context of your app (instead of before publishing
  a package). Compilers can use in-memory and on-disk caches, which are
  automatically cleared if the compiler itself changes version or is rebuilt
  (and on `meteor rebuild`).  Compilers can register for specific filenames
  in addition to extensions.

* `registerLinter` allows you to check code for style violations and other
  warnings. Unlike compilers, multiple linters can apply to the same file and
  linter violations do not prevent the app from building.

* `registerMinifier` allows you to override the default minification logic.  The
  default minification logic (which includes CSS merging which runs even in
  devel mode) now lives in the `standard-minifiers` package instead of
  hard-coded in Isobuild).  `standard-minifiers` is added to apps by
  a new upgrader.

To use these new APIs, your package must depend on a special pseudo-package like
`isobuild:compiler-plugin@1.0.0`.

Static assets in `package.js` files must be explicitly declared with
`{isAsset: true}` (and you should choose client vs server).  Existing
published packages will work, but their source will raise an error asking you
to add the flag.

`api.addFiles('foo.css')` without explicitly including `'client'` used to also
add `foo.css` as a server-side static asset. (This affected any handler using
archMatching, such as most CSS compilers and the templating `*.html` handler.)
Now, if a file is handled by a legacy source handler (or new compiler plugin) on
a subset of arches, it is *ignored* on other arches instead of treated as a
static asset. (This did not affect files in apps.)

New `meteor lint` command.

`meteor run`, `test-packages`, and `debug` display linter warnings by
default; this can be turned off with the `--no-lint` option.

Isopacks built by Isobuild are in a newer format, `isopack-2` (which contain
`isopack-2-unibuild` unibuilds). These can contain `source` resources (as well
as css/js, but those only come from legacy source handlers) and do not contain
`prelink` resources. They also don't contain a list of package variables,
because that is determined after running compiler plugins in the context of an
app. When possible, isopacks that are published to Atmosphere or placed in the
tropohouse also contain `isopack-1` data for older Isobuild versions to use.

The Windows-only colon conversion done when downloading packages to tropohouse
is skipped for `isopack-2` packages.

New `jshint` linter plugin package. (This package is currently in the core
release, but we may change our mind about this before the next Meteor release.)

`less` and `stylus` imports may cross package boundaries: `@import
"{packagename}/foo/bar.less";`.

In addition to the existing rules where files named `*.import.less` or
`*.lessimport` are not processed as "root" files, files in any subdirectory
named `imports` or tagged with `{isImport: true}` in `api.addFiles` are also
treated as "import-only" files and are not processed as root files.
The same goes for `stylus`.

In-memory and on-disk caches have been added to `coffeescript`, and
`less`. In-memory caches have been added to `stylus` and `templating`.

The `templating` package now detects duplicate `body` attributes across packages.

The default CSS minifier in `standard-minifiers` splits the merged CSS into
multiple files to keep each under the limit for maximum rules per file in IE.

We only prepend an anti-XSSI `)]}'` to source maps in production mode.

In `meteor run`, when rewriting the app bundle, the bundler defaults to
overwriting an existing app bundle instead of creating a new directory from
scratch. This behavior can be disabled by setting
`$METEOR_DISABLE_BUILDER_IN_PLACE`.

Version Solver: optimize the case where the constraint solver is called twice in
a row with the same input.

`linker` does more in-memory caching.

`sourceMap` can be now be specified to compiler plugins (and legacy source
handlers) as a JSON object as well as its stringified form

The URL used for original sources in source maps now begins with
`meteor://{PERSONAL COMPUTER EMOJI}app`, to make them more distinctive from the served files.

`linker` uses source maps to reflect the initial closure added around each file.

`WatchSet`s can now contain specific filenames that we expect to see in a
directory. Unlike `include` regexps, these take precedence over `exclude`
patterns.

- `source-map-support` to a fork of 0.3.2 (I think it was upgraded on devel too)
- `stylus` to a fork of 0.51.1 (from 0.46.3)
- `css-parse` to 2.0.0 (from an unreleased commit)
- `css-stringify` to 2.0.0 (from an unreleased commit)
- `less` to 2.5.0 (from 1.7.4)
2015-07-16 14:30:40 -07:00
Ben Newman
8f4767fa78 Create an ie8 package to improve ES5 support for older browsers. 2015-07-16 17:07:15 -04:00
David Glasser
cf737183ca Change import subdirectory name to 'imports'
@dgreensp:

    The more I think about it, the more I don't like naming a directory
    after a singular noun like `import`.  We have `packages/` already,
    and I want to put my modules in a directory called `modules/`, not
    `module/`, just like I don't want to put my assets in `asset/`, or
    my stylesheets in `stylesheet/`, etc.  It's ok to have a singular
    suffix and a plural directory name: to have `.import` files go in
    `imports` or `.template` files go in `templates`.  Directory names
    like `doc` and `lib` follow an old Unix convention of three-letter
    names.  And if the `import` directory name is actually a verb, not a
    noun, that is confusing because putting files in the `import`
    directory does not import them.  It just causes them to be
    considered imports (noun).
2015-07-16 12:48:53 -07:00
David Glasser
2e34ec1933 Merge branch 'devel' into batch-plugins 2015-07-16 00:47:15 -07:00
David Glasser
68b8455345 fix archMatching typo 2015-07-16 00:45:26 -07:00
David Glasser
36f4656ecb Revert "Move old stylus tests to new extensions"
This reverts commit 79a53736bb.
2015-07-16 00:37:08 -07:00
David Glasser
3a678154d9 Change stylus too 2015-07-16 00:34:50 -07:00
David Glasser
bdf1968ceb Change less heuristic back to default-process
In addition to the old `*.lessimport` and `*.import.less` mechanisms for
telling the `less` package that a file isn't a root, you can also put it
in an `import` subdirectory or pass `{isImport: true}` to
`api.addFiles`. We no longer will need to rename every less file when we
upgrade.

Next commit will revert the changes to examples and docs.
2015-07-16 00:29:19 -07:00
Slava Kim
b470105b5f Invalidate stylus cache based on the contents
because it breaks our sourcemaps paths
2015-07-15 18:56:02 -07:00
David Glasser
67091efe7c Remove js-analyze special case
js-analyze is a tiny wrapper around esprima and escope. We don't use it
anywhere but in the tool. We even already use esprima in the tool
elsewhere.

It creates a fair amount of additional complexity. None of the other
isopackets are used as part of the isopack-building process, so it has a
bunch of random special case code for it.
2015-07-15 14:17:53 -07:00
David Glasser
5a17a2064b Mostly tweak comments
Replace "XXX BBP" with more specific #BBPFoo
2015-07-15 13:33:51 -07:00
David Glasser
4b8d5b9ab9 Delete large unused less dist files
This isn't as bad as it was with the older version of less we used where
they actually distributed *every version of less* in the dist directory,
not just the current one.  But every byte counts!

(This is what Npm.strip is made for, but that doesn't support plugins.)
2015-07-15 00:03:19 -07:00
David Glasser
772034d176 Change linter API name to processFilesForPackage
Linters run on one package at a time rather than one target at a
time. This is mostly because they need to run outside the context of
apps in various places (eg when you publish the package, though that's
currently unimplemented).
2015-07-14 21:46:21 -07:00
O'meid
b6e578092e packages/facebook: Request fields using Graph 2.4. Closes #4743, closes #4744
Signed-off-by: O'meid <public@omeid.me>
2015-07-14 16:49:30 -07:00
Tom Freudenberg
09e07c6f4d Always have Meteor.settings.public
Even if it isn't set by command line, so that it can be set at runtime by
server code.

[stubailo: update commit message, remove extra if statement]
2015-07-14 15:58:46 -07:00
Joseph Orbegoso Pea
fcd5cc2d65 Improve Meteor.wrapAsync doc. 2015-07-14 15:44:24 -07:00
David Glasser
bb50ed099d remove outdated XXX BBP comment
error handling works and is tested
2015-07-14 13:46:11 -07:00
David Glasser
0629678414 Use registerCompiler via isobuild:compiler-plugin
Previously, registerCompiler was enabled by the *real* package
`compiler-plugin`, which arranged to only be available in versions of
the tool that support registerCompiler via... well, mostly via wishful
thinking.

Now this is implemented via a fake package called
isobuild:compiler-plugin. "isobuild" is a real Atmosphere organization
that will never publish any packages. The tool pretends that packages
isobuild:compiler-plugin@1.0.0, isobuild:linter-plugin@1.0.0, and
isobuild:minifier-plugin@1.0.0 exist, and carefully arranges for them to
be avoided in the actual process of building and app; they just are
referenced in Version Solver.

When we add future features like this, users of this version of Meteor
who try to depend on packages that need the feature will get a nice
error message pointing to
https://github.com/meteor/meteor/wiki/Isobuild-Feature-Packages

Users of current versions of Meteor who try to depend on packages that
require isobuild:compiler-plugin will get a slightly confusing message
about isobuild:compiler-plugin not existing.  Users of current versions
of Meteor who try to depend on packages only some of whose versions
require isobuild:compiler-plugin will get a version that doesn't require
it.
2015-07-14 10:30:42 -07:00
David Glasser
504649d17f improve standard-minifier mergeCss errors 2015-07-13 16:14:22 -07:00
Slava Kim
8900a8abfd WIP fixing minifiers 2015-07-13 15:59:13 -07:00
David Glasser
7cbdebf847 Fix minify option in cordova and old bundler tests
Rename 'mode' and 'minify' to 'minifyMode' consistently (including in
minifier plugin API).

Make minifyMode default to 'development' (fixes some other old bundler
tests).

This doesn't make bundler-assets pass but it gets farther along.
2015-07-13 13:45:22 -07:00
David Glasser
3c98084ee0 improve jshint config handling
reset the cache when the config changes
2015-07-09 16:39:36 -07:00
David Glasser
a18d238e7d fix minifiers tests 2015-07-09 15:33:20 -07:00
David Glasser
b1183b5059 Assets in packages must be explicitly declared
In the past, `api.addFiles('foo.gif')` would make foo.gif an asset if
there was no extension handler for gif active.  In fact, it would make
it a dual client/server asset even if that was unintentional.

This led to a few problems:
(a) People often left out 'client' and ended up packaging an unnecessary
    second server copy of the asset
(b) The implementation meant that `api.addFiles('foo.css')` would actually
    add foo.css as a static asset on the server (this was already fixed
    on batch-plugins via explicitly looking for wrong-arch
    classifications)
(c) Now that we have linters, if a file is used by a linter but not by a
    compiler (eg linter config files), there was no way to say in a
    package "add this file, but just for linters, don't make it a static
    asset too".

These are only really issues in packages, not apps.  In apps, we avoid
them by only marking things as static assets if they are in public or
private (and not letting those things be considered as other kinds of
sources).

This is a backwards-incompatible change, but it does not affect apps or
published packages, just packages built from source.
2015-07-09 15:17:56 -07:00
David Glasser
b75064f689 Merge branch 'devel' into batch-plugins 2015-07-09 10:48:30 -07:00
Oleksandr Chekhovskyi
565fa39037 Catch up to oplog at most once per write fence
Before this change, number of catch-up attempts was N*M, where N is number of
writes inside of the fence, and M is number of active observers on affected collections.
Every catch up issues yet another query to find the latest oplog entry.

It was extremely inefficient, in terms of both CPU usage and added latency.
After executing write-heavy methods, application process was occupied for many seconds
doing the same thing over and over again.

This change provides a performance improvement for all kinds of workloads.
2015-07-09 09:25:56 -07:00
David Glasser
ea45e6a9f1 Allow plugins to register specific filenames
This is in addition to registering for extensions. Note that only the
new SourceProcessor APIs allow this, not registerSourceHandler.

The filename in question is the basename of the file.  The file can be
found in any directory in any package.  If you want to be more picky,
you can just ignore other ones in your processFilesForTarget.

This introduces the SourceProcessorSet abstraction, which simplifies a
lot of repeated code around matching filenames with processors and
avoiding duplicates.

Missing tests.

See also #3985.
2015-07-08 17:23:31 -07:00
David Glasser
5ed5a4c261 remove console.log 2015-07-07 17:56:06 -07:00
David Greenspan
a10513eec5 Treat main.styl files like *.main.styl files
Same idea as previous commit about LESS

Tried it and it works.
2015-07-07 14:40:04 -07:00
Simon Fridlund
f91da45458 Remove all verificationTokens for a specific email once verified
This will break the other verification email links but it will keep the
user document cleaner. The email will be verified anyways so who cares
that the other verification links isn’t working any more.

Closes #4626
2015-07-07 14:39:59 -07:00
David Greenspan
3196d6e27d Treat main.less files like *.main.less files
This means `foo/bar/main.less` is also a "main" file.
2015-07-07 14:03:06 -07:00
Avital Oliver
d634651232 spiderable: on failure report URL
This would have helped diagnose an issue that @zol hit on a production
app behaving differently on staging and production environments
2015-07-07 09:44:15 -07:00
Slava Kim
9d610e8d26 Prefer source-maps in memory in a parsed JSON form 2015-07-06 15:25:11 -07:00
David Greenspan
ed822326aa Reuse previous Constraint Solver result in tool
If the same ProjectContext calls the PackagesResolver
multiple times and the ConstraintSolver.Input structure
is identical, reuse the same answer.  We still ask the
tool for the catalog data, which currently goes to sqlite
(taking ~70ms in the app tested), but we skip creating a
CS.Solver and a Logic.Solver and running them (~450ms).

Note that if a new ProjectContext is created (not sure when
that happens?), there's no caching across that.
2015-07-06 14:54:08 -07:00
Martijn Walraven
f6b22fa10b Fix for a case where we have neither a public email nor user:email permission 2015-07-01 10:22:16 -07:00
Martijn Walraven
c376057c06 Link to specific paragraph about index use in MongoDB docs 2015-06-30 16:22:34 -07:00
Martijn Walraven
bd8aa9293b User -intercept emails in tests to avoid trying to send them 2015-06-30 15:45:38 -07:00
Martijn Walraven
e6b7f13038 Request user:email permission for GitHub by default
Closes #4545.
2015-06-30 15:34:33 -07:00
Martijn Walraven
f32f07ab56 Use GitHub primary email only if public email not set 2015-06-30 15:34:32 -07:00
Simon Fridlund
c4bc118d00 Use GitHub account's primary email if the scope allows it
In the case when user or user:email scope wasn’t provided, use the
publicly visible email as before. In this case you can end up with not
having an email for GitHub accounts.
2015-06-30 15:34:32 -07:00
Simon Fridlund
3833be8bc1 Use primary email for the email field
The email provided by the user info in the response from /user is the
publicly visible email, which a user can choose to not set.

GitHub accounts always have a primary email, so let’s use that one
instead.
2015-06-30 15:34:32 -07:00
Simon Fridlund
7581cd398f Fetch emails from GitHub
This allows one to determine if an email is verified or not and also
gives you all emails the user have registered on GitHub
2015-06-30 15:34:32 -07:00
David Glasser
0ddc411e15 accounts-ui-unstyled depends on jquery
There is 1 (1!) use of `$`, in
`click #configure-login-service-dialog-save-configuration`

(It probably could be rewritten to not use jquery though.)

Fixes #4616.
2015-06-30 14:09:05 -07:00
David Glasser
447d236a9b sub.ready() should be true inside its onReady
Fixes #4614.
2015-06-30 13:57:48 -07:00
David Glasser
dd548edd72 less: better error for unknown @import
also, fix coffee/less self-test
2015-06-30 00:09:42 -07:00
David Glasser
2bcabf8fcd add missing var 2015-06-29 21:13:53 -07:00