-
Notifications
You must be signed in to change notification settings - Fork 138
Move away from AngularJS, ideally to Vue.js (standard for Nextcloud apps) #241
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
Comments
I totally agree that we have to replace the old AngularJS framework with something new. We definitely have to do something. However, I did some research on this topic. It appears that most Nextcloud apps plan/work on switching or already switched to VueJS: Already done:
Active work: Planned: And this is just a selection of most important apps. Before, there was a longer discussion about a suitable framework/library: Meanwhile, there is a project which develops specific components for a convenient integration of Vue in Nextcloud: https://github.com/nextcloud/nextcloud-vue Considering this all, I think it would be best if the notes app switches to VueJS, too. Please note, this this is not a discussion about the best framework/library. It's more about how to integrate a Nextcloud app in it's ecosystem and consolidate the app infrastructure. So, let's do it! Let's switch to VueJS! Any help is very appreciated :-) |
Summoning Vue JS maestro @skjnldsv for some input. Maybe we can migrate some components step by step or migrate the whole app at once? Maybe you have even some time to create some kind of roadmap/plan for a possible migration and some code input? :) |
Hey there 😁 👋 The migration thoughts plan I used was:
It allowed us to avoid the same mistakes we did before and fix a crazy amount of issues. No idea how complicated the notes is, but I'll assume this is just a markdown editor, so I'm pretty sure you can already find some libs for that. https://github.com/vuejs/awesome-vue#markdown For an example app you can check https://github.com/skjnldsv/vueexample. This is a simple one we used on some workshop I did with @juliushaertl ;) if you have questions, shoot! 🔥 |
Thanks for your overview, @skjnldsv :-) |
Hey @skjnldsv, there are so many dependecies to other JS libs in your example app. Are they all really required? The demo app is doing nothing, but I get a warning from webpack, that the resulting JS is too large (packed, it's about half a mega byte). I'm a friend of minimalism regarding dependencies. Can we kick something out? |
Yes, you can kick some! {
"@babel/polyfill": "^7.0.0", // NOT NEEDED
"nextcloud-vue": "^0.4.2",
"uuid": "^3.3.2", // NOT NEEDED
"vue": "^2.5.21",
"vue-click-outside": "^1.0.7", // NOT NEEDED
"vue-router": "^3.0.1",
"vuex": "^3.0.1",
"vuex-router-sync": "^5.0.0"
} For the rest since i'm sure you'll use vuex, you will still need them. For the vue components, one of our issue currently is that you can only import the full bundle in webpack. |
Thanks, but that didn't change the resulting file size. I suppose that those libraries are required by other dependencies anyway. However, I executed Hence, I think It would be really nice, if this dependency can shrink. 😃 |
Like I said, you're 100% right 🙈 I removed the vue compiler as well! |
Yeah, I would like to, but webpack is totally new for me. Let's see what I can contribute in a few months ... |
Good point, I think that it would be nice if |
Yes, this is called tree shaking apparently: https://webpack.js.org/guides/tree-shaking/ Ideally, we should aim to that ;) |
I've created the branch |
Uh oh!
There was an error while loading. Please reload this page.
This might require some refactoring, but AngularJS is nearly its end of life.
Another benefit could be to motivate some new contributors to help code on the server app (including me).
I'd suggest to setup a new project using the angular cli and try to move everything that's possible.
The text was updated successfully, but these errors were encountered: