Commit Graph

7422 Commits

Author SHA1 Message Date
Filipe Névola
81b57029fb Merge pull request #11044 from vparpoil/updateFlowRouterPackage 2020-05-21 11:02:34 -04:00
filipenevola
f315d7f318 Fixes #11043 Update link of installing-prerequisites for mobile apps 2020-05-21 07:32:35 -04:00
Victor Parpoil
977a0af49e replace Template.dynamic with {{> yield}} 2020-05-20 10:03:23 +02:00
Victor Parpoil
189aaa4768 Replace kadira:flow-router with ostrio:flow-router-extra
see issue #11014
2020-05-05 11:26:26 +02:00
Michael Newman
aedcffab3b Convert parse-stack.js to TypeScript (#10653)
* rename

* we don't need underscore to check whether an array is empty

* add types, resolve type issues

* remove unused markTop in run.js

* Make the type a little more consistent

* Tweak a check for an empty array

Co-Authored-By: Marcelo T Prado <marceloterreiroprado@gmail.com>
2020-04-20 14:47:34 -04:00
filipenevola
158ca094ce Merge branch 'devel' into release-1.10.2 2020-04-17 20:21:54 -04:00
Seba Kerckhof
9c9a8263ab Add separate SERVER_NODE_FLAGS envar (#10965)
* Add separate SERVER_NODE_FLAGS envar

Since Meteor 0.5.3, Meteor allowed to pass node command line flags
to the server node process via the `NODE_OPTIONS` environment variable.

However, since Node version 8 / Meteor 1.6 this has become a default node
envar with the same behavior:
https://nodejs.org/api/cli.html#cli_node_options_options

The side effect is that this now also affects Meteor tool.

The command line parameters could already be set separately via the `TOOL_NODE_FLAGS` envar.
This is now also possible (again) for the server.
2020-04-17 20:17:53 -04:00
James Burgess
302e3b433a Add prepositions to changeAuthorized verbs (#10617) 2020-04-17 20:11:46 -04:00
claudiosdc
cba4b7b1b3 Proposed fix for issue #10803 (#11010) 2020-04-17 13:43:19 -04:00
Filipe Névola
f80ae8205d Adds support to override mongo options via Meteor settings (#10976)
* Adds support to mongo options via Meteor settings
The options are in the `packages` key in the `mongo` key that is the package name. We should use the pattern every time we need a setting in a package.
2020-04-17 13:04:35 -04:00
Kyle Shankwiler
6803d8dfd1 Add an error message warning developers of oversized headers. (#10877)
* Add an error message warning developers of oversized headers.

An explanation of the issue being logged can be found here: https://forums.meteor.com/t/meteor-1-8-1-unexpected-error-too-many-csp-rules/48447/12.

* Ensure the large request header test works as intended
2020-04-17 11:32:21 -04:00
Ben Newman
dab79ff4c6 Update modules test app to Meteor 1.10.1. 2020-03-31 12:06:58 -04:00
Ben Newman
f78afca824 Update linked copy of acorn source used by modules test app. 2020-03-31 12:06:58 -04:00
Ben Newman
a1b1846fc0 Update dynamic-import test app Meteor and npm versions. 2020-03-31 12:06:58 -04:00
Ben Newman
faa006a81f Remove unnecessary "incremental":true option from tools/tsconfig.json.
https://circleci.com/gh/meteor/meteor/43634
2020-03-24 13:01:13 -04:00
Ben Newman
d274d8d7ef Work around bizarre SQLite dynamic type conversion behavior.
SQLite has a worse-is-better philosophy about automatically converting
between different data types, such as strings and floating point numbers:
https://www.sqlite.org/quirks.html#flexible_typing

This means querying for the string "1.10" in a given column can return
rows where the column is actually the string "1.1", since SQLite imagines
you might be talking about the number 1.1, rather than the string you
actually requested.

This "feature" became a problem for Meteor after we published Meteor 1.10,
which caused SQLite to return multiple rows for the getReleaseVersion
query, including both Meteor 1.10 and Meteor 1.1 (which is ancient, from
March 2015).

While this behavior seems completely indefensible, the SQLite
documentation clearly does not consider it a bug, which forces us to work
around the consequences by double-checking the queried results with the
filterExactRows helper function.
2020-03-12 18:07:39 -04:00
filipenevola
e4fc3ccbcf Documents the new command to ensure cordova dependencies are installed 2020-03-11 23:01:31 -03:00
Ben Newman
2b8834e92e Stop calling moduleDoesResolve before installing Cordova npm deps.
This fixes the bug where commands like `meteor add-platform ios` would
fail the first time with an error that cordova-lib could not be found,
even though we attempt to install the necessary packages if they have not
already been installed.

To make a very long story short, calling moduleDoesResolve before
installing dependencies like cordova-lib was causing Node.js to cache the
_absence_ of cordova-lib/package.json permanently in the new
packageJsonCache, which cannot be invalidated or cleared by user code:
f8f20892e9/lib/internal/modules/cjs/loader.js (L245-L255)

Although we could potentially propose a change to Node to allow the
packageJsonCache to be invalidated, a more immediate solution is simply to
avoid calling moduleDoesResolve when there's any chance the module will
not resolve. Because we still want to avoid repeatedly installing Cordova
dependencies every time we run a Cordova command, we instead check whether
the necessary dependencies are installed by examining the file system.
2020-03-11 18:01:33 -04:00
filipenevola
824b247daa Adds a new command to ensure cordova dependencies are installed 2020-03-11 17:59:56 -03:00
filipenevola
4997c76989 Removes unnecessary code (protect-string-proto.js) as Cordova 9 is not using shelljs anymore and also some unused imports 2020-03-11 17:59:25 -03:00
filipenevola
ae503c5727 Use -quiet option for iOS to avoid unnecessary messages 2020-03-06 10:25:18 -04:00
filipenevola
feebaabc95 Fixes SWIFT_VERSION error 2020-03-06 10:24:56 -04:00
filipenevola
975759f6aa WKWebViewOnly is set by default now as true and updates cordova-plugin-meteor-webapp to 1.9.0 that is compatible with Swift 5 2020-03-04 17:11:41 -04:00
filipenevola
8b642e2ee6 Pins cordova-plugin-inappbrowser to 3.2.0 2020-03-02 15:38:19 -04:00
filipenevola
23b8bd142e Updates skel-typescript
- meteor create --typescript app now uses useTracker hook instead of withTracker HOC, it also uses function components instead of classes
2020-02-28 16:05:38 -04:00
filipenevola
356f0a4d79 Updates skel-react
- meteor create --react app now uses useTracker hook instead of withTracker HOC, it also uses function components instead of classes
2020-02-28 15:44:01 -04:00
Ben Newman
a467255d9c Use IPC message to handle .reload command in meteor shell.
I considered using a nonzero process.exit code, but I didn't want to run
any risk of reusing a meaningful code, and the accepted range of codes
unfortunately does not include parseInt("reload", 36), or 1657112629.

Should fix #10934.
2020-02-26 12:13:48 -05:00
Ben Newman
8939f93d86 Merge branch 'devel' into release-1.10 2020-02-25 18:53:50 -05:00
Brian Mulhall
c68757a52c remove the xmlbuilder isopack and all references to it in the code 2020-02-25 15:44:44 -05:00
Brian Mulhall
65799b23ae Update the builder.js file to use the xmlbuilder2 node package directly, and no longer by importing the isopackxmlbuilder 2020-02-25 15:44:43 -05:00
Brian Mulhall
20bc926f05 update the builder.js to use the xmlbuilder2's api instead of the xmlbuilder api.
updates are made to account for the following api changes

1.) raw is no longer used by xmlbuilder2
2.) element has been shortened to ele
3.) the create function signature/definition has changed compared to xmlbuilder
2020-02-25 15:44:43 -05:00
Filipe Névola
e31f390237 Merge branch 'release-1.10' into devel 2020-02-25 15:42:03 -04:00
cyrille
a72ee88a0e Merge branch 'devel' of https://github.com/meteor/meteor into devel 2020-02-25 13:08:52 +01:00
filipenevola
dfef2c3641 Drops support for Windows 32-bit as MongoDB no longer supports it 2020-02-21 19:21:12 -04:00
filipenevola
94b79bfb03 Merge branch 'devel' into release-1.10 2020-02-21 16:47:30 -04:00
Filipe Névola
cb6c663f1c Merge branch 'devel' into error-page-syntax-highlighting 2020-02-21 16:42:55 -04:00
Ben Newman
150d387b44 Merge branch 'master' into devel 2020-02-20 11:24:20 -05:00
cyrille
53dff3f174 remove useless slash in path 2020-02-20 10:09:35 +01:00
cyrille
1e4288f1f9 Merge branch 'devel' of https://github.com/meteor/meteor into devel 2020-02-20 09:44:09 +01:00
Ben Newman
924c748ecc Avoid bailing out with module.useNode() for ESM modules.
On the server, Meteor attempts to avoid bundling node_modules code by
replacing entry point modules with a stub that calls module.useNode() (see
packages/modules-runtime/server.js). This trick allows evaluating server
node_modules natively in Node.js, faithfully preserving all Node-specific
behaviors, such as module.id being an absolute file system path, the
__dirname and __filename variables, the ability to import binary .node
modules, and so on.

However, starting in Node.js 12.16.0 (Meteor 1.9.1+), modules evaluated
natively by Node are considered ECMAScript modules (ESM) if the closest
package.json file has "type": "module" (or has an .mjs file extension).
This poses a problem for the module.useNode() trick, because ESM modules
cannot be imported synchronously using require (which is currently how
module.useNode() works).

To work around this new error, this commit checks package.json for "type":
"module" in ImportScanner#shouldUseNode to determine whether it's safe to
use the module.useNode() trick.

The good news is that ESM modules don't have access to nearly as many
Node.js-specific quirks: no module, require, or exports variables; no
__dirname, no __filename; no ability to import JSON or other non-ESM file
types (at least right now). So it seems somewhat less important for ESM
code (compared to CommonJS code) to bail out into native Node.js execution
using module.useNode(). In other words, bundling server code should not
affect its execution in nearly as many cases, if that code is ESM rather
than legacy CommonJS.

If this good news turns out to be overly optimistic, we can consider using
a different kind of bailout stub that's capable of importing ESM using
dynamic import(). For now, making sure we avoid bailing out for ESM code
like @babel/runtime/helpers/esm/* is the priority.
2020-02-19 15:24:42 -04:00
Ben Newman
9c852da695 Make optimisticLookupPackageJson return array of package.json objects.
Commit 646fa4e3ee fixed #10547 by
restricting optimisticLookupPackageJson to package.json files with a
"name" property, which effectively skipped over intermediate package.json
files with additional properties.

However, in Node.js 12.16.0 (Meteor 1.9.1+), modules evaluated natively by
Node are considered ECMAScript modules if the closest package.json file
has "type": "module" (or has an .mjs file extension). This poses a problem
for the module.useNode() trick (see packages/modules-runtime/server.js),
because ESM modules cannot be imported using require.

For example, recent versions of the @babel/runtime package have a
@babel/runtime/helpers/esm/package.json file for the ESM versions of its
helpers (which specifies "type": "module"), but that package.json file
does not have a "name" property, because it is not the root package.json
file representing the entire @babel/runtime package.

I considered making the "name" restriction configurable, but that would
have fragmented the caching of optimisticLookupPackageJson. Instead, I
made it return an array of all potentially relevant package.json objects,
which can be safely cached.

This means that the caller has to iterate over the array, but there is
only one call site for this function (in tools/isobuild/package-source.js)
right now, so that wasn't too much work.
2020-02-19 15:24:42 -04:00
Ben Newman
87bc54fb9f Avoid bailing out with module.useNode() for ESM modules.
On the server, Meteor attempts to avoid bundling node_modules code by
replacing entry point modules with a stub that calls module.useNode() (see
packages/modules-runtime/server.js). This trick allows evaluating server
node_modules natively in Node.js, faithfully preserving all Node-specific
behaviors, such as module.id being an absolute file system path, the
__dirname and __filename variables, the ability to import binary .node
modules, and so on.

However, starting in Node.js 12.16.0 (Meteor 1.9.1+), modules evaluated
natively by Node are considered ECMAScript modules (ESM) if the closest
package.json file has "type": "module" (or has an .mjs file extension).
This poses a problem for the module.useNode() trick, because ESM modules
cannot be imported synchronously using require (which is currently how
module.useNode() works).

To work around this new error, this commit checks package.json for "type":
"module" in ImportScanner#shouldUseNode to determine whether it's safe to
use the module.useNode() trick.

The good news is that ESM modules don't have access to nearly as many
Node.js-specific quirks: no module, require, or exports variables; no
__dirname, no __filename; no ability to import JSON or other non-ESM file
types (at least right now). So it seems somewhat less important for ESM
code (compared to CommonJS code) to bail out into native Node.js execution
using module.useNode(). In other words, bundling server code should not
affect its execution in nearly as many cases, if that code is ESM rather
than legacy CommonJS.

If this good news turns out to be overly optimistic, we can consider using
a different kind of bailout stub that's capable of importing ESM using
dynamic import(). For now, making sure we avoid bailing out for ESM code
like @babel/runtime/helpers/esm/* is the priority.
2020-02-19 13:25:22 -05:00
Ben Newman
290e084cab Make optimisticLookupPackageJson return array of package.json objects.
Commit 646fa4e3ee fixed #10547 by
restricting optimisticLookupPackageJson to package.json files with a
"name" property, which effectively skipped over intermediate package.json
files with additional properties.

However, in Node.js 12.16.0 (Meteor 1.9.1+), modules evaluated natively by
Node are considered ECMAScript modules if the closest package.json file
has "type": "module" (or has an .mjs file extension). This poses a problem
for the module.useNode() trick (see packages/modules-runtime/server.js),
because ESM modules cannot be imported using require.

For example, recent versions of the @babel/runtime package have a
@babel/runtime/helpers/esm/package.json file for the ESM versions of its
helpers (which specifies "type": "module"), but that package.json file
does not have a "name" property, because it is not the root package.json
file representing the entire @babel/runtime package.

I considered making the "name" restriction configurable, but that would
have fragmented the caching of optimisticLookupPackageJson. Instead, I
made it return an array of all potentially relevant package.json objects,
which can be safely cached.

This means that the caller has to iterate over the array, but there is
only one call site for this function (in tools/isobuild/package-source.js)
right now, so that wasn't too much work.
2020-02-19 13:14:47 -05:00
Ben Newman
fc2bdd6ddf Attempt to fix @babel/runtime/helpers/esm/* import test.
CircleCI tests will fail for this commit, since these changes do not
address the problem that the module.useNode() stub imports the ESM code
using require. I will fix the tests properly in a later commit.
2020-02-19 13:13:32 -05:00
Ben Newman
b6320119d4 Update @babel/* dependencies of modules test app. 2020-02-19 11:07:29 -05:00
Ben Newman
8ff7eed55c Merge branch 'devel' into release-1.10 2020-02-19 09:41:44 -05:00
claudiosdc
924b5e8c3c Improve Node.js built-in modules detection to fix #10892 (#10896) 2020-02-07 17:45:20 -05:00
Ben Newman
6f083942b8 Merge branch 'devel' into release-1.10 2020-02-01 14:16:56 -05:00
Ben Newman
b3b5fee25f Add missing lazyFinalizer parameter to InputFile#addHtml.
Fixes #10883.
2020-02-01 13:47:47 -05:00
Seba Kerckhof
28d898dd0b Merge branch 'devel' into error-page-syntax-highlighting 2020-01-23 16:52:52 +01:00