nextcloud / weather

⛅️ Weather app for Nextcloud
GNU Affero General Public License v3.0
47 stars 27 forks source link

Migrate away from AngularJS #80

Open e-alfred opened 4 years ago

e-alfred commented 4 years ago

AngularJS is in LTS mode currently and will be deprecated in 2021 after a 3 year period. We should move away from AngularJS to Vue probably at some point in the future.

nerzhul commented 4 years ago

@e-alfred i approve totally with you. the move has been done on ocsms if i remember but not on this. It's not difficult to move away from angular as the templating may be the same. Also the new code may be proper than before :)

berdosi commented 4 years ago

Started to fool around with this issue, but there's still a lot of work to do there: https://github.com/berdosi/weather/tree/migrate-to-vue

There are still bugs, missing features, and lots of old code abused and patched up for reuse. It more of a demo / learning project, than a meaningful contribution at the moment.

e-alfred commented 4 years ago

@berdosi Nice work for a start. It isn't quite urgent as there is still support for AngularJS until 2021, but it would be good to do it until then anyway.

Maybe you can make a draft PR and work from there onwards? We could merge it the if it becomes stable sometime in the future.

nerzhul commented 4 years ago

hello @berdosi i looked at your MR seems promising but not very readable JS code unfortunately due to the one big file :(

berdosi commented 4 years ago

Hello, @nerzhul, I'll make efforts to structure it better for the to-be-merged version; it should be relatively easy to split the code to components (ocsms is a good point of reference :)).

I still have some warnings to clean up before starting to refactor, though.

berdosi commented 4 years ago

I split it up to Settings / CityList / Forecast, and the components communicate with each other through a shared store. I don't consider it to be very idiomatic, but at least the file is split up. (While app.js is still in place for my reference, it isn't linked to through main.php)

Apart from migrate-to-vue, I've started playing with migrate-to-vue-split-components, using separate templates. I consider the other version with fewer, bigger files more readable.