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

[Tracking]: JS -> TS refactor the remaining .js file to .ts and esm #7225

Closed
18 tasks done
SoonIter opened this issue Jul 19, 2024 · 15 comments
Closed
18 tasks done

[Tracking]: JS -> TS refactor the remaining .js file to .ts and esm #7225

SoonIter opened this issue Jul 19, 2024 · 15 comments
Assignees
Labels
contrib: easy good first issue Good for newcomers pr welcome tracking issue Category: A tracking issue for an RFC or an unstable feature.
Milestone

Comments

@SoonIter
Copy link
Member

SoonIter commented Jul 19, 2024

What subject does this issue tracking?

JS -> TS

  1. refactor the remaining .js file to .ts
  2. remove all ts-expect-error
  3. use typescript rather than JSDocs
  4. It is best not to use default imports or exports, "module": "nodenext" causes dynamic imports to be double default-wrapped - e.g. { default: { default: Foo } } microsoft/TypeScript#59257
  5. aligned with webpack

#4640

Rename to .ts file

Type Coverage

Increase type coverage

---- 2024.09.21

Our main files have been completed, and on this basis, we can do some work to increase the type coverage

type coverage contribution guide is in #7225 (comment)

this issues is closed, but any pr that increases the type coverage is acceptable.

@SoonIter SoonIter added tracking issue Category: A tracking issue for an RFC or an unstable feature. pr welcome labels Jul 19, 2024
@SoonIter SoonIter self-assigned this Jul 19, 2024
@SoonIter
Copy link
Member Author

A very huge task, pr welcome~ :D

@SoonIter
Copy link
Member Author

SoonIter commented Jul 29, 2024

Use https://github.com/alexcanessa/typescript-coverage-report to count the typescript coverage

Before

image

After #7289

Still remaining some ts files

image

our goal is reach >= 97%, so if you are interested in fixing some typescript any problem, also pr welcome ~

@wxiaoyun
Copy link
Contributor

I will work on src/stats/StatsFactory.ts @shulaoda

@shulaoda
Copy link
Collaborator

I will work on src/stats/StatsFactory.ts @shulaoda

I am working on src/logging/truncateArgs.ts 👀

@wxiaoyun
Copy link
Contributor

Thanks for leaving utils/webpack
Please let me work on it ❤️

@wxiaoyun
Copy link
Contributor

I will work on src/node/nodeConsole.ts as well ❤️

@SoonIter
Copy link
Member Author

SoonIter commented Aug 5, 2024

after #7437

image

our type coverage reach 95.38%, type coverage of each file >= 80%

👏🏻👏🏻👏🏻Thank you all

any pull request to increase type coverage is acceptable

type coverage contribution guide

  1. run pnpm install cd ./packages/rspack
  2. run npx typescript-coverage-report
  3. view files with low type coverage to contribute

@shulaoda
Copy link
Collaborator

shulaoda commented Aug 5, 2024

type coverage contribution guide

  1. run pnpm install
  2. run pnpm run type-coverage
  3. view files with low type coverage to contribute

Should we add a script in package.json?

@SoonIter
Copy link
Member Author

SoonIter commented Aug 5, 2024

Should we add a script in package.json?

Sorry, updated with npx typescript-coverage-report

@Technologeek
Copy link

Hey @SoonIter Still relevant to increase the type coverage for some of the files mentioned?

@shulaoda
Copy link
Collaborator

shulaoda commented Sep 3, 2024

Hey @SoonIter Still relevant to increase the type coverage for some of the files mentioned?

Welcome, try to do it.

@SoonIter
Copy link
Member Author

SoonIter commented Sep 3, 2024

Hey @SoonIter Still relevant to increase the type coverage for some of the files mentioned?

yeah, pr welcome

@pawel-twardziak
Copy link

Is there anything left to work on here? :)

@SoonIter
Copy link
Member Author

Is there anything left to work on here? :)

Yeah, we can increase the type coverage according to #7225 (comment)

@SoonIter
Copy link
Member Author

this issues is closed, but any pr that increases the type coverage is acceptable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contrib: easy good first issue Good for newcomers pr welcome tracking issue Category: A tracking issue for an RFC or an unstable feature.
Projects
None yet
Development

No branches or pull requests

6 participants