Commit Graph

198 Commits

Author SHA1 Message Date
Ben Newman
6b646c6a8f Merge branch 'release-1.8.3' into release-1.9 2019-12-18 16:23:31 -05:00
Ben Newman
5758aaa30d Add jquery npm package to modules test app. 2019-12-18 14:53:16 -05:00
Seba Kerckhof
8b43e385e0 Add upgrader to add jquery dependency for blaze-users. (#10801) 2019-12-18 13:45:38 -05:00
Ben Newman
24e02b7411 Avoid bundling jquery twice (#10498)
Although the Meteor jquery package is no long a core package (and thus is
not tied to the Meteor release), it seems like a good idea to nudge folks
towards installing jquery from npm, instead of relying on the very old
version (1.12.1) residing in meteor/packages/non-core/jquery/jquery.js.

Closes #10289.
2019-12-18 13:45:36 -05:00
Ben Newman
c90246d55b Merge branch 'devel' into release-1.9 2019-11-26 15:46:38 -05:00
Ben Newman
0af5c64bd1 Update modules test app to Meteor 1.8.2. 2019-11-14 17:21:02 -05:00
Ben Newman
f8de4127da Merge branch 'release-1.8.2' into release-1.9 2019-11-08 20:07:59 -05:00
Ben Newman
bd9043db20 Prefer "main" field of package.json over "module" in legacy bundle.
https://github.com/meteor/meteor/issues/10658#issuecomment-550456095
https://github.com/meteor/meteor/issues/10658#issuecomment-551870115

As usual, changes to module resolution logic need to happen in parallel in
tools/isobuild/resolver.ts and in packages/modules-runtime. However,
thanks to the modern/legacy system, it's easy to make the modules-runtime
package behave exactly the way(s) we want in the server, modern client,
and legacy client bundles.
2019-11-08 11:15:23 -05:00
Ben Newman
b32e44a5d5 Merge branch 'release-1.8.2' into release-1.9 2019-07-30 14:24:09 -04:00
Ben Newman
4e894663f5 Add basic test of TypeScript support to modules test app. 2019-07-07 19:29:34 -04:00
Ben Newman
df4e54a80d Test that the ganalytics npm package is importable.
As reported by @arggh in this comment:
https://github.com/meteor/meteor/pull/10522#issuecomment-508908306
2019-07-06 12:38:04 -04:00
Ben Newman
53fd2a1f4a Merge branch 'release-1.8.2' into release-1.9 2019-07-04 17:27:51 -04:00
Ben Newman
146e6ba1d4 Update @babel/{runtime,...} dependencies of modules test app. 2019-07-04 16:04:33 -04:00
Ben Newman
a68dc6d977 Merge branch 'release-1.8.2' into release-1.9 2019-07-03 13:30:44 -04:00
Ben Newman
e195440442 Fall back to package.json "main" field if "module" cannot be resolved.
The meteor/tools/isobuild/resolver.js changes are the static half of the
puzzle. The runtime half was implemented in install@0.13.0 with this
commit: 233aa75ce3
2019-07-03 12:25:05 -04:00
Ben Newman
2fa761bbfc Test that ESM modules can be imported from npm packages.
With appropriate meteor.nodeModules.recompile configuration, that is.
2019-07-02 11:50:51 -04:00
Ben Newman
108144c3d5 Update @babel/* dependencies of modules test app. 2019-07-02 11:41:39 -04:00
Ben Newman
2dae9be561 Regression test that the graphql package can be imported. 2019-06-25 14:25:23 -04:00
Ben Newman
2e309f5639 Merge branch 'release-1.8.2' into release-1.9 2019-06-24 15:48:15 -04:00
Ben Newman
88004d4649 Add a basic regression test of issue #10563. 2019-06-20 12:11:29 -04:00
Ben Newman
9b68eb7af2 Merge branch 'release-1.8.2' into release-1.9 2019-05-06 12:27:44 -04:00
Ben Newman
5d0a1200c7 Allow .npm/package/node_modules to be compiled in Meteor packages.
When I implemented support for the "module" entry point in package.json
files for client code in #10541, I modified PackageSource#_findSources to
include files found in node_modules that need to be compiled, but my
implementation considered only "local" node_modules directories, like the
one in the application root directory, while neglecting the private
.npm/package/node_modules directories that many Meteor packages have.

This commit includes .npm/**/node_modules when _findSources is scanning a
Meteor package, which should solve issues like #10544, where a Meteor
package imports an npm package that was installed with Npm.depends, and
that npm package has a "module" field in its package.json file, pointing
to an ESM entry point module, but the ESM syntax was not appropriately
compiled, leading to parse errors like "Unexpected token export".

Before lazy compilation was introduced in Meteor 1.7 (#9983), including
the node_modules directories of Meteor packages would likely have been a
big problem for build performance, since there would be that many more
modules to compile. It's still worth making sure this change doesn't
regress build performance for other reasons, but I'm reasonably confident
lazy compilation will save us here, unless there are just too many npm
packages installed via Npm.depends that export ESM modules.
2019-05-04 18:08:49 -04:00
Ben Newman
9a4fa16db9 Merge branch 'devel' into release-1.8.2 2019-05-03 14:29:48 -04:00
Ben Newman
f166f226d8 Support the "module" field of package.json for client code. (#10541)
Supporting "module" in package.json for server code is not advisable
because Node.js will be adopting the "type":"module" convention instead,
and in the meantime we need to maintain consistency with Node's module
resolution rules, which only currently pay attention to "main":
https://medium.com/@nodejs/announcing-a-new-experimental-modules-1be8d2d6c2ff
2019-05-02 18:30:13 -04:00
Ben Newman
9171b568a4 Remove long-deprecated idle-gc dependency from modules test app.
https://circleci.com/gh/meteor/meteor/32476
2019-04-12 18:43:12 -04:00
Ben Newman
07815583f1 Update modules test app to Meteor 1.8.1 and meteor-node-stubs@1.0.0. 2019-04-10 19:18:36 -04:00
Ben Newman
20da99c219 Do not treat client and server directories specially in packages. (#10414)
Fixes #10393.

Bumping compiler.BUILT_BY and LINKER_CACHE_SALT because
PR #10414 changes the behavior of the build system in a subtle way that
does not automatically trigger recompilation.
2019-01-11 16:52:23 -05:00
Ben Newman
dea96ecac6 Fix #10409 by ignoring self-referential browser aliases in package.json. 2019-01-10 11:31:49 -05:00
Ben Newman
fb2146cb3b Stop excluding test modules when meteor.testModule found in package.json. (#10402)
New Meteor apps have the following meteor.testModule in their package.json
files by default

  "meteor": {
    "testModule": "tests/main.js"
  }

When meteor.testModule is defined, it determines the test entry point when
running the `meteor test` command, ignoring legacy file naming conventions
like *.tests.js or *.app-tests.js.

The package-source.js code changed by this commit was incorrect because it
ignored those specially-named test files even when running tests, which
was a problem if the meteor.testModule tried to import them explicitly,
because they would not be properly compiled.

If you're using meteor.testModule, the distinction between `meteor test`
and `meteor test --full-app` matters a bit less, since the test entry
point will be the same for both modes, though you can still check
Meteor.isTest and Meteor.isAppTest at runtime to control test behavior.
2019-01-06 15:02:48 -05:00
Ben Newman
18762f97a2 Update modules test app to Meteor 1.8. 2018-10-13 19:32:10 -04:00
Ben Newman
c5f6c270b7 Avoid modifying source files explicitly added by compiler plugins.
Should resolve #10233, reported by @klaussner.

Previously, if a compiler plugin called inputFile.addJavaScript multiple
times with different { path } strings, Meteor would allow importing all of
those modules at once by importing the original source module identifier,
by synthesizing a new source module containing a series of re-exports for
each of the generated modules.

Preserving this behavior is important for backwards compatibility, since
some compiler plugins still generate files like "module.ext.js" given an
input file named "module.ext", so Meteor tries to make those modules
interchangeable/synonymous.

However, if the compiler plugin explicitly calls inputFile.addJavaScript
with the original source path, then it would be a mistake to modify the
contents of that module, so Meteor will now leave the contents of that
explicit source module unmodified, rather than using it as a catch-all way
to import other generated modules.
2018-10-03 15:13:08 -04:00
Ben Newman
defbf6d6eb Merge branch 'devel' into release-1.7.1 2018-08-07 13:30:16 -04:00
Ben Newman
228688cb8c Update vulnerable moment dependency of modules test app. 2018-08-07 12:28:44 -04:00
Ben Newman
619a8b6924 Merge branch 'master' into devel 2018-08-07 11:49:34 -04:00
Ben Newman
7593c74a7b Pin test app @babel/... dependencies to version 7.0.0-beta.55.
Also updated the dynamic-import test app to Meteor 1.7.0.3.
2018-08-06 12:35:23 -04:00
Ben Newman
2603f7c06a Add akryum:vue-component to modules test app to verify #10129 fix. 2018-08-06 11:15:29 -04:00
Ben Newman
818022dd02 Update moment dependency of modules test app to appease npm audit. 2018-08-06 11:15:28 -04:00
Ben Newman
d2942614ae Update modules test app to Meteor 1.7.1-beta.28. 2018-08-06 11:10:34 -04:00
Ben Newman
bcaeed676e Move puppeteer back to dependencies for test applications.
This should fix test failures, because apparently it's important that
puppeteer not be installed in devDependencies.
2018-08-04 14:49:55 -04:00
Ben Newman
b23b1213f4 Update @babel/... dependencies of modules test app to 7.0.0-beta.56.
Also moving puppeteer to devDependencies.
2018-08-04 14:27:38 -04:00
Ben Newman
7dc77cdaf1 Fix importing local .json modules within Meteor packages.
The ImportScanner was mistakenly generating module.useNode() stub modules
for local .json files within Meteor packages, just because their absolute
module identifiers include "node_modules", which happens because we put
package modules under the /node_modules/meteor/<package name/ namespace.

Fix: make logic for determining when to generate module.useNode() stubs
match Module.prototype.useNode logic in modules-runtime/server.js.

Closes #10122.
2018-08-03 11:07:51 -04:00
Ben Newman
a4657f34d5 Merge branch 'devel' into release-1.7.1 2018-07-19 17:53:10 -04:00
Ben Newman
35473f29e4 Move package.json private field stripping tests into modules test app.
Follow-up to #9903.
2018-07-19 15:31:17 -04:00
Ben Newman
2cc172bbed Fix meteor scripts in tools/tests/apps/modules/package.json. 2018-07-18 12:48:35 -04:00
Ben Newman
a756af487b Merge branch 'devel' into release-1.7.1 2018-07-18 12:42:01 -04:00
Ben Newman
8b04c25390 Emit multiple meteorInstall calls for distinct meteorInstallOptions.
I recently noticed a bug whereby modules transferred from the application
bundle to the modules bundle would lose their application-specific import
extensions, since all modules installed in the modules bundle have only
.js and .json as import extensions, matching default Node behavior.

This commit fixes that bug by emitting one meteorInstall call per distinct
meteorInstallOptions object. This logic would work if every module had a
different meteorInstallOptions object, but in practice the modules bundle
should end up with exactly two meteorInstall calls, because a single
options object is shared among all modules from the same source batch.
2018-06-28 18:07:34 -04:00
Toine van Kampen
499bb7ea25 Merge remote-tracking branch 'meteor/devel' into devel
Rebaseline
2018-06-06 20:28:03 +10:00
Ben Newman
0fcf29eaee Update modules test app to Meteor 1.7. 2018-05-27 20:38:01 -04:00
Ben Newman
dbdadc1b11 Avoid using "browser" field of package.json for inputFile.resolve.
Fixes #9870.
2018-05-12 12:43:54 -04:00
Ben Newman
b7579ad100 Update modules test app to Meteor 1.7-rc.5. 2018-05-09 19:12:13 -04:00