Commit Graph

41 Commits

Author SHA1 Message Date
Ben Newman
40f1d99e2c Stop polyfilling global.Buffer in modules test app. 2017-06-02 16:37:19 -04:00
Ben Newman
929fa0e90e Test that require("module") returns Module constructor on the client.
On the server, require("module") returns Node's native Module constructor,
which is not the same as module.constructor in our server JS bundle.
2017-06-02 16:26:54 -04:00
Ben Newman
6f75eae135 Remove automatic Buffer polyfill.
This polyfill is unnecessary in Node, and added a whopping 22KB to the
minified client bundle. If you really need the Buffer API on the client,
you can get it from require("buffer").Buffer.
2017-04-19 17:41:11 -04:00
Ben Newman
10127cea1f Fix modules test app now that exports.__esModule is non-enumerable.
3973bbad7f
2017-03-25 12:00:18 -04:00
Ben Newman
672c4f338a Add the modules test app to the self-test suite.
I've been running these tests manually ever since Meteor 1.3, but they
really should run every time.
2017-02-09 12:09:48 -05:00
Ben Newman
3120b9324d Update modules test app to Meteor 1.4.2.3. 2016-11-18 11:01:47 -05:00
Ben Newman
e3387599a2 Test lazy main modules and stray imports in modules test app. 2016-11-14 13:35:50 -05:00
Ben Newman
b16e8d5019 Implement inputFile.{getPackageJson,resolve,require} for use by plugins.
These changes allow Package.registerCompiler-style compiler plugins to
extract package.json and npm package information at compile time from the
files that the plugin processes.

This information was accessible before, but it certainly wasn't easy to
obtain it. These convenience methods should satisfy the motivation behind
2016-05-18 16:37:37 -04:00
Ben Newman
f6b75305b3 Pay attention to unibuild.arch when determining usesModules.
Fixes #6877.
2016-05-17 14:27:56 -04:00
Ben Newman
f616b6bc81 Let multiple files have the same .sourcePath in the ImportScanner.
Importantly, the files can now differ with respect to their .lazy
properties, which fixes #6806 and related issues. Note that the files must
have different .targetPath values if they have the same .sourcePath.

This is a minor breaking change for code that relied on module.id being
based on the .sourcePath instead of the .targetPath.
2016-04-13 19:49:29 -04:00
Ben Newman
b4fe0d5c85 Allow importing .css files from node_modules directories.
Fixes #6037.
2016-04-07 13:05:49 -04:00
Ben Newman
5f6f585276 Test fallback to index.js when package.json has no "main" field.
Related to #6589.
2016-03-24 20:07:14 -04:00
Ben Newman
be871bf2ed Upgrade modules-runtime install package to v0.6.1.
Fixes #6543.
2016-03-20 13:44:10 -04:00
Ben Newman
19d9f33219 Test that #6514 is fixed. 2016-03-18 15:00:54 -04:00
Ben Newman
f56940b314 Fix CSS computed property tests broken by app-hiding logic. 2016-03-10 16:04:04 -05:00
Ben Newman
ab959fb700 import assert from "assert" 2016-03-10 16:03:52 -05:00
Ben Newman
1d5e424bb7 Remove assertion that assumed too much about the util stub package. 2016-02-28 14:02:21 -05:00
Ben Newman
2fa65685d6 Install stubs for Node built-in modules automatically.
The implementation of these stubs is controlled by an optional npm package
called meteor-node-stubs, so we can keep iterating on them after releasing
Meteor 1.3, if we need to.

Fixes #6056.
2016-02-27 18:41:23 -05:00
Ben Newman
22d423e5a5 Infer optional import extensions from source processors.
This way, enabling an optional import extension like .jsx or .ts is as
easy as using the relevant compiler plugin.

Fixes #6151.
2016-02-26 14:36:32 -05:00
Ben Newman
ed454dfd7b Test that #6312 was fixed by the recent Babel upgrade.
Closes #6312.
2016-02-26 13:26:06 -05:00
Ben Newman
67e5157db4 Test that stub modules can be installed under different names.
This relies on the symbolic link functionality provided by meteorInstall.
2016-02-23 19:53:09 -05:00
Ben Newman
0efd8b7bef Allow JSX syntax in .js files compiled with ecmascript.
Fixes #6151.
2016-02-23 18:32:32 -05:00
Ben Newman
c368d98593 Support __filename and __dirname.
Part of #6055.
Fixes #6022.
2016-02-13 16:09:40 -05:00
Ben Newman
3ecc3e43a9 Allow main/browser field of package.json to be top-level identifier. 2016-02-12 16:58:12 -05:00
Ben Newman
e4544b5428 Prevent local node_modules from overriding builtins on the server. 2016-02-12 12:21:19 -05:00
Ben Newman
5d0a8f8f0e Allow apps and packages to import "meteor/<package>/..." modules. 2016-02-11 11:45:58 -05:00
Ben Newman
1437e07ee5 Forbid server bundles from importing client-only files.
This partially reverts 35a02864af, and also
fixes #6182.
2016-02-11 11:41:39 -05:00
Ben Newman
35a02864af Allow client modules to be imported by server modules. 2016-02-05 18:37:54 -05:00
Ben Newman
c9534b8156 Add a test that .es5.js files are not transpiled.
Part of #5782.
2016-02-05 17:03:50 -05:00
Ben Newman
ae90250f80 Don't assume strict mode when parsing ecmascript files.
This will require rebuilding the dev bundle before the next release.
2016-02-05 16:38:40 -05:00
Ben Newman
6d46ac6125 Add a basic test of import {Meteor} from meteor/meteor. 2016-02-05 16:38:40 -05:00
Ben Newman
bdf64da339 Avoid circular package.json resolution chains.
Fixes #6114.
2016-02-03 13:21:58 -05:00
Ben Newman
b0da03b009 Regression test to verify #6144 fixed.
Closes #6144.
2016-02-03 10:30:49 -05:00
Ben Newman
877cb9e61a Add a test of client/compatibility directories. 2016-01-25 15:34:16 -05:00
Ben Newman
2c1083feb3 Add basic test of async functions and await expressions. 2016-01-25 14:21:05 -05:00
Ben Newman
819e13a562 Fix modules tests to work with Babel 6 default exports. 2016-01-20 23:57:01 -05:00
Ben Newman
524970a20e Add tests of importing lazy CSS files in apps and packages. 2016-01-19 21:00:48 -05:00
Ben Newman
0907f52f53 Expose the "version" field of package.json files at runtime. 2016-01-18 19:27:04 -05:00
Ben Newman
c631d3ac35 Bundle global npm dependencies into the modules bundle.
This allows packages to import npm packages they have not installed, with
the expectation that the app developer will provide those dependencies by
installing them into the top-level node_modules directory in the app.

For example, an app can now `npm install react` and that npm package can
be used by any package as well as by the app.
2016-01-18 19:05:43 -05:00
Ben Newman
42a6bad2e3 Add some tests of importing lazy .html template modules. 2016-01-13 16:29:17 -05:00
Ben Newman
988b8b3d0c Commit an app that tests many aspects of the module system.
Partially satisfies #5782.
2016-01-11 15:31:32 -05:00