diff --git a/build/resources/asar-ordering-hint.txt b/build/resources/asar-ordering-hint.txt index 01f4cb439..cd445a943 100644 --- a/build/resources/asar-ordering-hint.txt +++ b/build/resources/asar-ordering-hint.txt @@ -104,9 +104,6 @@ 2378208: node_modules/event-kit/lib/event-kit.js 2378397: node_modules/event-kit/lib/emitter.js 2382101: node_modules/event-kit/lib/disposable.js -2383052: node_modules/grim/package.json -2384904: node_modules/grim/lib/grim.js -2389703: node_modules/grim/lib/deprecation.js 2394595: node_modules/event-kit/lib/composite-disposable.js 2441735: node_modules/pathwatcher/package.json 2444020: node_modules/pathwatcher/lib/main.js @@ -366,7 +363,6 @@ 3049187: node_modules/babel-core/package.json 2901212: node_modules/bluebird/js/main/bluebird.js 2926597: node_modules/bluebird/js/main/util.js -2384904: node_modules/grim/lib/grim.js 1973294: src/compile-cache.js 2266273: node_modules/emissary/lib/emissary.js 2266555: node_modules/emissary/lib/helpers.js @@ -378,7 +374,6 @@ 2290574: node_modules/emissary/node_modules/underscore-plus/node_modules/underscore/underscore.js 2901212: node_modules/bluebird/js/main/bluebird.js 2926597: node_modules/bluebird/js/main/util.js -2384904: node_modules/grim/lib/grim.js 2266273: node_modules/emissary/lib/emissary.js 3052709: src/window.js 2266555: node_modules/emissary/lib/helpers.js @@ -391,13 +386,11 @@ 2343179: node_modules/emissary/lib/signal.js 2352520: node_modules/emissary/lib/emitter.js 2370863: node_modules/emissary/lib/subscriber.js -2384904: node_modules/grim/lib/grim.js 2374948: node_modules/emissary/lib/subscription.js 2266273: node_modules/emissary/lib/emissary.js 2266555: node_modules/emissary/lib/helpers.js 2268129: node_modules/emissary/lib/behavior.js 2274072: node_modules/emissary/node_modules/underscore-plus/lib/underscore-plus.js -2389703: node_modules/grim/lib/deprecation.js 2378208: node_modules/event-kit/lib/event-kit.js 2337929: node_modules/property-accessors/lib/property-accessors.js 2378397: node_modules/event-kit/lib/emitter.js @@ -411,7 +404,6 @@ 3093983: src/window-event-handler.js 2370863: node_modules/emissary/lib/subscriber.js 2374948: node_modules/emissary/lib/subscription.js -2389703: node_modules/grim/lib/deprecation.js 2378208: node_modules/event-kit/lib/event-kit.js 2337929: node_modules/property-accessors/lib/property-accessors.js 3106501: src/styles-element.js @@ -431,7 +423,6 @@ 8174990: node_modules/moment-timezone/package.json 8177056: node_modules/moment-timezone/index.js 8177170: node_modules/moment-timezone/moment-timezone.js -2389703: node_modules/grim/lib/deprecation.js 2378208: node_modules/event-kit/lib/event-kit.js 2378397: node_modules/event-kit/lib/emitter.js 3974612: node_modules/moment/moment.js @@ -3406,8 +3397,6 @@ 2113947: node_modules/source-map-support/node_modules/source-map/lib/source-map/binary-search.js 2117157: node_modules/source-map-support/node_modules/source-map/lib/source-map/source-node.js 94911340: src/task-bootstrap.js -2383052: node_modules/grim/package.json -2384904: node_modules/grim/lib/grim.js 2264399: node_modules/emissary/package.json 2266273: node_modules/emissary/lib/emissary.js 2266555: node_modules/emissary/lib/helpers.js @@ -3426,7 +3415,6 @@ 2369463: node_modules/emissary/node_modules/mixto/lib/mixin.js 2370863: node_modules/emissary/lib/subscriber.js 2374948: node_modules/emissary/lib/subscription.js -2389703: node_modules/grim/lib/deprecation.js 4222287: node_modules/request/package.json 4225420: node_modules/request/index.js 80790165: node_modules/request/node_modules/extend/package.json @@ -3637,8 +3625,6 @@ 2113947: node_modules/source-map-support/node_modules/source-map/lib/source-map/binary-search.js 2117157: node_modules/source-map-support/node_modules/source-map/lib/source-map/source-node.js 94911340: src/task-bootstrap.js -2383052: node_modules/grim/package.json -2384904: node_modules/grim/lib/grim.js 2264399: node_modules/emissary/package.json 2266273: node_modules/emissary/lib/emissary.js 2266555: node_modules/emissary/lib/helpers.js @@ -3657,7 +3643,6 @@ 2369463: node_modules/emissary/node_modules/mixto/lib/mixin.js 2370863: node_modules/emissary/lib/subscriber.js 2374948: node_modules/emissary/lib/subscription.js -2389703: node_modules/grim/lib/deprecation.js 4222287: node_modules/request/package.json 4225420: node_modules/request/index.js 80790165: node_modules/request/node_modules/extend/package.json diff --git a/flow-typed/npm/grim_vx.x.x.js b/flow-typed/npm/grim_vx.x.x.js deleted file mode 100644 index 349351e28..000000000 --- a/flow-typed/npm/grim_vx.x.x.js +++ /dev/null @@ -1,39 +0,0 @@ -// flow-typed signature: bce98455de45f73d9b600f93ed7e6827 -// flow-typed version: <>/grim_v1.5.0/flow_v0.33.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'grim' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'grim' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'grim/lib/deprecation' { - declare module.exports: any; -} - -declare module 'grim/lib/grim' { - declare module.exports: any; -} - -// Filename aliases -declare module 'grim/lib/deprecation.js' { - declare module.exports: $Exports<'grim/lib/deprecation'>; -} -declare module 'grim/lib/grim.js' { - declare module.exports: $Exports<'grim/lib/grim'>; -} diff --git a/package.json b/package.json index dda7c1a01..e900fd988 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,6 @@ "event-kit": "^1.0.2", "flow-bin": "0.33.0", "fs-plus": "^2.3.2", - "grim": "1.5.0", "guid": "0.0.10", "immutable": "3.7.5", "jasmine-json": "~0.0", diff --git a/spec/n1-spec-runner/master-before-each.es6 b/spec/n1-spec-runner/master-before-each.es6 index 965170b61..c38f77522 100644 --- a/spec/n1-spec-runner/master-before-each.es6 +++ b/spec/n1-spec-runner/master-before-each.es6 @@ -8,7 +8,6 @@ import { FocusedPerspectiveStore, } from 'nylas-exports'; import fs from 'fs-plus'; -import Grim from 'grim'; import {clipboard} from 'electron'; import pathwatcher from 'pathwatcher'; @@ -56,9 +55,6 @@ class MasterBeforeEach { FocusedPerspectiveStore._current = MailboxPerspective.forNothing(); - const isCoreSpec = this.loadSettings.specDirectory === fs.realpathSync(__dirname); - if (isCoreSpec) { Grim.clearDeprecations(); } - spyOn(pathwatcher.File.prototype, "detectResurrectionAfterDelay").andCallFake(function detectResurrection() { return this.detectResurrection(); }); diff --git a/spec/n1-spec-runner/n1-gui-reporter.cjsx b/spec/n1-spec-runner/n1-gui-reporter.cjsx index 5c1349915..f6ef671fa 100644 --- a/spec/n1-spec-runner/n1-gui-reporter.cjsx +++ b/spec/n1-spec-runner/n1-gui-reporter.cjsx @@ -4,7 +4,6 @@ _str = require 'underscore.string' {convertStackTrace} = require 'coffeestack' React = require 'react' ReactDOM = require 'react-dom' -grim = require 'grim' marked = require 'marked' sourceMaps = {} @@ -82,7 +81,6 @@ class N1GuiReporter extends React.Component
{@_renderFailures()}
- {@_renderDeprecations()}
{@props.plainTextOutput}
@@ -125,42 +123,6 @@ class N1GuiReporter extends React.Component topLevelSuites.map (suite, idx) => - _renderDeprecations: => - return if @props.deprecations.length is 0 - - if @props.deprecations.length is 1 - label = "1 deprecation" - else - label = "#{@props.deprecations.length} deprecations" - -
- {label} -
-
- {@_renderDeprecationList()} -
-
-
- - _renderDeprecationList: => - @props.deprecations.map (deprecation) => -
-
- {deprecation.message} - { - deprecation.getStacks().map (stack) => - fullStack = stack.map ({functionName, location}) -> - if functionName is '' - " at #{location}" - else - " at #{functionName} (#{location})" -
-                {formatStackTrace(deprecation.spec, deprecation.message, fullStack.join('\n'))}
-              
- } -
-
- _renderStatus: => failedCount = 0 skippedCount = 0 @@ -258,14 +220,12 @@ document.body.appendChild(el) startedAt = null specs = [] -deprecations = [] plainTextOutput = "" update = => component = ReactDOM.render(component, el) @@ -284,10 +244,6 @@ module.exports = reportSpecResults: (spec) -> spec.endedAt = Date.now() - specDeprecations = grim.getDeprecations() - d.spec = spec for d in specDeprecations - deprecations = deprecations.concat(specDeprecations) - grim.clearDeprecations() updateSoon() reportPlainTextSpecResult: (spec) -> diff --git a/spec/n1-spec-runner/n1-spec-runner.es6 b/spec/n1-spec-runner/n1-spec-runner.es6 index 51e0463c9..219d0b530 100644 --- a/spec/n1-spec-runner/n1-spec-runner.es6 +++ b/spec/n1-spec-runner/n1-spec-runner.es6 @@ -1,6 +1,5 @@ /* eslint global-require:0 */ import _ from 'underscore'; -import Grim from 'grim'; import ReactTestUtils from 'react-addons-test-utils'; import Config from '../../src/config' @@ -143,15 +142,6 @@ class N1SpecRunner { } return origEmitObject.call(this, obj); }; - - let deprecationsSnapshot = null; - jasmine.snapshotDeprecations = () => { - deprecationsSnapshot = Object.assign({}, Grim.deprecations); - } - - jasmine.restoreDeprecationsSnapshot = () => { - Grim.deprecations = deprecationsSnapshot - }; } } export default new N1SpecRunner() diff --git a/spec/package-manager-spec.coffee b/spec/package-manager-spec.coffee index 2c9dfdb71..4da8652f6 100644 --- a/spec/package-manager-spec.coffee +++ b/spec/package-manager-spec.coffee @@ -143,24 +143,6 @@ describe "PackageManager", -> expect(NylasEnv.config.set('package-with-config-schema.numbers.one', '10')).toBe true expect(NylasEnv.config.get('package-with-config-schema.numbers.one')).toBe 10 - describe "when a package has configDefaults", -> - beforeEach -> - jasmine.snapshotDeprecations() - - afterEach -> - jasmine.restoreDeprecationsSnapshot() - - # it "still assigns configDefaults from the module though deprecated", -> - # - # expect(NylasEnv.config.get('package-with-config-defaults.numbers.one')).toBeUndefined() - # - # waitsForPromise -> - # NylasEnv.packages.activatePackage('package-with-config-defaults') - # - # runs -> - # expect(NylasEnv.config.get('package-with-config-defaults.numbers.one')).toBe 1 - # expect(NylasEnv.config.get('package-with-config-defaults.numbers.two')).toBe 2 - describe "when the package has no main module", -> it "does not throw an exception", -> spyOn(console, "error") @@ -472,7 +454,6 @@ describe "PackageManager", -> describe "::activate()", -> beforeEach -> - jasmine.snapshotDeprecations() spyOn(console, 'warn') spyOn(console, "error") NylasEnv.packages.loadPackages() @@ -483,7 +464,6 @@ describe "PackageManager", -> afterEach -> NylasEnv.packages.deactivatePackages() NylasEnv.packages.unloadPackages() - jasmine.restoreDeprecationsSnapshot() it "activates all the packages, and none of the themes", -> packageActivator = spyOn(NylasEnv.packages, 'activatePackages') diff --git a/spec/themes/theme-manager-spec.coffee b/spec/themes/theme-manager-spec.coffee index f0569e198..f45f0b61c 100644 --- a/spec/themes/theme-manager-spec.coffee +++ b/spec/themes/theme-manager-spec.coffee @@ -32,12 +32,8 @@ describe "ThemeManager", -> describe "theme getters and setters", -> beforeEach -> - jasmine.snapshotDeprecations() NylasEnv.packages.loadPackages() - afterEach -> - jasmine.restoreDeprecationsSnapshot() - it 'getLoadedThemes get all the loaded themes', -> themes = themeManager.getLoadedThemes() expect(themes.length).toEqual(2) @@ -169,11 +165,7 @@ describe "ThemeManager", -> expect(console.warn.argsForCall[0][0]).toContain "Could not resolve 'a-theme-that-will-not-be-found'" describe "::requireStylesheet(path)", -> - beforeEach -> - jasmine.snapshotDeprecations() - afterEach -> - jasmine.restoreDeprecationsSnapshot() themeManager.removeStylesheet(path.join(__dirname, '..', 'fixtures', 'css.css')) themeManager.removeStylesheet(path.join(__dirname, '..', 'fixtures', 'sample.less')) diff --git a/src/compile-cache.js b/src/compile-cache.js index 71343a72b..2c4c6ea2c 100644 --- a/src/compile-cache.js +++ b/src/compile-cache.js @@ -174,27 +174,6 @@ require('source-map-support').install({ } }) -var sourceMapPrepareStackTrace = Error.prepareStackTrace -var prepareStackTrace = sourceMapPrepareStackTrace - -// Prevent coffee-script from reassigning Error.prepareStackTrace -Object.defineProperty(Error, 'prepareStackTrace', { - get: function () { return prepareStackTrace }, - set: function (newValue) {} -}) - -// Enable Grim to access the raw stack without reassigning Error.prepareStackTrace -Error.prototype.getRawStack = function () { // eslint-disable-line no-extend-native - prepareStackTrace = getRawStack - var result = this.stack - prepareStackTrace = sourceMapPrepareStackTrace - return result -} - -function getRawStack (_, stack) { - return stack -} - Object.keys(COMPILERS).forEach(function (extension) { var compiler = COMPILERS[extension] diff --git a/src/nylas-env.coffee b/src/nylas-env.coffee index d6106d803..ea59b42c4 100644 --- a/src/nylas-env.coffee +++ b/src/nylas-env.coffee @@ -5,7 +5,6 @@ path = require 'path' {ipcRenderer, remote, shell} = require 'electron' _ = require 'underscore' -{deprecate} = require 'grim' {Emitter} = require 'event-kit' fs = require 'fs-plus' {convertStackTrace, convertLine} = require 'coffeestack' @@ -132,12 +131,6 @@ class NylasEnvConstructor # # Call after this instance has been assigned to the `NylasEnv` global. initialize: -> - # Disable deprecations unless in dev mode or spec mode so that regular - # editor performance isn't impacted by generating stack traces for - # deprecated calls. - unless @inDevMode() or @inSpecMode() - require('grim').deprecate = -> - @enhanceEventObject() @setupErrorLogger() diff --git a/src/package.coffee b/src/package.coffee index 353bcb58d..e84f17f66 100644 --- a/src/package.coffee +++ b/src/package.coffee @@ -6,7 +6,6 @@ fs = require 'fs-plus' EmitterMixin = require('emissary').Emitter {Emitter, CompositeDisposable} = require 'event-kit' Q = require 'q' -{deprecate} = require 'grim' ModuleCache = require './module-cache' @@ -46,7 +45,6 @@ class Package metadata.name = packageName if metadata.stylesheets? - deprecate("Use the `styleSheets` key instead of `stylesheets` in the `package.json` of `#{packageName}`", {packageName}) metadata.styleSheets = metadata.stylesheets metadata @@ -253,7 +251,6 @@ class Package getStylesheetsPath: -> if fs.isDirectorySync(path.join(@path, 'stylesheets')) - deprecate("Store package style sheets in the `styles/` directory instead of `stylesheets/` in the `#{@name}` package", packageName: @name) path.join(@path, 'stylesheets') else path.join(@path, 'styles') diff --git a/src/task-bootstrap.coffee b/src/task-bootstrap.coffee index 8b10bc382..6690e2270 100644 --- a/src/task-bootstrap.coffee +++ b/src/task-bootstrap.coffee @@ -43,14 +43,6 @@ handleEvents = -> result = handler.bind({async})(args...) emit('task:completed', result) unless isAsync -setupDeprecations = -> - Grim = require 'grim' - Grim.on 'updated', -> - deprecations = Grim.getDeprecations().map (deprecation) -> deprecation.serialize() - Grim.clearDeprecations() - emit('task:deprecations', deprecations) - setupGlobals() handleEvents() -setupDeprecations() handler = require(taskPath) diff --git a/src/task.coffee b/src/task.coffee index fb48ce5f2..00ea6a6db 100644 --- a/src/task.coffee +++ b/src/task.coffee @@ -1,7 +1,6 @@ _ = require 'underscore' ChildProcess = require 'child_process' {Emitter} = require 'event-kit' -Grim = require 'grim' # Extended: Run a node script in a separate process. # @@ -84,9 +83,6 @@ class Task @on "task:log", -> console.log(arguments...) @on "task:warn", -> console.warn(arguments...) @on "task:error", -> console.error(arguments...) - @on "task:deprecations", (deprecations) -> - Grim.addSerializedDeprecation(deprecation) for deprecation in deprecations - return @on "task:completed", (args...) => @callback?(args...) @handleEvents()