You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This should be done in small, maximally isolated PRs: no more than a few files updated per PR so that we can slowly review and phase these in over time. Community contributions appreciated!
Hey maintainers!
I would love to take this issue up, looks like an amazing learning opportunity! I'm not very experienced with Typescript, but know the basics.
That's great to hear, and we'd definitely appreciate the help! https://docs.flarum.org/contributing.html might be a good place to start for setup stuff (and reading a bit more about how flarum works). Our community forums and discord chat are also good resources if you have questions / run into issues.
Is this a good issue for multiple contributors? I'd also like to work on this, and I've joined the discord so we might make sure not to double up on work.
Reacted by Ajay Kumar, Mihir Gupta, Lucas Azevedo and Aatmik Sanghvi
@knoxd8256 this would be a great issue for multiple contributors, my recommendation would be to negotiate work being done via our discord chat and/or this issue so that we don't have repeat file updates.
Can I confirm that the file naming conventions for TypeScript files are .ts for general code and .tsx for anything containing JSX-like syntax? The linked PRs seem to be following these naming conventions but the unconverted JS files are all .js. The reason I'm asking is that if .tsx files are the new norm for components and the like, this line in tsconfig.json needs to be updated to include them to get rid of certain warnings, i.e. the esModuleInterop one:
this line in tsconfig.json needs to be updated to include them to get rid of certain warnings, i.e. the esModuleInterop one:
Hm, if that's the source of the warning then that's a big 🤦 for me. Feel free to PR to that - it might be enough if you just add * after *.ts, can't remember if that works or not.
Hm, if that's the source of the warning then that's a big facepalm for me. Feel free to PR to that - it might be enough if you just add * after *.ts, can't remember if that works or not.
According to the docs (see quote below), all that needs to be done is removing the .ts. file extension and it will automatically pick up only the converted files and not the entire codebase.
If a glob pattern doesn’t include a file extension, then only files with supported extensions are included (e.g. .ts, .tsx, and .d.ts by default, with .js and .jsx if allowJs is set to true).
Also, there are more warnings in the files that's already been converted to TypeScript. Wouldn't it be great if these were caught automatically by a GitHub action? ESLint has a plugin for TypeScript, perhaps it could be added to the workflow?
@nina-py Resolving TS warnings is not a priority because we're using TS to help typehinting mainly, not to have perfect code (in terms of TS warnings). If you want to PR fixes for warnings tho, go ahead (unless they make the code ugly, then we may ignore it).
Hi everyone! I'm in the same @Niveditha-K17 situation, i want to contribute, it would be a fantastic way to improve my Typescript skills. Still need PRs?
Hi everyone! I'm in the same @Niveditha-K17 situation, i want to contribute, it would be a fantastic way to improve my Typescript skills. Still need PRs?
Ok, thank you. Can I take files freely or do I have to warn/agree with someone? I read that there was talk of agreeing on Discord but not being on the server I don't know
Activity
[-]Convert all core JS to Typescript[/-][+]Convert core JS to Typescript[/+]mihirgupta0900 commentedon Oct 2, 2020
Hey maintainers!
I would love to take this issue up, looks like an amazing learning opportunity! I'm not very experienced with Typescript, but know the basics.
askvortsov1 commentedon Oct 2, 2020
That's great to hear, and we'd definitely appreciate the help! https://docs.flarum.org/contributing.html might be a good place to start for setup stuff (and reading a bit more about how flarum works). Our community forums and discord chat are also good resources if you have questions / run into issues.
mihirgupta0900 commentedon Oct 2, 2020
Great to hear! I've joined the discord chat and I'll go through the links in a few hours and get started soon!
knoxd8256 commentedon Oct 3, 2020
Is this a good issue for multiple contributors? I'd also like to work on this, and I've joined the discord so we might make sure not to double up on work.
tankerkiller125 commentedon Oct 3, 2020
@knoxd8256 this would be a great issue for multiple contributors, my recommendation would be to negotiate work being done via our discord chat and/or this issue so that we don't have repeat file updates.
nina-py commentedon Nov 17, 2020
Can I confirm that the file naming conventions for TypeScript files are
.tsfor general code and.tsxfor anything containing JSX-like syntax? The linked PRs seem to be following these naming conventions but the unconverted JS files are all.js. The reason I'm asking is that if.tsxfiles are the new norm for components and the like, this line intsconfig.jsonneeds to be updated to include them to get rid of certain warnings, i.e. theesModuleInteropone:https://github.com/flarum/core/blob/9cb9097b24e0345816f2f8ef22789ab804e796f6/js/tsconfig.json#L2
dsevillamartin commentedon Nov 17, 2020
@nina-py Yes, we use
.tsxfor JSX.Hm, if that's the source of the warning then that's a big 🤦 for me. Feel free to PR to that - it might be enough if you just add
*after*.ts, can't remember if that works or not.askvortsov1 commentedon Nov 17, 2020
Maybe that might also help with the ESDoc generation issue? Although I doubt it
dsevillamartin commentedon Nov 17, 2020
@askvortsov1 Don't think so - that's a separate config file anyway.
nina-py commentedon Nov 18, 2020
Thanks @datitisev, a PR is on the way.
According to the docs (see quote below), all that needs to be done is removing the
.ts.file extension and it will automatically pick up only the converted files and not the entire codebase.https://www.typescriptlang.org/tsconfig#include
nina-py commentedon Nov 18, 2020
Also, there are more warnings in the files that's already been converted to TypeScript. Wouldn't it be great if these were caught automatically by a GitHub action? ESLint has a plugin for TypeScript, perhaps it could be added to the workflow?
dsevillamartin commentedon Nov 18, 2020
@nina-py Resolving TS warnings is not a priority because we're using TS to help typehinting mainly, not to have perfect code (in terms of TS warnings). If you want to PR fixes for warnings tho, go ahead (unless they make the code ugly, then we may ignore it).
14 remaining items
Niveditha-K17 commentedon Jan 5, 2023
Hello maintainers!
I'm new to Typescript but I'm eager to learn and would love to contribute.
Is there any issue I can take up?
afunctional commentedon Sep 7, 2024
Hi everyone! I'm in the same @Niveditha-K17 situation, i want to contribute, it would be a fantastic way to improve my Typescript skills. Still need PRs?
luceos commentedon Sep 7, 2024
Yeah, there's still plenty to convert. See for instance this path: https://github.com/flarum/framework/tree/2.x/framework/core/js/src/forum/components
afunctional commentedon Sep 7, 2024
Ok, thank you. Can I take files freely or do I have to warn/agree with someone? I read that there was talk of agreeing on Discord but not being on the server I don't know
dk5488 commentedon Oct 1, 2024
Hey everyone! Is there anything left to convert?? would love to help
produdez commentedon Jul 26, 2025
Hi guys, i'm also interested in helping if there's any TS conversion work needed? Couldn't access the project board link https://github.com/orgs/flarum/projects/21.