Skip to content

chore: upgrade to TypeScript 3.5 #2996

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

Merged
merged 1 commit into from
May 30, 2019
Merged

chore: upgrade to TypeScript 3.5 #2996

merged 1 commit into from
May 30, 2019

Conversation

raymondfeng
Copy link
Contributor

@raymondfeng raymondfeng commented May 30, 2019

Upgrade to TypeScript 3.5

I have to address a few breaking changes:

  1. 3.5.1 (regression): "string cannot be used to index T" where T is Record<string, any> microsoft/TypeScript#31661
  2. Generic type is default to unknown instead of {} now.

Checklist

👉 Read and sign the CLA (Contributor License Agreement) 👈

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

👉 Check out how to submit a PR 👈

Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

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

LGTM

(EDITED) Please make sure the build is passing before merging.

@@ -98,7 +101,7 @@ describe('TodoController', () => {

describe('patch()', () => {
it('returns a number of todos updated', async () => {
patch.resolves([aChangedTodo].length);
patch.resolves({count: [aChangedTodo].length});
Copy link
Member

Choose a reason for hiding this comment

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

Nice! IIUC, the stricter type checks are detecting programming errors we were not aware of 👍

@@ -100,7 +100,7 @@ describe('TodoController', () => {

it('uses the provided filter', async () => {
const find = todoRepo.stubs.find;
const filter: Filter = {where: {isCompleted: false}};
const filter: Filter<Todo> = {where: {isComplete: false}};
Copy link
Member

Choose a reason for hiding this comment

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

Nice! 👍

@bajtos
Copy link
Member

bajtos commented May 30, 2019

Fixed the problems in d92f661

@bajtos
Copy link
Member

bajtos commented May 30, 2019

Rebased on top of the latest master, squashed the commits into a single one and force-pushed into the feature branch. Let's wait for CI results before landing.

@bajtos bajtos merged commit 0ec2266 into master May 30, 2019
@bajtos bajtos deleted the ts-3.5 branch May 30, 2019 12:12
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