diff --git a/History.md b/History.md index 30f6a8cfee..d5cbe6477c 100644 --- a/History.md +++ b/History.md @@ -6,6 +6,17 @@ several new features, including two-factor authentication, as described in the [release notes](https://github.com/npm/npm/blob/latest/CHANGELOG.md#v551-2017-10-04). +* [`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) @@ -25,6 +36,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)). diff --git a/packages/boilerplate-generator-tests/package.js b/packages/boilerplate-generator-tests/package.js index 574df6f83e..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 }); @@ -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/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", diff --git a/packages/ddp-server/package.js b/packages/ddp-server/package.js index bbd3c4fa3b..de09ed3af1 100644 --- a/packages/ddp-server/package.js +++ b/packages/ddp-server/package.js @@ -1,12 +1,12 @@ Package.describe({ summary: "Meteor's latency-compensated distributed data server", - version: '2.1.0', + version: '2.1.1', documentation: null }); Npm.depends({ "permessage-deflate": "0.1.6", - sockjs: "0.3.18" + sockjs: "0.3.19" }); Package.onUse(function (api) { 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" }); 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) { 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/packages/minimongo/minimongo_tests_client.js b/packages/minimongo/minimongo_tests_client.js index 3fbdaad7ab..a032782a67 100644 --- a/packages/minimongo/minimongo_tests_client.js +++ b/packages/minimongo/minimongo_tests_client.js @@ -2080,6 +2080,10 @@ Tinytest.add('minimongo - sort', test => { 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(), [ {a: 11, b: 1, _id: '11_1'}, @@ -3025,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 @@ -3795,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 a98f0ff997..baf74fe427 100644 --- a/packages/minimongo/sorter.js +++ b/packages/minimongo/sorter.js @@ -354,6 +354,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. if (selector instanceof Function) { 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 } } ); diff --git a/scripts/dev-bundle-tool-package.js b/scripts/dev-bundle-tool-package.js index 580e76361d..efbe0c8621 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", diff --git a/tools/isobuild/compiler-plugin.js b/tools/isobuild/compiler-plugin.js index 7854ced001..0297723b05 100644 --- a/tools/isobuild/compiler-plugin.js +++ b/tools/isobuild/compiler-plugin.js @@ -1300,7 +1300,6 @@ export class PackageSourceBatch { imports: self.importedSymbolToPackageName, // XXX report an error if there is a package called global-imports 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 899c907ac1..c73bdf01a0 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) { @@ -1098,7 +1013,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(); @@ -1107,7 +1021,6 @@ export var fullLink = Profile("linker.fullLink", function (inputFiles, { meteorInstallOptions, useGlobalNamespace: isApp, combinedServePath, - noLineNumbers }); _.each(inputFiles, file => module.addFile(file));