Typescript
Migrate all scripts from javascript to typescript.
For a pure stats purpose :
- 94 js files for 4700 codes lines
- 197 vue files, for 12,800 code lines (but probably only a third of js)
I've assigned it to myself, as I will try to migrate step by step. But everyone's help is appreciated :)
Chose a file, translate it to ts, do all necessary checks, and PR!
How to know which files you may be working on?
Mmmmh, good question :)
Opening an issue for each file would be an overkill I think. What about a message on this thread before starting a file (.js or .vue) /folder ?
Could another approch be possible? What about working in a branch, in which everyone can commit (maybe using PRs) until we reach a stisfactory status?
I am proposing this because I have had som problem to make linting coexist for both js and ts (and thus eslint and tslint). If I add a tslint config file, it is ignore by npm run lint but used by npm run build. I assume having both eslint and typescript plugins are causing some inconsistencies...
So maye we could migrate code to typescript in a branch, disabling eslint and using only typescript plugin?
tslint config would require some coniguration anyway.
What do you think?
The issue I would see is if we have to do some modification on a scripts still migrated to typescript during the next weeks : we will have a lot of demands from users in the next week for the "ergonomic phase". We can't keep this two branchs on a different functionnal and ergonomic state during the project.
I never do this task (js -> ts). We have around 10,000 code lines. In your opinion, how long (gross) it will take to migrate everything ?
I have no fucking idea :) Then, we could work with a tslint file that we do not commit?
Or... we stick to eslint for now and will switch to typescript when code is more stable.
Or... we stick to eslint for now and will switch to typescript when code is more stable.
Well, after more thought, it may be the best solution :
- most of function are ready, at the end of the project, we won't have no more 120% code lines than now.
- but still a big bunch of lines may change for next weeks. Trying to reach the two goals (deliver the project + migrate it to ts) is probably the best solution to miss the two targets...
If you're okay with that, let's postpone this point for the first "code freeze".
OK
Are you still willing to migrate everything to ts?
Mmmmh, project is postponed. I have some concern on it :
Pro
- definitly a better language that this old'n ugly JS
Con
- pretty big project, way out of our possibilities as now
- ok, JS is ugly. But at least, a lot of people know it. Will the balance of benevolant dev be positive with this move ? (open question)
ping @brunobesson , @momomaniac, @asaunier ?
Typescript is not a better language than javascript, just a superset. It has its pros and cons. But on the contrary to what your are saying, I do think that using typescript is easier for someone which is not fluent with JS. Adding typing is a huge help to those people. Off course, advanced features and avoiding horrible things such has any is another level, but people getting into the project will have less difficulties IMHO.
As for when to switch to typescript, I do think we should doing this when updating vuejs to version 3.
are there any tools for migrating JS -> TS ? Since the codebase is quite big, this would give a good headstart for having less manual work. On the other hand, I see no hurry to so the transition. I think it's not the JS syntax which is hard to get into, but the project as a whole. JS code is quite stable and obsolescence is not foreseeable. No priority IMHO.
On Mon, Apr 20, 2020 at 9:12 PM Bruno Besson [email protected] wrote:
Typescript is not a better language than javascript, just a superset. It has its pros and cons. But on the contrary to what your are saying, I do think that using typescript is easier for someone which is not fluent with JS. Adding typing is a huge help to those people. Off course, advanced features and avoiding horrible things such has any is another level, but people getting into the project will have less difficulties IMHO.
As for when to switch to typescript, I do think we should doing this when updating vuejs to version 3.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/c2corg/c2c_ui/issues/45#issuecomment-616753177, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANY5RCTYCZA7U3H7XFREPZTRNSNBHANCNFSM4GOKEXVA .
If you don't enforce some checks, js is valid ts