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

react-native-calendars: Add missing enableSwipeMonths prop #46376

Conversation

jdmunro
Copy link
Contributor

@jdmunro jdmunro commented Jul 27, 2020

Please fill in this template.

A little more explanation for the changes:

  • We cannot simply use CalendarBaseProps for CalendarListBaseProps directly anymore because enableSwipeMonths is not compatible with CalendarList. Therefore I opted to pick the properties we actually want, rather than trying to exclude only the one we don't - it's a bit safer this way for future versions. Happy to reimplement this if other's disagree though 😄

@typescript-bot
Copy link
Contributor

typescript-bot commented Jul 27, 2020

@jdmunro Thank you for submitting this PR!

This is a live comment which I will keep updated.

Code Reviews

Because you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ Most recent commit is approved by type definition owners, DT maintainers or others

All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 46376,
  "author": "jdmunro",
  "owners": [
    "Tyler-Zhang",
    "DavidNorena",
    "FabianMeul"
  ],
  "dangerLevel": "ScopedAndTested",
  "headCommitAbbrOid": "96d7063",
  "headCommitOid": "96d7063b1b6df70a76194ea88d719639adb4ff65",
  "mergeIsRequested": true,
  "stalenessInDays": 0,
  "lastPushDate": "2020-07-28T07:46:45.000Z",
  "lastCommentDate": "2020-07-30T16:20:28.000Z",
  "maintainerBlessed": false,
  "reviewLink": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/46376/files",
  "hasMergeConflict": false,
  "authorIsOwner": false,
  "isFirstContribution": false,
  "popularityLevel": "Well-liked by everyone",
  "anyPackageIsNew": false,
  "packages": [
    "react-native-calendars"
  ],
  "files": [
    {
      "path": "types/react-native-calendars/index.d.ts",
      "kind": "definition",
      "package": "react-native-calendars"
    },
    {
      "path": "types/react-native-calendars/react-native-calendars-tests.tsx",
      "kind": "test",
      "package": "react-native-calendars"
    }
  ],
  "hasDismissedReview": false,
  "ciResult": "pass",
  "lastReviewDate": "2020-07-30T16:18:00.000Z",
  "reviewersWithStaleReviews": [],
  "approvalFlags": 2,
  "isChangesRequested": false
}

@typescript-bot
Copy link
Contributor

🔔 @Tyler-Zhang @DavidNorena @FabianMeul — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@typescript-bot
Copy link
Contributor

👋 Hi there! I’ve run some quick measurements against master and your PR. These metrics should help the humans reviewing this PR gauge whether it might negatively affect compile times or editor responsiveness for users who install these typings.

Let’s review the numbers, shall we?

Comparison details 📊
master #46376 diff
Batch compilation
Memory usage (MiB) 91.5 92.7 +1.4%
Type count 20973 21014 0%
Assignability cache size 4404 4404 0%
Language service
Samples taken 354 355 0%
Identifiers in tests 354 355 0%
getCompletionsAtPosition
    Mean duration (ms) 427.1 439.0 +2.8%
    Mean CV 7.8% 8.0%
    Worst duration (ms) 653.7 638.2 -2.4%
    Worst identifier firstDay monthFormat
getQuickInfoAtPosition
    Mean duration (ms) 421.9 431.3 +2.2%
    Mean CV 8.3% 8.0% -2.9%
    Worst duration (ms) 615.4 657.3 +6.8%
    Worst identifier date style

It looks like nothing changed too much. I won’t post performance data again unless it gets worse.

@typescript-bot typescript-bot added the Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. label Jul 27, 2020
@Tyler-Zhang
Copy link
Contributor

@jdmunro Perhaps it would be cleaner to extend the CalendarProps?

I.e

type CalendarProps = CalendarMarkingProps & CalendarBaseProps & {
    enableSwipeMonths?: boolean;
}

export class Calendar extends React.Component<CalendarProps> { }

@jdmunro jdmunro force-pushed the react-native-calendars/missing-prop branch from 941b00f to 96d7063 Compare July 28, 2020 07:46
@jdmunro
Copy link
Contributor Author

jdmunro commented Jul 28, 2020

Indeed that's much simpler @Tyler-Zhang - I've made the changes thanks!

@jdmunro jdmunro changed the title react-native-calendars: Add missing enableSwipeMonths prop. react-native-calendars: Add missing enableSwipeMonths prop Jul 28, 2020
Copy link
Contributor

@Tyler-Zhang Tyler-Zhang left a comment

Choose a reason for hiding this comment

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

LGTM

@typescript-bot typescript-bot added Owner Approved A listed owner of this package signed off on the pull request. Self Merge This PR can now be self-merged by the PR author or an owner labels Jul 30, 2020
@typescript-bot
Copy link
Contributor

@jdmunro Everything looks good here. Great job! I am ready to merge this PR on your behalf.

If you'd like that to happen, please post a comment saying:

Ready to merge

and I'll merge this PR almost instantly. Thanks for helping out! ❤️

(@Tyler-Zhang, @DavidNorena, @FabianMeul: you can do this too.)

@jdmunro
Copy link
Contributor Author

jdmunro commented Jul 30, 2020

Ready to merge

@typescript-bot typescript-bot merged commit 97005c9 into DefinitelyTyped:master Jul 30, 2020
@jdmunro jdmunro deleted the react-native-calendars/missing-prop branch July 30, 2020 16:27
astorije pushed a commit to astorije/DefinitelyTyped that referenced this pull request Jul 30, 2020
danielrearden pushed a commit to danielrearden/DefinitelyTyped that referenced this pull request Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Owner Approved A listed owner of this package signed off on the pull request. Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. Self Merge This PR can now be self-merged by the PR author or an owner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants