Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

MM-34366: Wip: Migrate 'components/post_view/post_list_virtualized' and associated tests to TypeScript #8347

Closed
wants to merge 37 commits into from

Conversation

naftalimurgor
Copy link

Summary

This pull request makes TypeScript type definitions available for DynamicSizeList component which used in PostList component in components/post_view/post_list_virtualized.jsx
This is work in progress for this issue mattermost/mattermost#17289

Ticket Link

JIRA: https://mattermost.atlassian.net/browse/MM-34366
issue: mattermost/mattermost#17289

Related Pull Requests

  • Has no server changes
  • Has no mobile changes

Screenshots

Release Note

NONE

…cript

add type definitions for 'dynamic-virtualized-list` package.
…cript

Refactor tests in `post_list_virtualized.test.jsx` for PostList component.
…cript

lint `dynamic-virtualized-list.d.ts` to remove trailing white spaces.
@mattermod
Copy link
Contributor

Hello @naftalimurgor,

Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.

@mattermod mattermod added 2: Dev Review Requires review by a core commiter 3: QA Review Requires review by a QA tester labels Jul 6, 2021
@devinbinnie devinbinnie added the Work in Progress Not yet ready for review label Jul 6, 2021
@naftalimurgor
Copy link
Author

@devinbinnie Yup, It's a WIP.

@mattermod
Copy link
Contributor

This PR has been automatically labelled "stale" because it hasn't had recent activity.
A core team member will check in on the status of the PR to help with questions.
Thank you for your contribution!

/cc @jasonblais @jfrerich @emilyacook

@devinbinnie
Copy link
Member

Hey @naftalimurgor, just wondering how things are going/if you had any questions to get this moved along.

@naftalimurgor
Copy link
Author

naftalimurgor commented Jul 19, 2021

Hey @devinbinnie
Currently I have two questions, but first, my appologies, I got so busy. There are two more git Pull Request to address this issue:- On that:

  1. Migrate components/post_view/post_list_virtualized.jsx to TypeScript
  2. Migrate components/post_view/post_list_virtualiz.test.jsx to TypeScript
    Will submit them in that order.

@naftalimurgor
Copy link
Author

naftalimurgor commented Jul 19, 2021

My questions are kinda ambigous, bear with me,

  1. I branched from master, create a branch named MM-34346, my question is: do I just change the file extensions from .jsx to .tsx for both branches at a go? Like simultaneously? Then do the changes?
    I'm still kind of new to git.
    Here's what I did:
  2. I worked on the branch, and made the migration, if I merged the changes, I'll end up having both .jsx files and .tsx existing side by side. Kindly help clarify this.

Thanks

@devinbinnie
Copy link
Member

My questions are kinda ambigous, bear with me,

  1. I branched from master, create a branch named MM-34346, my question is: how do just change the file extensions from .jsx to .tsx for both branches at a go? Like simultaneously? Then do the changes?
  2. I'm still kind of new to git.
  3. Here's what I did:
  4. I worked on the branch, and made the migration, if I merged the changes, I'll end up having both .jsx files and .tsx existing side by side. Kindly help clarify this.

Thanks

No worries @naftalimurgor. So what you would want to do is rename the files using the new extension, and then in the same commit, do a git rm on the .jsx file and then a git add on the .tsx file.

As a suggestion, if you use an editor like Visual Studio Code and stage the changes altogether, it should do all of this for you.

@naftalimurgor
Copy link
Author

Thanks @devinbinnie for the insight. Will submit the above mentioned PRs so we can move foward with this issue.

Make `isRhsPost` prop optional in `components/post_view/floating_timestamp/floating_timestamp.tsx` as it is not explicitly required in `/home/slax/git/enterprise/mattermost-webapp/components/post_view/post_list_row/post_list_row.tsx`
Update `togglePostMenu` function prop to accept `opened` as a boolean argument
change `post` and `channel` props to optional as they are not explicitly required in `PostListRow` component
…st_virtualized.tsx` to TypeScript

Add type definitions and all relevant type definitions imports.
Migrate 'components/post_view/post_list_virtualized' and associated tests to TypeScript
add `@types/react-virtualized-auto-sizer` from npm
`lastViewedAt` prop is an optional prop as it is not explicitly required in the unit tests under `post_list_virtualized.test.tsx`
Lint and fix to conform to EsLint rules
`lastViewedAt` prop is an optional prop as it is not explicitly required in the unit tests under `post_list_virtualized.test.tsx`
Lint and fix to conform to EsLint rules
…ist_virtualized.test.tsx`

add type definitions for `AutoSizer` and `DynamicSizeList`, change from type   `any` to  `DynamicSizeListDimensions`
MM-34366: Migrate 'components/post_view/post_list_virtualized' and associated tests to TypeScript
@naftalimurgor
Copy link
Author

Hey @devinbinnie
The PR is ready, however ci/circleci: type-check keeps failing despite adding @types/react-virtualized-auto-sizer by running: npm i --save-dev @types/react-virtualized-auto-sizer.
Any insights are highly welcome on resolving this issue.
Thank you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
2: Dev Review Requires review by a core commiter 3: QA Review Requires review by a QA tester Lifecycle/1:stale release-note-none Work in Progress Not yet ready for review
Projects
None yet
4 participants