New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

☠☕ Decaffeinate `src/theme-manager.coffee` #16025

Merged
merged 2 commits into from Nov 1, 2017

Conversation

Projects
None yet
2 participants
@jasonrudolph
Member

jasonrudolph commented Oct 30, 2017

This change converts src/theme-manager.coffee to JavaScript with standard style.

jasonrudolph added some commits Oct 29, 2017

this.configDirPath = configDirPath
this.safeMode = safeMode
this.lessSourcesByRelativeFilePath = null
if (devMode || (typeof snapshotAuxiliaryData === 'undefined')) {

This comment has been minimized.

@jasonrudolph

jasonrudolph Oct 30, 2017

Member

@as-cii: The linter was complaining about snapshotAuxiliaryData not being defined. c06745f tells the linter that snapshotAuxiliaryData is a global variable, and that suppresses the linter error. Given your work in this area of the code in 4c6805b, does this seem like a reasonable approach to dealing with the linter error?

@jasonrudolph

jasonrudolph Oct 30, 2017

Member

@as-cii: The linter was complaining about snapshotAuxiliaryData not being defined. c06745f tells the linter that snapshotAuxiliaryData is a global variable, and that suppresses the linter error. Given your work in this area of the code in 4c6805b, does this seem like a reasonable approach to dealing with the linter error?

This comment has been minimized.

@as-cii

as-cii Oct 31, 2017

Member

Yep, that looks good! Another approach would be to move that global into package.json, where I believe we define other globals not recognized by the linter.

@as-cii

as-cii Oct 31, 2017

Member

Yep, that looks good! Another approach would be to move that global into package.json, where I believe we define other globals not recognized by the linter.

This comment has been minimized.

@jasonrudolph

jasonrudolph Oct 31, 2017

Member

Another approach would be to move that global into package.json, where I believe we define other globals not recognized by the linter.

Thanks, @as-cii. Based on the search below, it looks like snapshotAuxiliaryData is only referenced as a global in this one file, so I'll whitelist it just in this file. Thanks for the help! 🙇

$ ag snapshotAuxiliaryData
script/config.js
40:  snapshotAuxiliaryData: {}

script/lib/prebuild-less-cache.js
32:  CONFIG.snapshotAuxiliaryData.lessSourcesByRelativeFilePath = {}
35:    if (!CONFIG.snapshotAuxiliaryData.lessSourcesByRelativeFilePath.hasOwnProperty(relativeFilePath)) {
36:      CONFIG.snapshotAuxiliaryData.lessSourcesByRelativeFilePath[relativeFilePath] = {
43:  CONFIG.snapshotAuxiliaryData.importedFilePathsByRelativeImportPath = {}
65:        if (!CONFIG.snapshotAuxiliaryData.importedFilePathsByRelativeImportPath.hasOwnProperty(relativeImportPath)) {
66:          CONFIG.snapshotAuxiliaryData.importedFilePathsByRelativeImportPath[relativeImportPath] = []
68:            CONFIG.snapshotAuxiliaryData.importedFilePathsByRelativeImportPath[relativeImportPath].push(

script/lib/generate-startup-snapshot.js
17:    auxiliaryData: CONFIG.snapshotAuxiliaryData,

src/theme-manager.js
1:/* global snapshotAuxiliaryData */
36:    if (devMode || (typeof snapshotAuxiliaryData === 'undefined')) {
40:      this.lessSourcesByRelativeFilePath = snapshotAuxiliaryData.lessSourcesByRelativeFilePath
41:      this.importedFilePathsByRelativeImportPath = snapshotAuxiliaryData.importedFilePathsByRelativeImportPath
@jasonrudolph

jasonrudolph Oct 31, 2017

Member

Another approach would be to move that global into package.json, where I believe we define other globals not recognized by the linter.

Thanks, @as-cii. Based on the search below, it looks like snapshotAuxiliaryData is only referenced as a global in this one file, so I'll whitelist it just in this file. Thanks for the help! 🙇

$ ag snapshotAuxiliaryData
script/config.js
40:  snapshotAuxiliaryData: {}

script/lib/prebuild-less-cache.js
32:  CONFIG.snapshotAuxiliaryData.lessSourcesByRelativeFilePath = {}
35:    if (!CONFIG.snapshotAuxiliaryData.lessSourcesByRelativeFilePath.hasOwnProperty(relativeFilePath)) {
36:      CONFIG.snapshotAuxiliaryData.lessSourcesByRelativeFilePath[relativeFilePath] = {
43:  CONFIG.snapshotAuxiliaryData.importedFilePathsByRelativeImportPath = {}
65:        if (!CONFIG.snapshotAuxiliaryData.importedFilePathsByRelativeImportPath.hasOwnProperty(relativeImportPath)) {
66:          CONFIG.snapshotAuxiliaryData.importedFilePathsByRelativeImportPath[relativeImportPath] = []
68:            CONFIG.snapshotAuxiliaryData.importedFilePathsByRelativeImportPath[relativeImportPath].push(

script/lib/generate-startup-snapshot.js
17:    auxiliaryData: CONFIG.snapshotAuxiliaryData,

src/theme-manager.js
1:/* global snapshotAuxiliaryData */
36:    if (devMode || (typeof snapshotAuxiliaryData === 'undefined')) {
40:      this.lessSourcesByRelativeFilePath = snapshotAuxiliaryData.lessSourcesByRelativeFilePath
41:      this.importedFilePathsByRelativeImportPath = snapshotAuxiliaryData.importedFilePathsByRelativeImportPath

@jasonrudolph jasonrudolph merged commit 08baeae into master Nov 1, 2017

3 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jasonrudolph jasonrudolph deleted the decaf-theme-manager branch Nov 1, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment