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

[milestone] Convert the library to typescript #4700

Open
25 of 28 tasks
mirus-ua opened this issue Apr 17, 2024 · 30 comments
Open
25 of 28 tasks

[milestone] Convert the library to typescript #4700

mirus-ua opened this issue Apr 17, 2024 · 30 comments

Comments

@mirus-ua
Copy link
Contributor

mirus-ua commented Apr 17, 2024

Contribution is welcome

Why?

Everything started here from the willing to merge a separate package with the corresponding type definitions into this repo.
The idea is great, but we, as a community, can go further and migrate the entire code base into typescript.

Any benefits?

  • only one package to install for end users
  • easier to maintain
  • your help to the lovely library
  • ???
  • profit

Our steps to achieve the goal

Modules to migrate and how to contribute

Basic rules and advice:

  • start with the smallest isolated modules, like calendar_container.jsx
  • prevent the use any or other loose types if you don't have strong arguments
  • prevent using "slow types", give this option to the end users
  • use interfaces instead of types because the large amount of the code base is class-based
  • add JSDocs where you can to improve overall DX. Everyone likes a good DX

Steps to contribute

  1. Write in the comments the name of the module that you want help to migrate
  2. Me or a maintainer will assign your name to the list to prevent doing the same job twice
  3. Migrate according to the list of advice above
  4. Highly recommended to migrate test cases together with the module
  5. Create a PR with a name format [typescript-migration] calendar.jsx etc.

Breaking changes so far:

  • newDate helper always returns a date, if the initial params were invalid, then it returns just a new Date Line; PR
  • calendarIconClassname => calendarIconClassName PR
@mirus-ua mirus-ua changed the title (draft)[milestone] Convert the library to typescript [milestone] Convert the library to typescript Apr 19, 2024
@mirus-ua
Copy link
Contributor Author

@martijnrusschen can you pin the issue?

@martijnrusschen
Copy link
Member

Nice progress so far!

@yuki0410-dev
Copy link
Contributor

@mirus-ua ( @martijnrusschen )
Thank you for the great attempt.
I would like to help as well, but should I declare the file to be started on this issue?

@yuki0410-dev
Copy link
Contributor

refs #4000

@martijnrusschen
Copy link
Member

@yuki0410-dev Feel free to claim a file and let it know here so there's no duplicate work done.

@mirus-ua
Copy link
Contributor Author

@yuki0410-dev hello
Yes, grab anything, the only one piece of advice is to pick modules without dependencies or with dependencies only on typescript modules, because it won't be pleasant to combine them later

@Olenka-Yurchuk
Copy link
Contributor

I would like to take the portal jsx file in work

@yuki0410-dev
Copy link
Contributor

I would like to take the week_number.jsx file in work

@mirus-ua
Copy link
Contributor Author

Added your name to week_number.jsx

@mirus-ua
Copy link
Contributor Author

6.6% 💪

Знімок екрана 2024-04-23 о 17 15 33

@yuki0410-dev
Copy link
Contributor

@mirus-ua
I would like to take the year_dropdown.jsx and year_dropdown_options.jsx file in work.

@yuki0410-dev
Copy link
Contributor

@mirus-ua
I would like to take the month_dropdown.jsx and month_dropdown_options.jsx file in work.

@mirus-ua
Copy link
Contributor Author

@martijnrusschen hello. Please ask reviews to look at four opened PRs if you can. It'll be much faster if we merge them because the rest of the modules depend on them

@martijnrusschen
Copy link
Member

Yep, I'll expect them to complete this soon. Normal turnaround time is ~2-4 hours.

@yuki0410-dev
Copy link
Contributor

@mirus-ua
I would like to take the calendar.jsx file in work.

@yuki0410-dev
Copy link
Contributor

@mirus-ua
Modifications to index.jsx may need to be synchronized with modifications to calendar.jsx. (especially the props type)
Would it be ok if I work on it all together?

@mirus-ua
Copy link
Contributor Author

@mirus-ua Modifications to index.jsx may need to be synchronized with modifications to calendar.jsx. (especially the props type) Would it be ok if I work on it all together?

sure, I think you should wait a bit for the month and the year modules

@yuki0410-dev
Copy link
Contributor

@mirus-ua

sure, I think you should wait a bit for the month and the year modules

I agree with waiting too.
We are moving forward on the calendar.jsx work, but there are some aspects that we cannot move forward on until those are completed.

@martijnrusschen
Copy link
Member

martijnrusschen commented Apr 29, 2024 via email

@mirus-ua
Copy link
Contributor Author

mirus-ua commented May 3, 2024

@yuki0410-dev almost everything was merged, so you can start with the final part

@martijnrusschen
Copy link
Member

what's left?

@yuki0410-dev
Copy link
Contributor

@mirus-ua (@martijnrusschen )
I would like to take the week_picker_test.test.js file in work. and fix some types.

@mirus-ua
Copy link
Contributor Author

what's left?

The core features are done.But I think better to migrate some amount of tests just to double check that all types are OK

@yuki0410-dev
Copy link
Contributor

@mirus-ua
I noticed during my experimentation with #4810 that type errors in the test file do not seem to result in errors in CI.
Is it my understanding that this is due to the fact that I am now using babel-jest to run tests with type information ignored, and that when I change to ts-jest later on, I will get CI errors?

@mirus-ua
Copy link
Contributor Author

@mirus-ua I noticed during my experimentation with #4810 that type errors in the test file do not seem to result in errors in CI. Is it my understanding that this is due to the fact that I am now using babel-jest to run tests with type information ignored, and that when I change to ts-jest later on, I will get CI errors?

everything is correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants