rm(grim): We’re not using Grim for deprecations

This commit is contained in:
Ben Gotow 2016-10-25 11:35:43 -07:00
parent 55bf203596
commit ded52ce101
13 changed files with 0 additions and 184 deletions

View file

@ -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

View file

@ -1,39 +0,0 @@
// flow-typed signature: bce98455de45f73d9b600f93ed7e6827
// flow-typed version: <<STUB>>/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'>;
}

View file

@ -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",

View file

@ -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();
});

View file

@ -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
<div className="results">
{@_renderFailures()}
</div>
{@_renderDeprecations()}
<div className="plain-text-output">
{@props.plainTextOutput}
</div>
@ -125,42 +123,6 @@ class N1GuiReporter extends React.Component
topLevelSuites.map (suite, idx) =>
<SuiteResultView suite={suite} key={idx} allSpecs={failedSpecs} />
_renderDeprecations: =>
return if @props.deprecations.length is 0
if @props.deprecations.length is 1
label = "1 deprecation"
else
label = "#{@props.deprecations.length} deprecations"
<div className="status alert alert-warning">
<span>{label}</span>
<div className="deprecation-toggle">
<div className="deprecation-list">
{@_renderDeprecationList()}
</div>
</div>
</div>
_renderDeprecationList: =>
@props.deprecations.map (deprecation) =>
<div className="padded" key={deprecation.message}>
<div className="result-message fail deprecation-message">
{deprecation.message}
{
deprecation.getStacks().map (stack) =>
fullStack = stack.map ({functionName, location}) ->
if functionName is '<unknown>'
" at #{location}"
else
" at #{functionName} (#{location})"
<pre className="stack-trace padded">
{formatStackTrace(deprecation.spec, deprecation.message, fullStack.join('\n'))}
</pre>
}
</div>
</div>
_renderStatus: =>
failedCount = 0
skippedCount = 0
@ -258,14 +220,12 @@ document.body.appendChild(el)
startedAt = null
specs = []
deprecations = []
plainTextOutput = ""
update = =>
component = <N1GuiReporter
startedAt={startedAt}
specs={specs}
deprecations={deprecations}
/>
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) ->

View file

@ -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()

View file

@ -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')

View file

@ -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'))

View file

@ -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]

View file

@ -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()

View file

@ -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')

View file

@ -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)

View file

@ -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()