Skip to content
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

[internal] Replace var assignments with let in non-ui #6706

Merged
merged 2 commits into from
Mar 31, 2016

Conversation

epixa
Copy link
Contributor

@epixa epixa commented Mar 30, 2016

This change was applied to all directories under src/ except for the ui/
directory. Only .js files were searched.

This was an automatic replacement from var to let for any variable
declaration that doubles as the initial assignment. Ultimately we want
most of these to be converted to const, but this commit is so large that
it warrants breaking each step of automation up into its own commit.

For example:

var foo = 'bar'; becomes let foo = 'var';

This was accomplished by replacing:
find: var ([a-zA-Z_$][0-9a-zA-Z_$]*)(\s+)=
replace: let $1$2=

This change was applied to all directories under src/ except for the ui/
directory. Only .js files were searched.

This was an automatic replacement from var to let for any variable
declaration that doubles as the initial assignment. Ultimately we want
most of these to be converted to const, but this commit is so large that
it warrants breaking each step of automation up into its own commit.

For example:

`var foo = 'bar';` becomes `let foo = 'var';`

This was accomplished by replacing:
find:    `var ([a-zA-Z_$][0-9a-zA-Z_$]*)(\s+)=`
replace: `let $1$2=`
@epixa
Copy link
Contributor Author

epixa commented Mar 30, 2016

I killed that test because there were more important ones waiting in the queue. I'll re-run tests on this later.

@epixa epixa self-assigned this Mar 30, 2016
@spalger
Copy link
Contributor

spalger commented Mar 30, 2016

jenkins, test it

This file is not transpiled, so in order to use es6 features such as
const/let, we need to enable strict mode.
@epixa
Copy link
Contributor Author

epixa commented Mar 30, 2016

Blegh, so there are actually two commits in this pull request. The first is an automated change, as the PR describes, and it includes essentially everything in this PR. The second commit is a single change to a single file that is needed because that file is not transpiled with babel.

It might be easier to review them separately.

The bulk of this change and what the PR title/description is actually describing: 9eee35d
The single file change that is necessary due to an untranspiled file: f3ec776

Normally I'd just squash them, but the main commit is large and was created completely automatically. I figured the separate commits make it easier to review.

@bevacqua
Copy link
Contributor

LGTM 🎉

@bevacqua bevacqua assigned epixa and unassigned bevacqua Mar 31, 2016
@epixa epixa assigned Bargs and unassigned epixa Mar 31, 2016
@Bargs
Copy link
Contributor

Bargs commented Mar 31, 2016

LGTM

@Bargs Bargs assigned epixa and unassigned Bargs Mar 31, 2016
@Bargs Bargs merged commit 354950b into elastic:master Mar 31, 2016
@epixa epixa deleted the letconst-notui branch March 31, 2016 19:11
epixa added a commit that referenced this pull request Apr 1, 2016
---------

**Commit 1:**
[internal] Replace var assignments with let in non-ui

This change was applied to all directories under src/ except for the ui/
directory. Only .js files were searched.

This was an automatic replacement from var to let for any variable
declaration that doubles as the initial assignment. Ultimately we want
most of these to be converted to const, but this commit is so large that
it warrants breaking each step of automation up into its own commit.

For example:

`var foo = 'bar';` becomes `let foo = 'var';`

This was accomplished by replacing:
find:    `var ([a-zA-Z_$][0-9a-zA-Z_$]*)(\s+)=`
replace: `let $1$2=`

* Original sha: 9eee35d
* Authored by Court Ewing <court@epixa.com> on 2016-03-30T17:53:10Z

**Commit 2:**
[internal] use strict in babel_options

This file is not transpiled, so in order to use es6 features such as
const/let, we need to enable strict mode.

* Original sha: f3ec776
* Authored by Court Ewing <court@epixa.com> on 2016-03-30T21:43:10Z
epixa added a commit that referenced this pull request Apr 1, 2016
---------

**Commit 1:**
[internal] Replace var assignments with let in non-ui

This change was applied to all directories under src/ except for the ui/
directory. Only .js files were searched.

This was an automatic replacement from var to let for any variable
declaration that doubles as the initial assignment. Ultimately we want
most of these to be converted to const, but this commit is so large that
it warrants breaking each step of automation up into its own commit.

For example:

`var foo = 'bar';` becomes `let foo = 'var';`

This was accomplished by replacing:
find:    `var ([a-zA-Z_$][0-9a-zA-Z_$]*)(\s+)=`
replace: `let $1$2=`

* Original sha: 9eee35d
* Authored by Court Ewing <court@epixa.com> on 2016-03-30T17:53:10Z

**Commit 2:**
[internal] use strict in babel_options

This file is not transpiled, so in order to use es6 features such as
const/let, we need to enable strict mode.

* Original sha: f3ec776
* Authored by Court Ewing <court@epixa.com> on 2016-03-30T21:43:10Z
epixa added a commit that referenced this pull request Apr 1, 2016
elastic-jasper added a commit that referenced this pull request Apr 1, 2016
---------

**Commit 1:**
[internal] Replace var assignments with let in non-ui

This change was applied to all directories under src/ except for the ui/
directory. Only .js files were searched.

This was an automatic replacement from var to let for any variable
declaration that doubles as the initial assignment. Ultimately we want
most of these to be converted to const, but this commit is so large that
it warrants breaking each step of automation up into its own commit.

For example:

`var foo = 'bar';` becomes `let foo = 'var';`

This was accomplished by replacing:
find:    `var ([a-zA-Z_$][0-9a-zA-Z_$]*)(\s+)=`
replace: `let $1$2=`

* Original sha: 9eee35d
* Authored by Court Ewing <court@epixa.com> on 2016-03-30T17:53:10Z

**Commit 2:**
[internal] use strict in babel_options

This file is not transpiled, so in order to use es6 features such as
const/let, we need to enable strict mode.

* Original sha: f3ec776
* Authored by Court Ewing <court@epixa.com> on 2016-03-30T21:43:10Z
epixa added a commit that referenced this pull request Apr 1, 2016
@epixa epixa added v4.5.2 and removed v4.5.1 labels May 14, 2016
@epixa epixa added v4.5.4 and removed v4.5.2 labels Jul 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants