From f32f1e2b073b8b2fc2cea7545a661436bfa2efb5 Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Tue, 7 Nov 2017 10:23:00 -0500 Subject: [PATCH 01/12] Add note about possible package incompatibilty with 1.5 (#9314) --- History.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/History.md b/History.md index c20b20a298..3abc1e2f30 100644 --- a/History.md +++ b/History.md @@ -19,6 +19,26 @@ ## v1.6, 2017-10-30 +* **Important note for package maintainers:** + + With the jump to Node 8, some packages published using Meteor 1.6 may no + longer be compatible with older Meteor versions. In order to maintain + compatibility with Meteor 1.5 apps when publishing your package, you can + specify a release version with the meteor publish command: + + ``` + meteor --release 1.5.3 publish + ``` + + If you're interested in taking advantage of Meteor 1.6 while still + supporting older Meteor versions, you can consider publishing for Meteor + 1.6 from a new branch, with your package's minor or major version bumped. + You can then continue to publish for Meteor 1.5 from the original branch. + Note that the 1.6 branch version bump is important so that you can continue + publishing patch updates for Meteor 1.5 from the original branch. + + [Issue #9308](https://github.com/meteor/meteor/issues/9308) + * Node.js has been upgraded to version 8.8.1, which will be entering long-term support (LTS) coverage on 31 October 2017, lasting through December 2019 ([full schedule](https://github.com/nodejs/Release#nodejs-release-working-group)). From c26b91a1f0af2e2ca3a70c8b4ef0c74b443b1eae Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Wed, 8 Nov 2017 07:02:14 -0500 Subject: [PATCH 02/12] Update Facebook OAuth app config steps (#9258) * Update Facebook OAuth app config steps Facebook has updated their application developer portal, so the steps for creating a Facebook OAuth app have changed. This commit updates the steps shown as part of the `facebook-config-ui` setup process, to line up with Facebook's new dev portal. Fixes #8867. * Capitalize CAPTCHA. Nit: Capitalized CAPTCHA since it's an acronym. * Bump facebook-config-ui package version to 1.0.1. --- .../facebook_configure.html | 32 +++++++++++++------ packages/facebook-config-ui/package.js | 2 +- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/packages/facebook-config-ui/facebook_configure.html b/packages/facebook-config-ui/facebook_configure.html index 18ddeeb990..6eca279ec5 100644 --- a/packages/facebook-config-ui/facebook_configure.html +++ b/packages/facebook-config-ui/facebook_configure.html @@ -10,29 +10,43 @@ Click "Add a New App".
  • - Select "Website" and type a name for your app. + Add a "Display Name" for your app and click on "Create App ID".
  • - Click "Create New Facebook App ID". + Answer the "Security Check" CAPTCHA and click on "Submit".
  • - Select a category in the dropdown and click "Create App ID". + When the new app dashboard loads, click on "Settings" in the left hand menu.
  • - Under "Tell us about your website", set Site URL to: {{siteUrl}} and click "Next". + From the top of the "Basic" settings page, note down your "App ID" and "App Secret" (you will be asked for them at the bottom of this popup).
  • - Click "Skip to Developer Dashboard". + Click on the "Add Platform" button, and select "Website".
  • - Go to the "Settings" tab and add an email address under "Contact Email". Click "Save Changes". + In the "Website" section, set the "Site URL" to {{siteUrl}} and click on "Save Changes".
  • - Go to the "Status & Review" tab and select Yes for "Do you want to make this app and - all its live features available to the general public?". Click "Confirm". + Click on "Add Product" in the left hand menu.
  • - Go back to the Dashboard tab. + Hover over "Facebook Login", click on "Set Up". +
  • +
  • + Click on "Facebook Login > Settings" from the left hand menu. +
  • +
  • + Set "Valid OAuth redirect URIs" to {{siteUrl}}_oauth/facebook and click on "Save Changes". +
  • +
  • + Select "App Review" from the left hand menu. +
  • +
  • + Toggle the "Make app public" switch to "Yes". +
  • +
  • + Select a "Category" in the "Make app public" popup and click on "Confirm".
  • diff --git a/packages/facebook-config-ui/package.js b/packages/facebook-config-ui/package.js index b056ecdca5..34022735a7 100644 --- a/packages/facebook-config-ui/package.js +++ b/packages/facebook-config-ui/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: "Blaze configuration templates for Facebook OAuth.", - version: "1.0.0" + version: "1.0.1" }); Package.onUse(function(api) { From 073f2410a685f1de87f70dff6a097b1eea2712b1 Mon Sep 17 00:00:00 2001 From: skirunman Date: Wed, 8 Nov 2017 08:14:12 -0800 Subject: [PATCH 03/12] Cordova 7.1.0, Android 6.3.0 and iOS 4.5.3 updates (#9213) * Update to Cordova 7.1.0 and Cordova Android 6.3.0 * Update deprecated Cordova plugins * Update History.md for both Cordova updates and previous iOS icons and launch screens * Update the PR # * Remove change to History.md This change is now in https://github.com/meteor/meteor/pull/9227 * Update to iOS 4.5.2 Update to new Cordova iOS 4.5.2 release. https://cordova.apache.org/announcements/2017/10/16/ios-release.html * Update History.md for Cordova iOS 4.5.2. * Update to Cordova iOS 4.5.3 Update to Cordova iOS 4.5.3, see https://cordova.apache.org/announcements/2017/10/31/ios-release.html * Tweak history for update to Cordova iOS 4.5.3 * Update iOS launch screens Updating iOS launch screens to match what is supported in Cordova iOS 4.5.3 and remove latest iPad Pro sizes that are not supported in Xcode 9 and therefore not in Cordova iOS. See https://github.com/surajpindoria/cordova-ios/blob/c3d24a9f02aa096c2b8951cc6980eefbbd26fd72/bin/templates/scripts/cordova/lib/prepare.js --- History.md | 10 ++++++++++ packages/logging/package.js | 2 +- scripts/dev-bundle-tool-package.js | 1 + tools/cordova/builder.js | 15 +++++++-------- tools/cordova/index.js | 4 ++-- tools/cordova/project.js | 6 +++--- 6 files changed, 24 insertions(+), 14 deletions(-) diff --git a/History.md b/History.md index 3abc1e2f30..70304ff5e2 100644 --- a/History.md +++ b/History.md @@ -1,5 +1,15 @@ ## v.NEXT +* [`cordova-lib`](https://github.com/apache/cordova-cli) has been updated to + version 7.1.0, [`cordova-android`](https://github.com/apache/cordova-android/) + has been updated to version 6.3.0, and [`cordova-ios`](https://github.com/apache/cordova-ios/) + has been updated to version 4.5.3. The cordova-plugins `cordova-plugin-console`, + `cordova-plugin-device-motion`, and `cordova-plugin-device-orientation` have been + [deprecated](https://cordova.apache.org/news/2017/09/22/plugins-release.html) + and will likely be removed in a future Meteor release. + [Feature Request #196](https://github.com/meteor/meteor-feature-requests/issues/196) + [PR #9213](https://github.com/meteor/meteor/pull/9213) + * iOS icons and launch screens have been updated to support iOS 11 [Issue #9196](https://github.com/meteor/meteor/issues/9196) [PR #9198](https://github.com/meteor/meteor/pull/9198) diff --git a/packages/logging/package.js b/packages/logging/package.js index e37cf530b0..02e99dfbc6 100644 --- a/packages/logging/package.js +++ b/packages/logging/package.js @@ -12,7 +12,7 @@ Npm.strip({ }); Cordova.depends({ - 'cordova-plugin-console': '1.0.7' + 'cordova-plugin-console': '1.1.0' // Dreprecated, remove in future }); Package.onUse(function (api) { diff --git a/scripts/dev-bundle-tool-package.js b/scripts/dev-bundle-tool-package.js index fdde521a2d..c85a272e17 100644 --- a/scripts/dev-bundle-tool-package.js +++ b/scripts/dev-bundle-tool-package.js @@ -52,6 +52,7 @@ var packageJson = { pathwatcher: "7.1.0", optimism: "0.3.3", 'lru-cache': '4.0.1', + 'cordova-lib': "7.1.0", longjohn: '0.2.12' } }; diff --git a/tools/cordova/builder.js b/tools/cordova/builder.js index ab880d674d..4f54eb2bb9 100644 --- a/tools/cordova/builder.js +++ b/tools/cordova/builder.js @@ -55,11 +55,13 @@ const launchIosSizes = { 'iphoneX_landscape': '2436x1125', 'ipad_portrait_2x': '1536x2048', 'ipad_landscape_2x': '2048x1536', - 'ipad_portrait_pro_10_5': '1668x2224', - 'ipad_landscape_pro_10_5': '2224x1668', - 'ipad_portrait_pro_12_9': '2048x2732', - 'ipad_landscape_pro_12_9': '2732x2048', + // Not yet supported in Xcode 9 or Cordova iOS 4.5.3 + // 'ipad_portrait_pro_10_5': '1668x2224', + // 'ipad_landscape_pro_10_5': '2224x1668', + // 'ipad_portrait_pro_12_9': '2048x2732', + // 'ipad_landscape_pro_12_9': '2732x2048', // Legacy + 'iphone': '320x480', 'iphone_2x': '640x960', 'ipad_portrait': '768x1024', 'ipad_landscape': '1024x768' @@ -603,10 +605,7 @@ configuration. The key may be deprecated.`); * - `iphoneX_landscape` (2436x1125) // iPhone X * - `ipad_portrait_2x` (1536x2048) // iPad, iPad mini * - `ipad_landscape_2x` (2048x1536) // iPad, iPad mini - * - `ipad_portrait_pro_10_5` (1668x2224) // iPad Pro 10.5" - * - `ipad_landscape_pro_10_5` (2224x1668) // iPad Pro 10.5" - * - `ipad_portrait_pro_12_9` (2048x2732) // iPad Pro 12.9" - * - `ipad_landscape_pro_12_9` (2732x2048) // iPad Pro 12.9" + * - `iphone` (320x480) // Legacy * - `iphone_2x` (640x960) // Legacy * - `ipad_portrait` (768x1024) // Legacy * - `ipad_landscape` (1024x768) // Legacy diff --git a/tools/cordova/index.js b/tools/cordova/index.js index ecf172b39c..61968572d6 100644 --- a/tools/cordova/index.js +++ b/tools/cordova/index.js @@ -14,8 +14,8 @@ export const CORDOVA_DEV_BUNDLE_VERSIONS = { }; export const CORDOVA_PLATFORM_VERSIONS = { - 'android': '6.2.3', - 'ios': '4.5.1' + 'android': '6.3.0', + 'ios': '4.5.3' }; const PLATFORM_TO_DISPLAY_NAME_MAP = { diff --git a/tools/cordova/project.js b/tools/cordova/project.js index da846ae7c1..5b0e89048e 100644 --- a/tools/cordova/project.js +++ b/tools/cordova/project.js @@ -53,11 +53,11 @@ const pinnedPlatformVersions = CORDOVA_PLATFORM_VERSIONS; const pinnedPluginVersions = { "cordova-plugin-battery-status": "1.2.4", "cordova-plugin-camera": "2.4.1", - "cordova-plugin-console": "1.0.7", + "cordova-plugin-console": "1.1.0", // Deprecated, remove in future "cordova-plugin-contacts": "2.3.1", "cordova-plugin-device": "1.1.6", - "cordova-plugin-device-motion": "1.2.5", - "cordova-plugin-device-orientation": "1.0.7", + "cordova-plugin-device-motion": "2.0.0", // Deprecated, remove in future + "cordova-plugin-device-orientation": "2.0.0", // Deprecated, remove in future "cordova-plugin-dialogs": "1.3.3", "cordova-plugin-file": "4.3.3", "cordova-plugin-file-transfer": "1.6.3", From 18dcb4d6d29af65b543612ffec1670e4ffd3d99a Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Wed, 8 Nov 2017 11:43:14 -0500 Subject: [PATCH 04/12] Handle overridden _.template settings in boilerplate-generator (#9250) * Handle overridden _.template settings in boilerplate-generator When `underscore`'s default `_.template` settings are overridden using `_.templateSettings` in an application, this can adversely affect the `_.template` calls used by the `boilerplate-generator` to render an application's initial HTML template. These changes make sure the `boilerplate-generator` is overridding any defined `_.templateSettings` with its own verified to work settings. Fixes #9149. * Add comment explaining additional _.template config override * Handle overridden _.templateSettings with the cordova boilerplate * Remove underscore use wherever possible * Change incorrect implementation of an "empty" manifest. This test was trying to imply an empty manifest by using an empty associative array (hash), whereas a manifest is only ever an array of hashes (as per the bundler code). Therefore, an empty manifest should be an array with no items. This is to fix the failure seen in https://travis-ci.org/meteor/meteor/builds/291857783?utm_source=github_status&utm_medium=notification because of @hwillson's changes in https://github.com/meteor/meteor/pull/9250/commits/9aee811a4b6d0743b212cc1b7f8bb93723372e74. Refs: meteor/meteor#9250. * Make underscore replacement code more defensive `_.map` handles a falsy input value, whereas `Array.prototype.map` (obivously) does not. While not likely common practice, it's possible falsy values are being passed into the boilerplate generator, for elements like `js`, `css`, etc. These changes replicate `_.map`'s handling of incoming falsy values by converting them to an empty array. --- .../boilerplate-generator-tests/package.js | 6 +++- .../boilerplate-generator-tests/test-lib.js | 2 +- .../web.browser-tests.js | 22 +++++++++++++++ .../web.cordova-tests.js | 21 ++++++++++++++ packages/boilerplate-generator/generator.js | 8 ++++-- packages/boilerplate-generator/package.js | 4 +-- .../template-web.browser.js | 28 +++++++++---------- .../template-web.cordova.js | 20 ++++++------- packages/boilerplate-generator/template.js | 14 ++++++++++ packages/webapp/webapp_tests.js | 2 +- 10 files changed, 94 insertions(+), 33 deletions(-) create mode 100644 packages/boilerplate-generator/template.js diff --git a/packages/boilerplate-generator-tests/package.js b/packages/boilerplate-generator-tests/package.js index 574df6f83e..ade4c13729 100644 --- a/packages/boilerplate-generator-tests/package.js +++ b/packages/boilerplate-generator-tests/package.js @@ -12,7 +12,11 @@ Npm.depends({ Package.onTest(function (api) { api.use('ecmascript'); - api.use(['tinytest', 'boilerplate-generator'], 'server'); + api.use([ + 'underscore', + 'tinytest', + 'boilerplate-generator' + ], 'server'); api.addFiles('web.browser-tests.js', 'server'); api.addFiles('web.cordova-tests.js', 'server'); }); diff --git a/packages/boilerplate-generator-tests/test-lib.js b/packages/boilerplate-generator-tests/test-lib.js index 1084396018..98b445b7c3 100644 --- a/packages/boilerplate-generator-tests/test-lib.js +++ b/packages/boilerplate-generator-tests/test-lib.js @@ -25,7 +25,7 @@ export function generateHTMLForArch(arch) { // webapp_server usually constructs a Boilerplate object similarly const inline = true; const inlineScriptsAllowed = true; - const additionalStaticJs = []; + const additionalStaticJs = [{ contents: 'var a' }]; const meteorRuntimeConfig = 'config123'; const rootUrlPathPrefix = 'rootUrlPathPrefix'; const htmlAttributes = { diff --git a/packages/boilerplate-generator-tests/web.browser-tests.js b/packages/boilerplate-generator-tests/web.browser-tests.js index afe5287393..f69df8dbef 100644 --- a/packages/boilerplate-generator-tests/web.browser-tests.js +++ b/packages/boilerplate-generator-tests/web.browser-tests.js @@ -1,4 +1,5 @@ import { parse, serialize } from 'parse5'; + import { generateHTMLForArch } from './test-lib'; const html = generateHTMLForArch('web.browser'); @@ -39,3 +40,24 @@ Tinytest.add("boilerplate-generator-tests - web.browser - call rewriteHook", fun Tinytest.add("boilerplate-generator-tests - web.browser - include runtime config", function (test) { test.matches(html, /]*>[^<>]*__meteor_runtime_config__ =.*decodeURIComponent\(config123\)/); }); + +// https://github.com/meteor/meteor/issues/9149 +Tinytest.add( + "boilerplate-generator-tests - web.browser - properly render boilerplate " + + "elements when _.template settings are overridden", + function (test) { + import { _ } from 'meteor/underscore'; + _.templateSettings = { + interpolate: /\{\{(.+?)\}\}/g + }; + const newHtml = generateHTMLForArch('web.browser'); + test.matches(newHtml, /foo="foobar"/); + test.matches(newHtml, /]*href="[^<>]*bootstrap[^<>]*">/); + test.matches(newHtml, /]*src="[^<>]*templating[^<>]*">/); + test.matches(newHtml, /')({ + ? template(' ')({ conf: meteorRuntimeConfig }) - : _.template(' ')({ + : template(' ')({ src: rootUrlPathPrefix }) ) , '' ], - _.map(js, ({url}) => - _.template(' ')({ + (js || []).map(({ url }) => + template(' ')({ src: bundledJsCssUrlRewriteHook(url) }) ), - _.map(additionalStaticJs, ({contents, pathname}) => ( + (additionalStaticJs || []).map(({ contents, pathname }) => ( (inlineScriptsAllowed - ? _.template(' ')({ + ? template(' ')({ contents: contents }) - : _.template(' ')({ + : template(' ')({ src: rootUrlPathPrefix + pathname })) )), @@ -73,4 +74,3 @@ export default function({ ], ).join('\n'); } - diff --git a/packages/boilerplate-generator/template-web.cordova.js b/packages/boilerplate-generator/template-web.cordova.js index 42e3af5486..12f4bdde36 100644 --- a/packages/boilerplate-generator/template-web.cordova.js +++ b/packages/boilerplate-generator/template-web.cordova.js @@ -1,5 +1,6 @@ -// Template function for rendering the boilerplate html for cordova +import template from './template'; +// Template function for rendering the boilerplate html for cordova export default function({ meteorRuntimeConfig, rootUrlPathPrefix, @@ -25,14 +26,14 @@ export default function({ ' ', ], // We are explicitly not using bundledJsCssUrlRewriteHook: in cordova we serve assets up directly from disk, so rewriting the URL does not make sense - _.map(css, ({url}) => - _.template(' ')({ + (css || []).map(({ url }) => + template(' ')({ href: url }) ), [ ' ' ], - _.map(js, ({url}) => - _.template(' ')({ + (js || []).map(({ url }) => + template(' ')({ src: url }) ), - _.map(additionalStaticJs, ({contents, pathname}) => ( + (additionalStaticJs || []).map(({ contents, pathname }) => ( (inlineScriptsAllowed - ? _.template(' ')({ + ? template(' ')({ contents: contents }) - : _.template(' ')({ + : template(' ')({ src: rootUrlPathPrefix + pathname })) )), @@ -76,4 +77,3 @@ export default function({ ], ).join('\n'); } - diff --git a/packages/boilerplate-generator/template.js b/packages/boilerplate-generator/template.js new file mode 100644 index 0000000000..1f702adad7 --- /dev/null +++ b/packages/boilerplate-generator/template.js @@ -0,0 +1,14 @@ +import { _ } from 'meteor/underscore'; + +// As identified in issue #9149, when an application overrides the default +// _.template settings using _.templateSettings, those new settings are +// used anywhere _.template is used, including within the +// boilerplate-generator. To handle this, _.template settings that have +// been verified to work are overridden here on each _.template call. +export default function template(text) { + return _.template(text, null, { + evaluate : /<%([\s\S]+?)%>/g, + interpolate : /<%=([\s\S]+?)%>/g, + escape : /<%-([\s\S]+?)%>/g, + }); +}; diff --git a/packages/webapp/webapp_tests.js b/packages/webapp/webapp_tests.js index 108e3da6c9..2c2dac7d97 100644 --- a/packages/webapp/webapp_tests.js +++ b/packages/webapp/webapp_tests.js @@ -146,7 +146,7 @@ Tinytest.add("webapp - generating boilerplate should not change runtime config", var boilerplate = WebAppInternals.generateBoilerplateInstance( "web.browser", - {}, // empty manifest + [], // empty manifest { runtimeConfigOverrides: { WEBAPP_TEST_KEY: true } } ); From 18f73f2041d2ad001643be3c7e150fe17124a8a4 Mon Sep 17 00:00:00 2001 From: Simon Fridlund Date: Wed, 8 Nov 2017 17:57:59 +0100 Subject: [PATCH 05/12] Minimongo sorting bug with falsey selector (#9302) * Add test for sorting with falsey selector Falsy selectors should result in empty result and sorting shouldn't blow up. * Protect sorter from falsey selectors --- packages/minimongo/minimongo_tests_client.js | 4 ++++ packages/minimongo/sorter.js | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/packages/minimongo/minimongo_tests_client.js b/packages/minimongo/minimongo_tests_client.js index 3fbdaad7ab..9e32f3e89b 100644 --- a/packages/minimongo/minimongo_tests_client.js +++ b/packages/minimongo/minimongo_tests_client.js @@ -2079,6 +2079,10 @@ Tinytest.add('minimongo - sort', test => { for (let i = 0; i < 50; i++) { for (let j = 0; j < 2; j++) {c.insert({a: i, b: j, _id: `${i}_${j}`});} } + + test.equal(c.find(null, {sort: {b: -1, a: 1}, limit: 5}).fetch(), []); + test.equal(c.find(undefined, {sort: {b: -1, a: 1}, limit: 5}).fetch(), []); + test.equal(c.find(false, {sort: {b: -1, a: 1}, limit: 5}).fetch(), []); test.equal( c.find({a: {$gt: 10}}, {sort: {b: -1, a: 1}, limit: 5}).fetch(), [ diff --git a/packages/minimongo/sorter.js b/packages/minimongo/sorter.js index a98f0ff997..20ebe61caa 100644 --- a/packages/minimongo/sorter.js +++ b/packages/minimongo/sorter.js @@ -353,6 +353,12 @@ export default class Sorter { } const selector = matcher._selector; + + // If the user just passed a falsey selector to find(), + // then we can't get a key filter from it. + if (!selector) { + return; + } // If the user just passed a literal function to find(), then we can't get a // key filter from it. From 35e70fd23d949a2b08bad86a62e9c131ef5a3509 Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Wed, 8 Nov 2017 12:04:59 -0500 Subject: [PATCH 06/12] Stop adding line number comments to linked JavaScript files. (#9323) Several years ago, before all major browsers supported source maps, we felt it was important to provide line number information in generated files using end-of-line comments like "// 123\n". Adding all these comments was always slower than leaving the code unmodified, and recently they have begun interacting badly with certain newer ECMAScript syntax, such as multi-line template strings (#9160). Since source maps are well supported in most browsers that developers are likely to be using for development, and the line number comments are now causing substantive problems beyond the performance cost, I think it's time we stopped using them once and for all. Fixes #9160. --- tools/isobuild/compiler-plugin.js | 1 - tools/isobuild/compiler.js | 6 -- tools/isobuild/isopack-cache.js | 3 - tools/isobuild/linker.js | 97 ++----------------------------- 4 files changed, 5 insertions(+), 102 deletions(-) diff --git a/tools/isobuild/compiler-plugin.js b/tools/isobuild/compiler-plugin.js index 1b0abdbabf..63092ed7d0 100644 --- a/tools/isobuild/compiler-plugin.js +++ b/tools/isobuild/compiler-plugin.js @@ -1301,7 +1301,6 @@ export class PackageSourceBatch { // XXX report an error if there is a package called global-imports importStubServePath: isApp && '/packages/global-imports.js', includeSourceMapInstructions: isWeb, - noLineNumbers: !isWeb }; const fileHashes = []; diff --git a/tools/isobuild/compiler.js b/tools/isobuild/compiler.js index 49d5b707a9..7b4e024923 100644 --- a/tools/isobuild/compiler.js +++ b/tools/isobuild/compiler.js @@ -61,9 +61,6 @@ compiler.compile = Profile(function (packageSource, options) { "` in package `" + packageSource.name + "`", rootPath: packageSource.sourceRoot }, function () { - // XXX we should probably also pass options.noLineNumbers into - // buildJsImage so it can pass it back to its call to - // compiler.compile var buildResult = bundler.buildJsImage({ name: info.name, packageMap: packageMap, @@ -186,7 +183,6 @@ compiler.compile = Profile(function (packageSource, options) { sourceArch: architecture, isopackCache: isopackCache, nodeModulesPath: nodeModulesPath, - noLineNumbers: options.noLineNumbers }); _.extend(pluginProviderPackageNames, @@ -345,8 +341,6 @@ var compileUnibuild = Profile(function (options) { const inputSourceArch = options.sourceArch; const isopackCache = options.isopackCache; const nodeModulesPath = options.nodeModulesPath; - const noLineNumbers = options.noLineNumbers; - const isApp = ! inputSourceArch.pkg.name; const resources = []; const pluginProviderPackageNames = {}; diff --git a/tools/isobuild/isopack-cache.js b/tools/isobuild/isopack-cache.js index 4f2a5f3ed7..b6952151e7 100644 --- a/tools/isobuild/isopack-cache.js +++ b/tools/isobuild/isopack-cache.js @@ -51,8 +51,6 @@ export class IsopackCache { // Map from package name to Isopack. self._isopacks = Object.create(null); - self._noLineNumbers = !! options.noLineNumbers; - self._lintLocalPackages = !! options.lintLocalPackages; self._lintPackageWithSourceRoot = options.lintPackageWithSourceRoot; @@ -362,7 +360,6 @@ export class IsopackCache { isopack = compiler.compile(packageInfo.packageSource, { packageMap: self._packageMap, isopackCache: self, - noLineNumbers: self._noLineNumbers, includeCordovaUnibuild: self._includeCordovaUnibuild, includePluginProviderPackageMap: true, pluginCacheDir: pluginCacheDir diff --git a/tools/isobuild/linker.js b/tools/isobuild/linker.js index 0e74142be7..ce7d79ebc2 100644 --- a/tools/isobuild/linker.js +++ b/tools/isobuild/linker.js @@ -50,7 +50,6 @@ var Module = function (options) { self.meteorInstallOptions = options.meteorInstallOptions; self.useGlobalNamespace = options.useGlobalNamespace; self.combinedServePath = options.combinedServePath; - self.noLineNumbers = options.noLineNumbers; }; _.extend(Module.prototype, { @@ -188,7 +187,6 @@ _.extend(Module.prototype, { chunks.push(file.getPrelinkedOutput({ sourceWidth: sourceWidth, - noLineNumbers: self.noLineNumbers })); ++fileCount; @@ -255,7 +253,6 @@ _.extend(Module.prototype, { const { code: source, map } = file.getPrelinkedOutput({ sourceWidth: sourceWidth, - noLineNumbers: this.noLineNumbers }).toStringWithSourceMap({ file: servePath, }); @@ -340,7 +337,6 @@ _.extend(Module.prototype, { chunks.push(t.getPrelinkedOutput({ sourceWidth, - noLineNumbers: self.noLineNumbers })); } else if (_.isObject(t)) { @@ -429,7 +425,6 @@ _.extend(Module.prototype, { if (file.bare) { chunks.push("\n", file.getPrelinkedOutput({ sourceWidth, - noLineNumbers: this.noLineNumbers })); } else if (moduleCount > 0 && ! file.lazy) { eagerModuleFiles.push(file); @@ -695,8 +690,6 @@ _.extend(File.prototype, { // - preserveLineNumbers: if true, decorate minimally so that line // numbers don't change between input and output. In this case, // sourceWidth is ignored. - // - noLineNumbers: We still include the banners and such, but - // no line number suffix. // - sourceWidth: width in columns to use for the source code // // Returns a SourceNode. @@ -704,18 +697,9 @@ _.extend(File.prototype, { var self = this; var width = options.sourceWidth || 70; var bannerWidth = width + 3; - var noLineNumbers = options.noLineNumbers; var preserveLineNumbers = options.preserveLineNumbers; - var result; if (self.sourceMap) { - // If we have a source map, and options.noLineNumbers was not - // specified, it is important to annotate line numbers using that - // source map, since not all browsers support source maps. - if (typeof noLineNumbers === "undefined") { - noLineNumbers = false; - } - // Honoring options.preserveLineNumbers is likely impossible if we // have a source map, since self.source has probably already been // transformed in a way that does not preserve line numbers. That's @@ -723,76 +707,12 @@ _.extend(File.prototype, { // line numbers using comments (see above), just in case source maps // are not supported. preserveLineNumbers = false; - - } else if (preserveLineNumbers) { - // If we don't have a source map, and we're supposed to be preserving line - // numbers (ie, we are not linking multiple files into one file, because - // we're the app), then we can get away without annotating line numbers - // (or making a source map), because they won't add any helpful - // information. - noLineNumbers = true; } - let consumer; - let lines; - - if (self.sourceMap) { - result = { - code: self.source, - map: self.sourceMap - }; - - consumer = new sourcemap.SourceMapConsumer(result.map); - - } else { - result = { - code: self.source, - map: null, - }; - - // Generating line number comments for really big files is not - // really worth it when there's no meaningful self.sourceMap. - if (! noLineNumbers && result.code.length < 500000) { - consumer = { - originalPositionFor(pos) { - return pos; - } - }; - } - } - - if (consumer && ! noLineNumbers) { - var padding = bannerPadding(bannerWidth); - - // We might have already done this split above. - lines = lines || result.code.split(/\r?\n/); - - // Use the SourceMapConsumer object to compute the original line - // number for each line of result.code. - for (var i = 0, lineCount = lines.length; i < lineCount; ++i) { - var line = lines[i]; - var len = line.length; - if (len < width && - line[len - 1] !== "\\") { - var pos = consumer.originalPositionFor({ - line: i + 1, - column: 0 - }); - - if (pos) { - line += padding.slice(len, width) + " //"; - // Not all source maps define a mapping for every line in the - // output. This is perfectly normal. - if (typeof pos.line === "number") { - line += " " + pos.line; - } - lines[i] = line; - } - } - } - - result.code = lines.join("\n"); - } + const result = { + code: self.source, + map: self.sourceMap || null, + }; var chunks = []; var pathNoSlash = convertColons(self.servePath.replace(/^\//, "")); @@ -827,11 +747,7 @@ _.extend(File.prototype, { let chunk = result.code; - if (consumer instanceof sourcemap.SourceMapConsumer) { - chunk = sourcemap.SourceNode.fromStringWithSourceMap( - result.code, consumer); - - } else if (consumer && result.map) { + if (result.map) { chunk = sourcemap.SourceNode.fromStringWithSourceMap( result.code, new sourcemap.SourceMapConsumer(result.map), @@ -943,7 +859,6 @@ export var prelink = Profile("linker.prelink", function (options) { var module = new Module({ name: options.name, combinedServePath: options.combinedServePath, - noLineNumbers: options.noLineNumbers }); _.each(options.inputFiles, function (inputFile) { @@ -1100,7 +1015,6 @@ export var fullLink = Profile("linker.fullLink", function (inputFiles, { // True if JS files with source maps should have a comment explaining // how to use them in a browser. includeSourceMapInstructions, - noLineNumbers, }) { buildmessage.assertInJob(); @@ -1109,7 +1023,6 @@ export var fullLink = Profile("linker.fullLink", function (inputFiles, { meteorInstallOptions, useGlobalNamespace, combinedServePath, - noLineNumbers }); _.each(inputFiles, file => module.addFile(file)); From 8695fbfb0cef31fce2a42f60fe07ee03bdc499ef Mon Sep 17 00:00:00 2001 From: Mitar Date: Wed, 8 Nov 2017 10:15:25 -0800 Subject: [PATCH 07/12] Bumping sockjs-node to 0.3.19. (#9215) --- packages/ddp-server/package.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ddp-server/package.js b/packages/ddp-server/package.js index bbd3c4fa3b..0d1cb508b9 100644 --- a/packages/ddp-server/package.js +++ b/packages/ddp-server/package.js @@ -6,7 +6,7 @@ Package.describe({ Npm.depends({ "permessage-deflate": "0.1.6", - sockjs: "0.3.18" + sockjs: "0.3.19" }); Package.onUse(function (api) { From abc349cab7e4e688db554faccbdb67a982ffd6c5 Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Wed, 8 Nov 2017 14:00:59 -0500 Subject: [PATCH 08/12] Update shrinkwrap for ddp-server npm dependencies. --- .../.npm/package/npm-shrinkwrap.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/ddp-server/.npm/package/npm-shrinkwrap.json b/packages/ddp-server/.npm/package/npm-shrinkwrap.json index 8406a30286..062690825f 100644 --- a/packages/ddp-server/.npm/package/npm-shrinkwrap.json +++ b/packages/ddp-server/.npm/package/npm-shrinkwrap.json @@ -7,9 +7,9 @@ "integrity": "sha1-TkkvjQTftviQA1B/btvy1QHnxvQ=" }, "http-parser-js": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.6.tgz", - "integrity": "sha1-GVJz9YcExFLWcQdr4gEyndNB3FU=" + "version": "0.4.9", + "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.9.tgz", + "integrity": "sha1-6hoE+2St/wJC6ZdPKX3Uw8rSceE=" }, "permessage-deflate": { "version": "0.1.6", @@ -17,14 +17,14 @@ "integrity": "sha1-WB8c7fvUQPrEfQd3vohjM4a5kt4=" }, "sockjs": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.18.tgz", - "integrity": "sha1-2bKJMWyn33dZXvKZ4HXw+TfrQgc=" + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.19.tgz", + "integrity": "sha512-V48klKZl8T6MzatbLlzzRNhMepEys9Y4oGFpypBFFn1gLI/QQ9HtLLyWJNbPlwGLelOVOEijUbTTJeLLI59jLw==" }, "uuid": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz", - "integrity": "sha1-Z+LoY3lyFVMN/zGOW/nc6/1Hsho=" + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", + "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==" }, "websocket-driver": { "version": "0.7.0", From fa80c17c0e014d49d992056c8306df4c26e00fd7 Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Wed, 8 Nov 2017 14:01:32 -0500 Subject: [PATCH 09/12] Bump ddp-server package version to 2.1.1. --- packages/ddp-server/package.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ddp-server/package.js b/packages/ddp-server/package.js index 0d1cb508b9..de09ed3af1 100644 --- a/packages/ddp-server/package.js +++ b/packages/ddp-server/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: "Meteor's latency-compensated distributed data server", - version: '2.1.0', + version: '2.1.1', documentation: null }); From 84dd4d4ed373ed171f11645cd24466e13a0b6143 Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Wed, 8 Nov 2017 14:22:24 -0500 Subject: [PATCH 10/12] Bump minimongo package version to 1.4.1. --- packages/minimongo/minimongo_tests_client.js | 8 ++++---- packages/minimongo/package.js | 2 +- packages/minimongo/sorter.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/minimongo/minimongo_tests_client.js b/packages/minimongo/minimongo_tests_client.js index 9e32f3e89b..a032782a67 100644 --- a/packages/minimongo/minimongo_tests_client.js +++ b/packages/minimongo/minimongo_tests_client.js @@ -2079,7 +2079,7 @@ Tinytest.add('minimongo - sort', test => { for (let i = 0; i < 50; i++) { for (let j = 0; j < 2; j++) {c.insert({a: i, b: j, _id: `${i}_${j}`});} } - + test.equal(c.find(null, {sort: {b: -1, a: 1}, limit: 5}).fetch(), []); test.equal(c.find(undefined, {sort: {b: -1, a: 1}, limit: 5}).fetch(), []); test.equal(c.find(false, {sort: {b: -1, a: 1}, limit: 5}).fetch(), []); @@ -3029,7 +3029,7 @@ Tinytest.add('minimongo - modify', test => { // Test for https://github.com/meteor/meteor/issues/9167 upsert({key: 123, keyName: '321'}, {$set: {name: 'Todo'}}, {key: 123, keyName: '321', name: 'Todo'}); upsertException({key: 123, "key.name": '321'}, {$set:{}}); - + // Nested fields don't work with literal objects upsertException({"a": {}, "a.b": "foo"}, {}); // You can't have an ambiguious ID @@ -3799,13 +3799,13 @@ Tinytest.add('minimongo - reactive skip/limit count while updating', test => { Tracker.flush({_throwFirstError: true}); test.equal(count, 1); test.equal(unlimitedCount, 2); - + // Make sure a second update also works X.update({}, {$set: {foo: 2}}); Tracker.flush({_throwFirstError: true}); test.equal(count, 1); test.equal(unlimitedCount, 2); - + c.stop(); }); diff --git a/packages/minimongo/package.js b/packages/minimongo/package.js index c7c4d10e17..37dc9b1ba6 100644 --- a/packages/minimongo/package.js +++ b/packages/minimongo/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: "Meteor's client-side datastore: a port of MongoDB to Javascript", - version: '1.4.0' + version: '1.4.1' }); Package.onUse(api => { diff --git a/packages/minimongo/sorter.js b/packages/minimongo/sorter.js index 20ebe61caa..baf74fe427 100644 --- a/packages/minimongo/sorter.js +++ b/packages/minimongo/sorter.js @@ -353,7 +353,7 @@ export default class Sorter { } const selector = matcher._selector; - + // If the user just passed a falsey selector to find(), // then we can't get a key filter from it. if (!selector) { From 35bc8f0c1515d19a09ea9ced88fcdd141a1a6c10 Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Wed, 8 Nov 2017 14:30:43 -0500 Subject: [PATCH 11/12] Bump boilerplate-generator package versions. --- packages/boilerplate-generator-tests/package.js | 2 +- packages/boilerplate-generator/package.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/boilerplate-generator-tests/package.js b/packages/boilerplate-generator-tests/package.js index ade4c13729..f3a2fb339d 100644 --- a/packages/boilerplate-generator-tests/package.js +++ b/packages/boilerplate-generator-tests/package.js @@ -2,7 +2,7 @@ Package.describe({ // These tests are in a separate package so that we can Npm.depend on // parse5, a html parsing library. summary: "Tests for the boilerplate-generator package", - version: '1.1.0', + version: '1.1.1', documentation: null }); diff --git a/packages/boilerplate-generator/package.js b/packages/boilerplate-generator/package.js index cfd931a156..bd2710ccc0 100644 --- a/packages/boilerplate-generator/package.js +++ b/packages/boilerplate-generator/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: "Generates the boilerplate html from program's manifest", - version: '1.3.0' + version: '1.3.1' }); Package.onUse(api => { From a39f502d2c4dbcfe66b5e3f67874d73ed92b10db Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Wed, 8 Nov 2017 13:00:05 -0500 Subject: [PATCH 12/12] Define addSource and addMissing dynamic-import helper functions. --- packages/dynamic-import/client.js | 19 ++++++++++++------- packages/dynamic-import/package.js | 2 +- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/packages/dynamic-import/client.js b/packages/dynamic-import/client.js index 6b6f0db96a..2be3d7fa2c 100644 --- a/packages/dynamic-import/client.js +++ b/packages/dynamic-import/client.js @@ -20,12 +20,20 @@ meteorInstall.fetch = function (ids) { var dynamicVersions = require("./dynamic-versions.js"); var missing; + function addSource(id, source) { + addToTree(tree, id, makeModuleFunction(id, source, ids[id].options)); + } + + function addMissing(id) { + addToTree(missing = missing || Object.create(null), id, 1); + } + Object.keys(ids).forEach(function (id) { var version = dynamicVersions.get(id); if (version) { versions[id] = version; } else { - addToTree(missing = missing || Object.create(null), id, 1); + addMissing(id); } }); @@ -33,10 +41,9 @@ meteorInstall.fetch = function (ids) { Object.keys(sources).forEach(function (id) { var source = sources[id]; if (source) { - var info = ids[id]; - addToTree(tree, id, makeModuleFunction(id, source, info.options)); + addSource(id, source); } else { - addToTree(missing = missing || Object.create(null), id, 1); + addMissing(id); } }); @@ -46,9 +53,7 @@ meteorInstall.fetch = function (ids) { Object.keys(flatResults).forEach(function (id) { var source = flatResults[id]; - var info = ids[id]; - - addToTree(tree, id, makeModuleFunction(id, source, info.options)); + addSource(id, source); var version = dynamicVersions.get(id); if (version) { diff --git a/packages/dynamic-import/package.js b/packages/dynamic-import/package.js index 2f416954fe..f23cabe351 100644 --- a/packages/dynamic-import/package.js +++ b/packages/dynamic-import/package.js @@ -1,6 +1,6 @@ Package.describe({ name: "dynamic-import", - version: "0.2.0", + version: "0.2.1", summary: "Runtime support for Meteor 1.5 dynamic import(...) syntax", documentation: "README.md" });