[acousticbrainz-server] alastair opened pull request #375 (master…ab420-unicode-dataset): AB-420: allow unicode characters in MBIDs when uploading a dataset https://github.com/metabrainz/acousticbrainz-se...
[acousticbrainz-server] alastair opened pull request #376 (master…use-logger): AB-67, AB-366: Use the flask logger instead of print for informational messages https://github.com/metabrainz/acousticbrainz-se...
[acousticbrainz-server] alastair opened pull request #378 (master…ab439-hl-threads): AB-439: Use concurrent.futures to manage threading in hl extractor https://github.com/metabrainz/acousticbrainz-se...
it was originally written maybe 4 or 5 years ago, and so doesn't use the recent best-practises in how to set up a react app
I upgraded it last week to use the latest react, and to use webpack to compile it, but I'd like to improve it further. Maybe make a separate jsx file per component, and consider using ts
it's currently small enough that I think that this is the right time to do it, because if we keep adding more functionality it'll get more difficult to update
ishaanshah[m]
Yep, makes sense, typescript definitely helps a lot in development
alastairp
I thought that since you seem to have some good experience in this are you might want to mentor me with the task ;)
*this area
ishaanshah[m]
Mentoring might be a strong word, but yes I would definitely like to help in any way I can :)
Mainly I see that multiple components are written in the same file as you said
alastairp
I think I understand enough about the process to move components to a separate file. Is there a good guide or automated tool for migrating to typescript?
jmp_music
alastairp: Good morning! I haven't yet received the dataset link to my email.
alastairp
jmp_music: oh wow, sorry! I left the process copying on Friday afternoon and didn't look at my work computer on the weekend. I'll put that on my todo list today
ishaanshah[m]
Typescript finally compiles to javascript
jmp_music
alastairp: thanks! :)
alastairp
ishaanshah[m]: I understand that typescript removes the requirement for proptypes? Does it use the same mechanism, or is there a different one?
ishaanshah[m]
The way we have setup things on LB is
alastairp
yes, I understand that it compiles to js, I want to know how to add ts features to the source files. Does this have to be done manually, or is there a tool that helps by rewriting some features to ts-specific code?
ishaanshah[m]
There are two containers, one which transpiles all ts code to js and another which type-checks the code
so this command will just tell you if it's found type errors or not?
ishaanshah[m]
yes
alastairp
will it fail to compile to js if there are errors?
ishaanshah[m]
No it won't which aids greatly in development
alastairp
OK, I see. Is this why you have it as two separate steps?
ishaanshah[m]
Because you might wan't to try out some idea but typescript errors keep popping up
Refusing to compile
alastairp
ok. right
ishaanshah[m]
So basically we use babels typescript loader for compilation
alastairp
cool, I'll see if I can look at this in the next week or so. If you're interested in helping with these steps then you're also welcome to make some changes!
ishaanshah[m]
I read about it on a blog somewhere I will try and find a link
alastairp
yes, I see that in your webpack config
ishaanshah[m]
alastairp: Sure, I would love to help
While you are at I think you should also consider setting up ESLint+Prettier
we have a very small amount of other javascript in the project. We don't need to upgrade this to react, but more recent js standard, or typescript, and eslint/prettier here would also be good
ishaanshah[m]
Yes we can do that
I will work on setting up ESlint then
alastairp
how do you use prettier in LB? Do you have checks on PRs to see if it doesn't fulfil the guidelines, or do you have tools to automatically reformat the code when needed?
I use pycharm. I see that it has built-in support, but I need to see exactly what that means. Maybe I can configure it to reformat when I save
ishaanshah[m]
It will format the code according to the prettier config that we have provided on save
alastairp
OK, there's a config file that we add to the repo, then? That's fine
ishaanshah[m]
Almost all modern ide have support
But we still do a check in travis CI to make sure everything is fine
I think there are github apps like pep8 speaks for JavaScript too but I havent looked into them yet
alastairp
I use these github checkers in another project. they're very comprehensive
here's the example github action config that we use in the project that gave that warning
it looks like it will, because it's run on a checked-out version of your code
there's a question here about how many external worker services we want to use... jenkins, circleci, travis, github actions...
reosarevok
bitmap, yvanzo ^ would this be a thing we'd want?
Zastai joined the channel
alastairp
that is, you can definitely just tell jenkins to run eslint, but the only thing you'd get there is "check failed", rather than detailed in-line commentary