Skip to content

Update to typescript 3.6.3#19190

Merged
chrisnojima merged 12 commits intomasterfrom
nojima/HOTPOT-ts-36
Sep 11, 2019
Merged

Update to typescript 3.6.3#19190
chrisnojima merged 12 commits intomasterfrom
nojima/HOTPOT-ts-36

Conversation

@chrisnojima
Copy link
Copy Markdown
Contributor

@chrisnojima chrisnojima commented Aug 29, 2019

Updates TS

)
}

yield* Saga.callRPCs(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i simplified / removed some utils from Saga. This was to help us with a flow issue but isn't necessary

const fileName = yield* downloadAttachment('', message)
try {
yield* Saga.callPromise(showShareActionSheetFromFile, fileName, message.fileType)
yield showShareActionSheetFromFile(fileName)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

note: TS caught the extra param here now

if (pathItem.type === Types.PathType.File) {
const mimeType = yield* _loadMimeType(path)
pathItem = pathItem.set('mimeType', mimeType)
pathItem = pathItem.set('mimeType', mimeType || null)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

correctly infers this can be undefined, which pathItem doesn't want

Comment thread shared/actions/people.tsx
.reduce(Constants.reduceRPCItemToPeopleItem, I.List())

if (debugTodo) {
const allTodos: Array<RPCTypes.HomeScreenTodoType> = Object.values(RPCTypes.HomeScreenTodoType)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

values is actually a mix of the numbers and the strings, so we need to be more explicit

@chrisnojima chrisnojima changed the title WIP ts 36 Update to typescript 3.6.2 Aug 30, 2019
@chrisnojima
Copy link
Copy Markdown
Contributor Author

@chrisnojima
Copy link
Copy Markdown
Contributor Author

Ts should have the fix in 363 microsoft/TypeScript#33168

@chrisnojima chrisnojima changed the title Update to typescript 3.6.2 Blocked: Update to typescript 3.6.2 Sep 3, 2019
@chrisnojima chrisnojima marked this pull request as ready for review September 3, 2019 13:54
@chrisnojima chrisnojima requested a review from a team September 3, 2019 13:54
@chrisnojima
Copy link
Copy Markdown
Contributor Author

@keybase/react-hackers this updates TS to 3.6 which will allow us to better type generators (etc). this is blocked on a perf regression w/ incremental builds which has been fixed but not deployed but our code can be reviewed in the meantime

import * as Router2Constants from '../constants/router2'
import HiddenString from '../util/hidden-string'
import logger from '../logger'
import _logger from '../logger'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this is because i have eslint warning us on variable shadowing. honestly most cases of _logger should likely go away and use the better saga logger instead

): I.List<Types.Ordinal> => {
if (direction === 'prepend') {
const oldStart = ordinals.size ? Types.ordinalToNumber(ordinals.first()) : firstOrdinal
const oldStart = ordinals.size ? Types.ordinalToNumber(ordinals.first() as Types.Ordinal) : firstOrdinal
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this working around a bug or ignoring the fact that ordinals could be empty?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

TS doesn't understand that checking size means first() is non null

@chrisnojima chrisnojima changed the title Blocked: Update to typescript 3.6.2 Update to typescript 3.6.3 Sep 11, 2019
@chrisnojima
Copy link
Copy Markdown
Contributor Author

@keybase/react-hackers bump. previously approved but did a small merge master / updated to 3.6.3

@chrisnojima chrisnojima merged commit 1168c9a into master Sep 11, 2019
@chrisnojima chrisnojima deleted the nojima/HOTPOT-ts-36 branch September 11, 2019 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants