Skip to content

chore(ui): init typescript #4408

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

manudeli
Copy link

@manudeli manudeli commented May 9, 2025

related with #2770

This PR updates the project configuration to support a gradual migration from JavaScript to TypeScript. Specifically:

  1. Replaced jsconfig.json with tsconfig.json
  2. Enabled the allowJs option to allow the TypeScript compiler to include existing .js files

The goal is to eventually migrate all files in packages/ui to .ts/.tsx, improving type safety and developer experience across the codebase.

{
"compilerOptions": {
// TODO: Remove this once we have migrated to TS
"allowJs": true,
Copy link
Author

Choose a reason for hiding this comment

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

The allowJs option in a tsconfig.json file allows the TypeScript compiler to include and process .js (JavaScript) files alongside .ts (TypeScript) files. This is useful when: We're migrating a JavaScript project to TypeScript gradually.

@manudeli manudeli marked this pull request as ready for review May 9, 2025 09:21
@manudeli
Copy link
Author

Hi @HenryHengZJ, I’d appreciate it if you could check this out 🙏

@HenryHengZJ
Copy link
Contributor

Hey! Super appreciate your work here. We have a big refractor coming in, will hold off to this PR for now

@manudeli
Copy link
Author

Hey! Super appreciate your work here. We have a big refractor coming in, will hold off to this PR for now

Okay! Let me know after if you need me

@0xi4o
Copy link
Contributor

0xi4o commented Jun 25, 2025

@manudeli If you're still up for it, can you pull the latest from main branch and resolve the conflicts here? I can review and merge this one. Let me know if you need any help.

@0xi4o 0xi4o added enhancement New feature or request ui Issues or features related to ui labels Jun 25, 2025
@manudeli
Copy link
Author

@manudeli If you're still up for it, can you pull the latest from main branch and resolve the conflicts here? I can review and merge this one. Let me know if you need any help.

Sure, I'll do that soon

@manudeli manudeli force-pushed the ui/typescript-init branch from bad32b4 to 15e0e14 Compare June 28, 2025 17:20
@manudeli
Copy link
Author

@manudeli If you're still up for it, can you pull the latest from main branch and resolve the conflicts here? I can review and merge this one. Let me know if you need any help.

@0xi4o I resolved conflict 👍

Comment on lines +19 to +21
if (root == null) {
throw new Error('Root element with id "root" not found.')
}
Copy link
Author

Choose a reason for hiding this comment

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

To get Type-safety. I added asserting code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ui Issues or features related to ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants