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

Prepare for TS 3.7 upgrade #47683

Merged
merged 1 commit into from
Oct 9, 2019
Merged

Prepare for TS 3.7 upgrade #47683

merged 1 commit into from
Oct 9, 2019

Conversation

timroes
Copy link
Contributor

@timroes timroes commented Oct 9, 2019

Summary

This PR is in preparation for upgrading TypeScript to 3.7 (see #47188).

See the comments inline for an explanation of what's changed. This PR should not change any functionality.

@elasticmachine
Copy link
Contributor

Pinging @elastic/code (Team:Code)

@@ -8,7 +8,7 @@ import { DetailSymbolInformation } from '@elastic/lsp-extension';
import { IRange } from 'monaco-editor';

import { DiffKind } from '../common/git_diff';
import { Repository, SourceHit } from '../model';
import { Repository } from '../model';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ There was a bug in TS that you could import something and have a different export with the same name, which has been fixed in 3.7, why this wouldn't work anymore. In this specific case we can simply remove SourceHit since it was not used in that file at all (but actually just declared later in this file).

@@ -93,7 +93,7 @@ export const search = handleActions<SearchState, SearchPayload>(
{
[String(changeSearchScope)]: (state: SearchState, action: Action<SearchScope>) =>
produce<SearchState>(state, draft => {
if (Object.values(SearchScope).includes(action.payload)) {
if (action.payload && Object.values(SearchScope).includes(action.payload)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ I have honestly no idea why this didn't already fail earlier. Since action.payload can also be undefined, you need to check that it's not undefined before calling includes (at least in 3.7 it's failing now).

@timroes timroes mentioned this pull request Oct 9, 2019
15 tasks
@timroes timroes added the release_note:skip Skip the PR/issue when compiling release notes label Oct 9, 2019
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@timroes timroes merged commit cac2d45 into elastic:master Oct 9, 2019
@timroes timroes deleted the ts-cleanup-code branch October 9, 2019 16:36
timroes pushed a commit to timroes/kibana that referenced this pull request Oct 9, 2019
timroes pushed a commit that referenced this pull request Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes v7.5.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants