-
Notifications
You must be signed in to change notification settings - Fork 56
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
Vue #95
Vue #95
Conversation
Rebased on top of the latest changes |
@nickvergessen Do we really want it in 13 or wait for 14? |
I don't care too much, it comes with the nice addition that the icon is now always visible and there is a decent empty content view. But yeah it's a complete rewrite of the js. |
13 please since having the bell always would be ❤️ for the release 😄 With empty content it looks nice, but when you have notfications, the UI is a bit broken (at least on Safari) ...
|
We only have the RC stage left and I would avoid to bring in completely rewritten code that late. :/ |
@ChristophWurst can you check the last commit, is that correct? If so we need to discuss with @MorrisJobke how we do that for shipped apps? |
js/components/root.js
Outdated
@@ -7,6 +7,8 @@ | |||
* later. See the COPYING file. | |||
*/ | |||
|
|||
require('./notification'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the intended use is that the require call returns the module. The way you're using it webpack will load the module, but the module then just registers some stuff in a global variable which you later access. This is kinda hacky and error-prone.
I don't know if it's easy to migrate here, but get rid of the OCA.XXX = xxx
stuff. Don't use those globals and instead, have webpack locate the module and inside the module you export whatever you previously registered as global variable.
Does that make sense? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See nextcloud/twofactor_u2f@ae4fe1c#diff-ccd4d3da9150404f0f6690291ba3add9 as an example. The view class is exported because it's the returned value of the module definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worked fine for the components I think.
in app.js the exporting to OCA.Notifications is okay I guess?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in app.js the exporting to OCA.Notifications is okay I guess?
Is OCA.Notifications
used elsewhere, outside of this app?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If not, how about making app.js
a module like the other components which you then load in a init.js
script where you start the app like
define(function(require) {
'use strict';
var $ = require('jquery')
var App = require('./app')
$(function() {
var app = new App()
app.initialize()
})
})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ReferenceError: define is not defined
😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is reported for app.js but I dont get why :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmmm but you don't include the app.js
file directly, right? It's bundled with webpack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, tested it a bit, when I remove import Vue from 'vue';
it works. should I move that somewhere else, or replace it with a different call?
Yes, correct. Just cloned this branch and you're apparently mixing module syntax. The Use |
When I do |
vuejs/vue#5470 (comment) maybe |
That worked, squashed it all |
@MorrisJobke
|
js-src/components/action.vue
Outdated
} | ||
</script> | ||
|
||
<style scoped> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you can omit the style tag if it's unused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, tested and done
Last two thing I don't understand:
|
Signed-off-by: Joas Schilling <coding@schilljs.com>
3687744
to
d1d788a
Compare
Signed-off-by: Joas Schilling <coding@schilljs.com>
They are very useful for debugging, e.g. when people report errors on the client-side, the browser will otherwise not be able to tell you where the error occurred in your respective source file. Hence, it will just show |
Ah okay, so we will keep it and ship it. Fine by me, just didnt know what this is about |
Signed-off-by: Joas Schilling <coding@schilljs.com>
Fixed the vue dev issue, although that should work automatically as per https://vuejs.org/v2/guide/deployment.html Ready to review and merge: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good so far, didn't test though
--exclude=/.drone.yml \ | ||
--exclude=/node_modules \ | ||
--exclude=/npm-debug.log \ | ||
--exclude=/package.json \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you're using an up-to-date version of npm, it will generate a package-lock.json
. You might want to exclude that too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont have that on npm 5.6.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, maybe it's just generated if you use npm install --save xxx
or similar https://docs.npmjs.com/files/package-lock.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm let me add this, so everyone is installing the same stuff?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly, it locks down the exact version number, just like composer does with composer.lock
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, and it speeds up npm install
as npm doesn't have to build the dependency graph 👍
package.json
Outdated
"vue": "^2.5.13" | ||
}, | ||
"devDependencies": { | ||
"babel-core": "^6.26.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if you actually need/use babel. Looks like it's all ES5 and thus can be run in all our supported browsers.
package.json
Outdated
"vue-loader": "^13.7.0", | ||
"vue-template-compiler": "^2.5.13", | ||
"webpack": "^3.6.0", | ||
"webpack-dev-server": "^2.11.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dev-server is probably not needed and can be removed
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested. Works 👍
@georgehrke mind having a look at the Vue stuff? I think it was pretty easy and straight forward after reading the docs
Fix #2
Todos: